'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; };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.github | Folder | 0755 |
|
|
test | Folder | 0755 |
|
|
.eslintignore | File | 10 B | 0644 |
|
.eslintrc | File | 217 B | 0644 |
|
.nycrc | File | 159 B | 0644 |
|
CHANGELOG.md | File | 10.69 KB | 0644 |
|
LICENSE | File | 1.06 KB | 0644 |
|
README.md | File | 2.02 KB | 0644 |
|
index.js | File | 560 B | 0644 |
|
package.json | File | 2.05 KB | 0644 |
|