1 | ;
|
2 |
|
3 | /**
|
4 | * Checks whether a value is a function
|
5 | *
|
6 | * **Aliases** _str_
|
7 | *
|
8 | * @function string
|
9 | *
|
10 | * @example
|
11 | * var is = require('predicates');
|
12 | *
|
13 | * is.string('test'); // true
|
14 | * is.string({}); // false
|
15 | *
|
16 | * @param {*} value
|
17 | * @returns {Boolean}
|
18 | */
|
19 | module.exports = function isString(value) {
|
20 | return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]';
|
21 | };
|