UNPKG

388 BJavaScriptView Raw
1/**
2 * @name isString
3 * @summary Tests for a string.
4 * @description
5 * Checks to see if the input value is a JavaScript string.
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { isString } from '@polkadot/util';
11 *
12 * console.log('isString', isString('test')); // => true
13 * ```
14 */
15export function isString(value) {
16 return typeof value === 'string' || value instanceof String;
17}