'use strict';

var strValue = String.prototype.valueOf;

module.exports = function isString(value) {
	if (typeof value === 'string') { return true; }
	if (typeof value !== 'object') { return false; }
	try {
		strValue.call(value);
		return true;
	} catch (e) {
		return false;
	}
};

'use strict';

var strValue = String.prototype.valueOf;
var tryStringObject = function tryStringObject(value) {
	try {
		strValue.call(value);
		return true;
	} catch (e) {
		return false;
	}
};

module.exports = function isString(value) {
	if (typeof value === 'string') { return true; }
	if (typeof value !== 'object') { return false; }
	return tryStringObject(value);
};

Refactor to aid optimization of non-try/catch code.
Refactor to aid optimization of non-try/catch code.