Urara-Blog/node_modules/.pnpm-store/v3/files/a2/89701f015db211154967db4158257f114fa7392b31cff08dddd839e20d10e772c0b14d6a3f8e94023835e00a8e25917c097a28d74032941a31eb7637bc315e
2022-08-14 01:14:53 +08:00

24 lines
560 B
Text

'use strict';
var strValue = String.prototype.valueOf;
var tryStringObject = function tryStringObject(value) {
try {
strValue.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var strClass = '[object String]';
var hasToStringTag = require('has-tostringtag/shams')();
module.exports = function isString(value) {
if (typeof value === 'string') {
return true;
}
if (typeof value !== 'object') {
return false;
}
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;
};