mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Bump to v4.16.5.
This commit is contained in:
14
isString.js
14
isString.js
@@ -1,18 +1,8 @@
|
||||
define(['./isArray', './isObjectLike'], function(isArray, isObjectLike) {
|
||||
define(['./_baseGetTag', './isArray', './isObjectLike'], function(baseGetTag, isArray, isObjectLike) {
|
||||
|
||||
/** `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.
|
||||
*
|
||||
@@ -32,7 +22,7 @@ define(['./isArray', './isObjectLike'], function(isArray, isObjectLike) {
|
||||
*/
|
||||
function isString(value) {
|
||||
return typeof value == 'string' ||
|
||||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
|
||||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
|
||||
}
|
||||
|
||||
return isString;
|
||||
|
||||
Reference in New Issue
Block a user