Skip to content

Commit a2b87b9

Browse files
committed
feat(token): improve type inference
1 parent c11449f commit a2b87b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const reToken = /^[\w!#$%&'*+.^`|~-]+$/;
7979
* assertFalse(isToken(""));
8080
* ```
8181
*/
82-
export function isToken(input: string): boolean {
82+
export function isToken(input: string): input is `${Tchar}${string}` {
8383
return reToken.test(input);
8484
}
8585

0 commit comments

Comments
 (0)