is.js 554 B

1234567891011121314151617181920
  1. 'use strict';
  2. var iteratorSymbol = require('es6-symbol').iterator;
  3. module.exports = function (t, a) {
  4. var x;
  5. a(t([]), true, "Array");
  6. a(t(""), true, "String");
  7. a(t((function () { return arguments; }())), true, "Arguments");
  8. a(t({ length: 0 }), true, "List object");
  9. a(t(function () {}), false, "Function");
  10. a(t({}), false, "Plain object");
  11. a(t(/raz/), false, "Regexp");
  12. a(t(), false, "No argument");
  13. a(t(null), false, "Null");
  14. a(t(undefined), false, "Undefined");
  15. x = {};
  16. x[iteratorSymbol] = function () {};
  17. a(t(x), true, "Iterable");
  18. };