source: imaps-frontend/node_modules/lodash-es/isString.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 721 bytes
Line 
1import baseGetTag from './_baseGetTag.js';
2import isArray from './isArray.js';
3import isObjectLike from './isObjectLike.js';
4
5/** `Object#toString` result references. */
6var stringTag = '[object String]';
7
8/**
9 * Checks if `value` is classified as a `String` primitive or object.
10 *
11 * @static
12 * @since 0.1.0
13 * @memberOf _
14 * @category Lang
15 * @param {*} value The value to check.
16 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
17 * @example
18 *
19 * _.isString('abc');
20 * // => true
21 *
22 * _.isString(1);
23 * // => false
24 */
25function isString(value) {
26 return typeof value == 'string' ||
27 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
28}
29
30export default isString;
Note: See TracBrowser for help on using the repository browser.