1
0

is-plain-array.js 547 B

123456789101112131415161718
  1. 'use strict';
  2. var SubArray = require('../../array/_sub-array-dummy-safe');
  3. module.exports = function (t, a) {
  4. var arr = [1, 2, 3];
  5. a(t(arr), true, "Array");
  6. a(t(null), false, "Null");
  7. a(t(), false, "Undefined");
  8. a(t('234'), false, "String");
  9. a(t(23), false, "Number");
  10. a(t({}), false, "Plain object");
  11. a(t({ length: 1, 0: 'raz' }), false, "Array-like");
  12. a(t(Object.create(arr)), false, "Array extension");
  13. if (!SubArray) return;
  14. a(t(new SubArray(23)), false, "Subclass instance");
  15. a(t(Array.prototype), false, "Array.prototype");
  16. };