Sha256: b9b41916f1d56e291182ed415d748f600ee752aa5e1718299b7c5ddb437dd8a2
Contents?: true
Size: 590 Bytes
Versions: 14
Compression:
Stored size: 590 Bytes
Contents
'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 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; 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; };
Version data entries
14 entries across 14 versions & 3 rubygems