source: node_modules/es-toolkit/dist/predicate/isString.d.ts@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 612 bytes
Line 
1/**
2 * Checks if a given value is string.
3 *
4 * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `string`.
5 *
6 * @param {unknown} value The value to check if it is string.
7 * @returns {value is string} Returns `true` if `value` is a string, else `false`.
8 *
9 * @example
10 * const value1 = 'abc';
11 * const value2 = 123;
12 * const value3 = true;
13 *
14 * console.log(isString(value1)); // true
15 * console.log(isString(value2)); // false
16 * console.log(isString(value3)); // false
17 */
18declare function isString(value: unknown): value is string;
19
20export { isString };
Note: See TracBrowser for help on using the repository browser.