mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v4.16.5.
This commit is contained in:
13
isString.js
13
isString.js
@@ -1,19 +1,10 @@
|
||||
import baseGetTag from './_baseGetTag.js';
|
||||
import isArray from './isArray.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var stringTag = '[object String]';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `String` primitive or object.
|
||||
*
|
||||
@@ -33,7 +24,7 @@ var objectToString = objectProto.toString;
|
||||
*/
|
||||
function isString(value) {
|
||||
return typeof value == 'string' ||
|
||||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
|
||||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
|
||||
}
|
||||
|
||||
export default isString;
|
||||
|
||||
Reference in New Issue
Block a user