to-array.js 365 B

123456789101112131415161718
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var o = { 1: 1, 2: 2, 3: 3 }
  4. , o1 = {}
  5. , o2 = t(
  6. o,
  7. function (value, name, self) {
  8. a(self, o, "Self");
  9. a(this, o1, "Scope");
  10. return value + Number(name);
  11. },
  12. o1
  13. );
  14. a.deep(o2, [2, 4, 6]);
  15. t(o).sort().forEach(function (item) { a.deep(item, [item[0], o[item[0]]], "Default"); });
  16. };