1 var isArray = require('./isArray'),
2 isObjectLike = require('./isObjectLike');
4 /** `Object#toString` result references. */
5 var stringTag = '[object String]';
7 /** Used for built-in method references. */
8 var objectProto = Object.prototype;
11 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
14 var objectToString = objectProto.toString;
17 * Checks if `value` is classified as a `String` primitive or object.
22 * @param {*} value The value to check.
23 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
32 function isString(value) {
33 return typeof value == 'string' ||
34 (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
37 module.exports = isString;