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

Version Path
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/is-string/index.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/is-string/index.js
locomotivecms-3.4.0 app/javascript/node_modules/is-string/index.js
webpack_rails-2.0.1 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-2.0.0 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.3.1 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.3.0 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.2.2 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.2.1 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.2.0 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.1.1 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.1.0 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.0.1 lib/webpack_rails/node_modules/is-string/index.js
webpack_rails-1.0.0 lib/webpack_rails/node_modules/is-string/index.js