From 30112b7202358710becc8ea77f4261dd3e7459f3 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 27 Feb 2024 20:12:29 -0500 Subject: [PATCH] fix: replace use of type guards with boolean return type The type narrowing behavior of type guards makes only sense when the runtime checks match the type guards. For example `value is string` should be used with `typeof value === 'string'` and not with a function that checks for whether a value is a snakecase string. In the latter case, the type guard would incorrectly narrow the type of the value to `never` for a string that is not snakecase. --- .../assert/is-absolute-http-uri/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-absolute-path/docs/types/index.d.ts | 6 +++--- .../@stdlib/assert/is-absolute-uri/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-alphagram/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-alphanumeric/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-ascii/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-binary-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-blank-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-camelcase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-capitalized/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-constantcase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-digit-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-domain-name/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-duration-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-email-address/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-empty-string/docs/types/index.d.ts | 6 +++--- .../@stdlib/assert/is-hex-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-json/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-kebabcase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-localhost/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-lowercase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-pascalcase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-regexp-string/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-relative-path/docs/types/index.d.ts | 6 +++--- .../@stdlib/assert/is-relative-uri/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-semver/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-snakecase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-startcase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-unc-path/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-uppercase/docs/types/index.d.ts | 2 +- .../@stdlib/assert/is-uri/docs/types/index.d.ts | 2 +- .../assert/is-well-formed-string/docs/types/index.d.ts | 6 +++--- .../@stdlib/assert/is-whitespace/docs/types/index.d.ts | 2 +- 33 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-absolute-http-uri/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-absolute-http-uri/docs/types/index.d.ts index 91d834de415c..c03a699b8bcb 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-http-uri/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-absolute-http-uri/docs/types/index.d.ts @@ -48,7 +48,7 @@ * var bool = isAbsoluteHttpURI( null ); * // returns false */ -declare function isAbsoluteHttpURI( value: any ): value is string; +declare function isAbsoluteHttpURI( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-absolute-path/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-absolute-path/docs/types/index.d.ts index d56f1f609ebe..4e9d45a7c59e 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-path/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-absolute-path/docs/types/index.d.ts @@ -39,7 +39,7 @@ interface IsAbsolutePath { * // returns true * } */ - ( value: any ): value is string; + ( value: any ): boolean; /** * Tests if a value is a POSIX absolute path. @@ -55,7 +55,7 @@ interface IsAbsolutePath { * var bool = isAbsolutePath.posix( 'foo/bar/baz' ); * // returns false */ - posix( value: any ): value is string; + posix( value: any ): boolean; /** * Tests if a value is a Windows absolute path. @@ -71,7 +71,7 @@ interface IsAbsolutePath { * var bool = isAbsolutePath.win32( 'foo\\bar\\baz' ); * // returns false */ - win32( value: any ): value is string; + win32( value: any ): boolean; } /** diff --git a/lib/node_modules/@stdlib/assert/is-absolute-uri/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-absolute-uri/docs/types/index.d.ts index ed140dc93ac8..99e504633ed2 100644 --- a/lib/node_modules/@stdlib/assert/is-absolute-uri/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-absolute-uri/docs/types/index.d.ts @@ -44,7 +44,7 @@ * var bool = isAbsoluteURI( null ); * // returns false */ -declare function isAbsoluteURI( value: any ): value is string; +declare function isAbsoluteURI( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-alphagram/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-alphagram/docs/types/index.d.ts index 9b180ec79a4a..90a829085caf 100644 --- a/lib/node_modules/@stdlib/assert/is-alphagram/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-alphagram/docs/types/index.d.ts @@ -48,7 +48,7 @@ * var out = isAlphagram( 123 ); * // returns false */ -declare function isAlphagram( value: any ): value is string; +declare function isAlphagram( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-alphanumeric/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-alphanumeric/docs/types/index.d.ts index 3cd6a5c7cb85..01d8092cbe0c 100644 --- a/lib/node_modules/@stdlib/assert/is-alphanumeric/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-alphanumeric/docs/types/index.d.ts @@ -44,7 +44,7 @@ * var out = isAlphaNumeric( 123 ); * // returns false */ -declare function isAlphaNumeric( value: any ): value is string; +declare function isAlphaNumeric( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-ascii/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-ascii/docs/types/index.d.ts index 11e690232bf8..cadf413e6635 100644 --- a/lib/node_modules/@stdlib/assert/is-ascii/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-ascii/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var out = isASCII( 123 ); * // returns false */ -declare function isASCII( value: any ): value is string; +declare function isASCII( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-binary-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-binary-string/docs/types/index.d.ts index 36ad59064c39..34e626a86198 100644 --- a/lib/node_modules/@stdlib/assert/is-binary-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-binary-string/docs/types/index.d.ts @@ -36,7 +36,7 @@ * var bool = isBinaryString( '' ); * // returns false */ -declare function isBinaryString( value: any ): value is string; +declare function isBinaryString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-blank-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-blank-string/docs/types/index.d.ts index 2c1afd53265d..51a07a2d1ada 100644 --- a/lib/node_modules/@stdlib/assert/is-blank-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-blank-string/docs/types/index.d.ts @@ -44,7 +44,7 @@ * var bool = isBlankString( 'beep' ); * // returns false */ -declare function isBlankString( value: any ): value is string; +declare function isBlankString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-camelcase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-camelcase/docs/types/index.d.ts index 6db7541fa32f..17f241b39843 100644 --- a/lib/node_modules/@stdlib/assert/is-camelcase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-camelcase/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isCamelcase( 'hello world' ); * // returns false */ -declare function isCamelcase( value: any ): value is string; +declare function isCamelcase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-capitalized/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-capitalized/docs/types/index.d.ts index 999453716d0e..9175a2690123 100644 --- a/lib/node_modules/@stdlib/assert/is-capitalized/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-capitalized/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isCapitalized( 'salt and light' ); * // returns false */ -declare function isCapitalized( value: any ): value is string; +declare function isCapitalized( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-constantcase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-constantcase/docs/types/index.d.ts index dab26b4f28e4..de574c92d4c7 100644 --- a/lib/node_modules/@stdlib/assert/is-constantcase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-constantcase/docs/types/index.d.ts @@ -46,7 +46,7 @@ * bool = isConstantcase( null ); * // returns false */ -declare function isConstantcase( value: any ): value is string; +declare function isConstantcase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-digit-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-digit-string/docs/types/index.d.ts index 42c933b30c60..dc3fed76f62f 100644 --- a/lib/node_modules/@stdlib/assert/is-digit-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-digit-string/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var out = isDigitString( 123 ); * // returns false */ -declare function isDigitString( value: any ): value is string; +declare function isDigitString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-domain-name/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-domain-name/docs/types/index.d.ts index 13d1a98ac1a9..e1968412a117 100644 --- a/lib/node_modules/@stdlib/assert/is-domain-name/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-domain-name/docs/types/index.d.ts @@ -32,7 +32,7 @@ * var bool = isDomainName( 'foo@bar.com' ); * // returns false */ -declare function isDomainName( value: any ): value is string; +declare function isDomainName( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-duration-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-duration-string/docs/types/index.d.ts index 8f07fc72031e..0ac9bd4149b1 100644 --- a/lib/node_modules/@stdlib/assert/is-duration-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-duration-string/docs/types/index.d.ts @@ -48,7 +48,7 @@ * var bool = isDurationString( '1d2h' ); * // returns true */ -declare function isDurationString( value: any ): value is string; +declare function isDurationString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-email-address/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-email-address/docs/types/index.d.ts index 2a2a703cc304..7d8db97715e7 100644 --- a/lib/node_modules/@stdlib/assert/is-email-address/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-email-address/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isEmail( null ); * // returns false */ -declare function isEmail( value: any ): value is string; +declare function isEmail( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-empty-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-empty-string/docs/types/index.d.ts index cb724030ec91..2c08e5712729 100644 --- a/lib/node_modules/@stdlib/assert/is-empty-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-empty-string/docs/types/index.d.ts @@ -40,7 +40,7 @@ interface IsEmptyString { * var bool = isEmptyString( [] ); * // returns false */ - ( value: any ): value is string | String; + ( value: any ): boolean; /** * Tests if a value is an empty string primitive. @@ -60,7 +60,7 @@ interface IsEmptyString { * var bool = isEmptyString.isPrimitive( [] ); * // returns false */ - isPrimitive( value: any ): value is string; + isPrimitive( value: any ): boolean; /** * Tests if a value is an empty string object. @@ -80,7 +80,7 @@ interface IsEmptyString { * var bool = isEmptyString.isObject( [] ); * // returns false */ - isObject( value: any ): value is String; + isObject( value: any ): boolean; } /** diff --git a/lib/node_modules/@stdlib/assert/is-hex-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-hex-string/docs/types/index.d.ts index 1172e73d3f51..693ef6e8cf1c 100644 --- a/lib/node_modules/@stdlib/assert/is-hex-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-hex-string/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var out = isHexString( 123 ); * // returns false */ -declare function isHexString( value: any ): value is string; +declare function isHexString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-json/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-json/docs/types/index.d.ts index e960cc470b91..9623b31a5ce9 100644 --- a/lib/node_modules/@stdlib/assert/is-json/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-json/docs/types/index.d.ts @@ -32,7 +32,7 @@ * var v = isJSON( '{a":5}' ); * // returns false */ -declare function isJSON( value: any ): value is string; +declare function isJSON( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-kebabcase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-kebabcase/docs/types/index.d.ts index b244b7df3154..92ebd30858df 100644 --- a/lib/node_modules/@stdlib/assert/is-kebabcase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-kebabcase/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isKebabcase( 1 ); * // returns false */ -declare function isKebabcase( value: any ): value is string; +declare function isKebabcase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-localhost/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-localhost/docs/types/index.d.ts index 15dbb9016036..ca04c780a778 100644 --- a/lib/node_modules/@stdlib/assert/is-localhost/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-localhost/docs/types/index.d.ts @@ -50,7 +50,7 @@ * var bool = isLocalhost( null ); * // returns false */ -declare function isLocalhost( value: any ): value is string; +declare function isLocalhost( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-lowercase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-lowercase/docs/types/index.d.ts index b6f29ca51526..afc801d2526f 100644 --- a/lib/node_modules/@stdlib/assert/is-lowercase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-lowercase/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isLowercase( '!' ); * // returns false */ -declare function isLowercase( value: any ): value is string; +declare function isLowercase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-pascalcase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-pascalcase/docs/types/index.d.ts index 0b36e41966c7..5cf98c368bd1 100644 --- a/lib/node_modules/@stdlib/assert/is-pascalcase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-pascalcase/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isPascalcase( null ); * // returns false */ -declare function isPascalcase( value: any ): value is string; +declare function isPascalcase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-regexp-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-regexp-string/docs/types/index.d.ts index 04bca465f698..783edbec7c6a 100644 --- a/lib/node_modules/@stdlib/assert/is-regexp-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-regexp-string/docs/types/index.d.ts @@ -44,7 +44,7 @@ * var bool = isRegExpString( null ); * // returns false */ -declare function isRegExpString( value: any ): value is string; +declare function isRegExpString( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-relative-path/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-relative-path/docs/types/index.d.ts index defb5962cee8..7d20dbbeec90 100644 --- a/lib/node_modules/@stdlib/assert/is-relative-path/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-relative-path/docs/types/index.d.ts @@ -45,7 +45,7 @@ interface IsRelativePath { * // returns false * } */ - ( value: any ): value is string; + ( value: any ): boolean; /** * Tests if a value is a POSIX relative path. @@ -61,7 +61,7 @@ interface IsRelativePath { * var bool = isRelativePath.posix( '/foo/../bar/baz' ); * // returns false */ - posix( value: any ): value is string; + posix( value: any ): boolean; /** * Tests if a value is a Windows relative path. @@ -77,7 +77,7 @@ interface IsRelativePath { * var bool = isRelativePath.win32( 'C:\\foo\\..\\bar\\baz' ); * // returns false */ - win32( value: any ): value is string; + win32( value: any ): boolean; } /** diff --git a/lib/node_modules/@stdlib/assert/is-relative-uri/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-relative-uri/docs/types/index.d.ts index bec5db2e3638..d6404c9534c2 100644 --- a/lib/node_modules/@stdlib/assert/is-relative-uri/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-relative-uri/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isRelativeURI( null ); * // returns false */ -declare function isRelativeURI( value: any ): value is string; +declare function isRelativeURI( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-semver/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-semver/docs/types/index.d.ts index c1f2e9bff6b0..ddde4c019711 100644 --- a/lib/node_modules/@stdlib/assert/is-semver/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-semver/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isSemVer( null ); * // returns false */ -declare function isSemVer( value: any ): value is string; +declare function isSemVer( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-snakecase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-snakecase/docs/types/index.d.ts index e2f81856047a..8a339f945426 100644 --- a/lib/node_modules/@stdlib/assert/is-snakecase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-snakecase/docs/types/index.d.ts @@ -44,7 +44,7 @@ * var bool = isSnakecase( null ); * // returns false */ -declare function isSnakecase( value: any ): value is string; +declare function isSnakecase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-startcase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-startcase/docs/types/index.d.ts index 7e5774b023bd..1458782c163e 100644 --- a/lib/node_modules/@stdlib/assert/is-startcase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-startcase/docs/types/index.d.ts @@ -34,7 +34,7 @@ * bool = isStartcase( 'Beep and Boop' ); * // returns false */ -declare function isStartcase( value: any ): value is string; +declare function isStartcase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-unc-path/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-unc-path/docs/types/index.d.ts index 43f25ce539dc..f47414e781f7 100644 --- a/lib/node_modules/@stdlib/assert/is-unc-path/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-unc-path/docs/types/index.d.ts @@ -32,7 +32,7 @@ * var bool = isUNCPath( '/foo/bar/baz' ); * // returns false */ -declare function isUNCPath( value: any ): value is string; +declare function isUNCPath( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-uppercase/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-uppercase/docs/types/index.d.ts index 2fc3a54fb7c6..aee6bc79ec7a 100644 --- a/lib/node_modules/@stdlib/assert/is-uppercase/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-uppercase/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var bool = isUppercase( 'salt and light' ); * // returns false */ -declare function isUppercase( value: any ): value is string; +declare function isUppercase( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-uri/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-uri/docs/types/index.d.ts index de263e43aae3..12366ab19f09 100644 --- a/lib/node_modules/@stdlib/assert/is-uri/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-uri/docs/types/index.d.ts @@ -119,7 +119,7 @@ * var bool = isURI( 'http://example.w3.org/%at' ); * // returns false */ -declare function isURI( value: any ): value is string; +declare function isURI( value: any ): boolean; // EXPORTS // diff --git a/lib/node_modules/@stdlib/assert/is-well-formed-string/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-well-formed-string/docs/types/index.d.ts index 734f8ae06eef..3d0a7a9b5091 100644 --- a/lib/node_modules/@stdlib/assert/is-well-formed-string/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-well-formed-string/docs/types/index.d.ts @@ -56,7 +56,7 @@ interface isWellFormedString { * var bool = isWellFormedString( null ); * // returns false */ - ( str: any ): str is string | String; + ( str: any ): boolean; /** * Tests if a string is a well-formed string primitive. @@ -72,7 +72,7 @@ interface isWellFormedString { * var bool = isWellFormedString.isPrimitive( new String( '' ) ); * // returns false */ - isPrimitive( str: any ): str is string; + isPrimitive( str: any ): boolean; /** * Tests if a string is a well-formed string object. @@ -88,7 +88,7 @@ interface isWellFormedString { * var bool = isWellFormedString.isObject( new String( '' ) ); * // returns true */ - isObject( str: any ): str is Object; + isObject( str: any ): boolean; } /** diff --git a/lib/node_modules/@stdlib/assert/is-whitespace/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-whitespace/docs/types/index.d.ts index 2adafd49194c..3b7dee35d1a7 100644 --- a/lib/node_modules/@stdlib/assert/is-whitespace/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/is-whitespace/docs/types/index.d.ts @@ -40,7 +40,7 @@ * var out = isWhitespace( 123 ); * // returns false */ -declare function isWhitespace( x: any ): x is string; +declare function isWhitespace( x: any ): boolean; // EXPORTS //