You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
543 B
21 lines
543 B
"use strict"; |
|
|
|
var coerceToArrayLength = require("../array-length/coerce") |
|
, isObject = require("../object/is"); |
|
|
|
module.exports = function (value/*, options*/) { |
|
if (!isObject(value)) { |
|
var options = arguments[1]; |
|
if (isObject(options) && options.allowString && typeof value === "string") return true; |
|
return false; |
|
} |
|
|
|
if (typeof value === "function") return false; |
|
|
|
var length; |
|
try { length = value.length; } |
|
catch (error) { return false; } |
|
|
|
if (coerceToArrayLength(length) === null) return false; |
|
return true; |
|
};
|
|
|