Skip to content

isString() function

如果 s 是字符串则返回 true。

Signature:

typescript
isString: <T>(input: T) => input is T & string

Example

ts
isString("a"); // true
isString(2); // false

Open Source Code

Released under the Apache-2.0 License.