@@ -105,7 +105,7 @@ Object.defineProperty(
105
105
* @param {Object } obj the object to test.
106
106
* @return {boolean } `true` if given object is a {@link Node}, `false` otherwise.
107
107
*/
108
- function isNode ( obj : object ) : boolean {
108
+ function isNode ( obj : object ) : obj is Node {
109
109
return hasIdentifierProperty ( obj , NODE_IDENTIFIER_PROPERTY )
110
110
}
111
111
@@ -186,7 +186,7 @@ Object.defineProperty(
186
186
* @param {Object } obj the object to test.
187
187
* @return {boolean } `true` if given object is a {@link Relationship}, `false` otherwise.
188
188
*/
189
- function isRelationship ( obj : object ) : boolean {
189
+ function isRelationship ( obj : object ) : obj is Relationship {
190
190
return hasIdentifierProperty ( obj , RELATIONSHIP_IDENTIFIER_PROPERTY )
191
191
}
192
192
@@ -272,7 +272,7 @@ Object.defineProperty(
272
272
* @param {Object } obj the object to test.
273
273
* @return {boolean } `true` if given object is a {@link UnboundRelationship}, `false` otherwise.
274
274
*/
275
- function isUnboundRelationship ( obj : object ) : boolean {
275
+ function isUnboundRelationship ( obj : object ) : obj is UnboundRelationship {
276
276
return hasIdentifierProperty ( obj , UNBOUND_RELATIONSHIP_IDENTIFIER_PROPERTY )
277
277
}
278
278
@@ -320,7 +320,7 @@ Object.defineProperty(
320
320
* @param {Object } obj the object to test.
321
321
* @return {boolean } `true` if given object is a {@link PathSegment}, `false` otherwise.
322
322
*/
323
- function isPathSegment ( obj : object ) : boolean {
323
+ function isPathSegment ( obj : object ) : obj is PathSegment {
324
324
return hasIdentifierProperty ( obj , PATH_SEGMENT_IDENTIFIER_PROPERTY )
325
325
}
326
326
@@ -374,7 +374,7 @@ Object.defineProperty(
374
374
* @param {Object } obj the object to test.
375
375
* @return {boolean } `true` if given object is a {@link Path}, `false` otherwise.
376
376
*/
377
- function isPath ( obj : object ) : boolean {
377
+ function isPath ( obj : object ) : obj is Path {
378
378
return hasIdentifierProperty ( obj , PATH_IDENTIFIER_PROPERTY )
379
379
}
380
380
0 commit comments