Skip to content

Commit e2c4238

Browse files
committed
feat: use type predicates for narrowing
1 parent f3f86f0 commit e2c4238

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* var bool = isUint16Array( [] );
3333
* // returns false
3434
*/
35-
declare function isUint16Array( value: any ): boolean;
35+
declare function isUint16Array( value: any ): value is Uint16Array;
3636

3737

3838
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* var bool = isUint32Array( [] );
3333
* // returns false
3434
*/
35-
declare function isUint32Array( value: any ): boolean;
35+
declare function isUint32Array( value: any ): value is Uint32Array;
3636

3737

3838
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* var bool = isUint8Array( [] );
3333
* // returns false
3434
*/
35-
declare function isUint8Array( value: any ): boolean;
35+
declare function isUint8Array( value: any ): value is Uint8Array;
3636

3737

3838
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* var bool = isUint8ClampedArray( [] );
3333
* // returns false
3434
*/
35-
declare function isUint8ClampedArray( value: any ): boolean;
35+
declare function isUint8ClampedArray( value: any ): value is Uint8ClampedArray;
3636

3737

3838
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* var bool = isUNCPath( '/foo/bar/baz' );
3333
* // returns false
3434
*/
35-
declare function isUNCPath( value: any ): boolean;
35+
declare function isUNCPath( value: any ): value is string;
3636

3737

3838
// EXPORTS //

lib/node_modules/@stdlib/assert/is-undefined-or-null/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* bool = isUndefinedOrNull( false );
3535
* // returns false
3636
*/
37-
declare function isUndefinedOrNull( value: any ): boolean;
37+
declare function isUndefinedOrNull( value: any ): value is null | undefined;
3838

3939

4040
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* bool = isUndefined( null );
3232
* // returns false
3333
*/
34-
declare function isUndefined( value: any ): boolean;
34+
declare function isUndefined( value: any ): value is undefined;
3535

3636

3737
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* var bool = isUnityProbabilityArray( [ 3.14, 0.0 ] );
4141
* // returns false
4242
*/
43-
declare function isUnityProbabilityArray( v: any ): boolean;
43+
declare function isUnityProbabilityArray( v: any ): v is ArrayLike<number>;
4444

4545

4646
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* var bool = isUppercase( 'salt and light' );
4141
* // returns false
4242
*/
43-
declare function isUppercase( value: any ): boolean;
43+
declare function isUppercase( value: any ): value is string;
4444

4545

4646
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* var bool = isURIError( {} );
3737
* // returns false
3838
*/
39-
declare function isURIError( value: any ): boolean;
39+
declare function isURIError( value: any ): value is URIError;
4040

4141

4242
// EXPORTS //

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
* var bool = isURI( 'http://example.w3.org/%at' );
120120
* // returns false
121121
*/
122-
declare function isURI( value: any ): boolean;
122+
declare function isURI( value: any ): value is string;
123123

124124

125125
// EXPORTS //

0 commit comments

Comments
 (0)