UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

24 lines 614 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isStringTypeOf = void 0; /** * @description - Typescript validator to assert if a value is `string` type. * * @example * * let foo: number | string = 0 * * if(Math.random() < 0.5){ * foo = 'bar' * } * * if(isStringTypeOf(foo)) { * // We asserted the value is actually an string! * console.log("foo length is: " + foo.length) // foo length is 3 * } */ const isStringTypeOf = (value) => { return typeof value === 'string'; }; exports.isStringTypeOf = isStringTypeOf; //# sourceMappingURL=isStringTypeOf.js.map