Skip to content

Commit 3c153c4

Browse files
committed
feat: use type predicates for narrowing
1 parent b640aaa commit 3c153c4

File tree

16 files changed

+19
-19
lines changed

16 files changed

+19
-19
lines changed

lib/node_modules/@stdlib/assert/is-absolute-http-uri/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* var bool = isAbsoluteHttpURI( null );
4949
* // returns false
5050
*/
51-
declare function isAbsoluteHttpURI( value: any ): boolean;
51+
declare function isAbsoluteHttpURI( value: any ): value is string;
5252

5353

5454
// EXPORTS //

lib/node_modules/@stdlib/assert/is-absolute-path/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface IsAbsolutePath {
3939
* // returns true
4040
* }
4141
*/
42-
( value: any ): boolean;
42+
( value: any ): value is string;
4343

4444
/**
4545
* Tests if a value is a POSIX absolute path.
@@ -55,7 +55,7 @@ interface IsAbsolutePath {
5555
* var bool = isAbsolutePath.posix( 'foo/bar/baz' );
5656
* // returns false
5757
*/
58-
posix( value: any ): boolean;
58+
posix( value: any ): value is string;
5959

6060
/**
6161
* Tests if a value is a Windows absolute path.
@@ -71,7 +71,7 @@ interface IsAbsolutePath {
7171
* var bool = isAbsolutePath.win32( 'foo\\bar\\baz' );
7272
* // returns false
7373
*/
74-
win32( value: any ): boolean;
74+
win32( value: any ): value is string;
7575
}
7676

7777
/**

lib/node_modules/@stdlib/assert/is-absolute-uri/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* var bool = isAbsoluteURI( null );
4545
* // returns false
4646
*/
47-
declare function isAbsoluteURI( value: any ): boolean;
47+
declare function isAbsoluteURI( value: any ): value is string;
4848

4949

5050
// EXPORTS //

lib/node_modules/@stdlib/assert/is-accessor-array/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* var bool = isAccessorArray( {} );
4040
* // returns false
4141
*/
42-
declare function isAccessorArray( value: any ): boolean;
42+
declare function isAccessorArray( value: any ): value is ArrayLike<any>;
4343

4444

4545
// EXPORTS //

lib/node_modules/@stdlib/assert/is-alphagram/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* var out = isAlphagram( 123 );
4949
* // returns false
5050
*/
51-
declare function isAlphagram( value: any ): boolean;
51+
declare function isAlphagram( value: any ): value is string;
5252

5353

5454
// EXPORTS //

lib/node_modules/@stdlib/assert/is-alphanumeric/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* var out = isAlphaNumeric( 123 );
4545
* // returns false
4646
*/
47-
declare function isAlphaNumeric( value: any ): boolean;
47+
declare function isAlphaNumeric( value: any ): value is string;
4848

4949

5050
// EXPORTS //

lib/node_modules/@stdlib/assert/is-arguments/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* var bool = isArguments( [] );
3737
* // returns false
3838
*/
39-
declare function isArguments( value: any ): boolean;
39+
declare function isArguments( value: any ): value is IArguments;
4040

4141

4242
// EXPORTS //

lib/node_modules/@stdlib/assert/is-array-array/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* bool = isArrayArray( [] );
3535
* // returns false
3636
*/
37-
declare function isArrayArray( value: any ): boolean;
37+
declare function isArrayArray( value: any ): value is Array<Array<any>>;
3838

3939

4040
// EXPORTS //

lib/node_modules/@stdlib/assert/is-array-length/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* var bool = isArrayLength( 3.14 );
3737
* // returns false
3838
*/
39-
declare function isArrayLength( value: any ): boolean;
39+
declare function isArrayLength( value: any ): value is number;
4040

4141

4242
// EXPORTS //

lib/node_modules/@stdlib/assert/is-array-like-object/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
* var bool = isArrayLikeObject( 'beep' );
4141
* // returns false
4242
*/
43-
declare function isArrayLike( value: any ): boolean;
43+
declare function isArrayLikeObject( value: any ): value is ArrayLike<any>;
4444

4545

4646
// EXPORTS //
4747

48-
export = isArrayLike;
48+
export = isArrayLikeObject;

0 commit comments

Comments
 (0)