main
Last change
on this file since d565449 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 | |
---|
1 | import baseGetTag from './_baseGetTag.js';
|
---|
2 | import isArray from './isArray.js';
|
---|
3 | import isObjectLike from './isObjectLike.js';
|
---|
4 |
|
---|
5 | /** `Object#toString` result references. */
|
---|
6 | var 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 | */
|
---|
25 | function isString(value) {
|
---|
26 | return typeof value == 'string' ||
|
---|
27 | (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
|
---|
28 | }
|
---|
29 |
|
---|
30 | export default isString;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.