is-array-like.js 528 B

1234567891011121314151617
  1. "use strict";
  2. var isFunction = require("../function/is-function")
  3. , isObject = require("./is-object")
  4. , isValue = require("./is-value");
  5. module.exports = function (value) {
  6. return (
  7. (isValue(value) &&
  8. typeof value.length === "number" &&
  9. // Just checking ((typeof x === 'object') && (typeof x !== 'function'))
  10. // won't work right for some cases, e.g.:
  11. // type of instance of NodeList in Safari is a 'function'
  12. ((isObject(value) && !isFunction(value)) || typeof value === "string")) ||
  13. false
  14. );
  15. };