@fav/type.is-string
Version:
Checks whether a value is a string or not.
23 lines (18 loc) • 382 B
JavaScript
function isString(value) {
if (typeof value === 'string') {
return true;
}
if (Object.prototype.toString.call(value) === '[object String]') {
return true;
}
return false;
}
function isNotString(value) {
return !isString(value);
}
Object.defineProperty(isString, 'not', {
enumerable: true,
value: isNotString,
});
module.exports = isString;
;