is.js 577 B

12345678910111213141516171819202122232425262728
  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(
  8. t(
  9. (function () {
  10. return arguments;
  11. })()
  12. ),
  13. true,
  14. "Arguments"
  15. );
  16. a(t({ length: 0 }), true, "List object");
  17. a(t(function () {}), false, "Function");
  18. a(t({}), false, "Plain object");
  19. a(t(/raz/), false, "Regexp");
  20. a(t(), false, "No argument");
  21. a(t(null), false, "Null");
  22. a(t(undefined), false, "Undefined");
  23. x = {};
  24. x[iteratorSymbol] = function () {};
  25. a(t(x), true, "Iterable");
  26. };