Update to v13 and add queue and completely change code

This commit is contained in:
a 2021-12-06 16:34:00 +01:00
parent dcef23d0ed
commit 55a38726a3
6706 changed files with 424137 additions and 61608 deletions

29
node_modules/memoizee/normalizers/get-1.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
"use strict";
var indexOf = require("es5-ext/array/#/e-index-of");
module.exports = function () {
var lastId = 0, argsMap = [], cache = [];
return {
get: function (args) {
var index = indexOf.call(argsMap, args[0]);
return index === -1 ? null : cache[index];
},
set: function (args) {
argsMap.push(args[0]);
cache.push(++lastId);
return lastId;
},
delete: function (id) {
var index = indexOf.call(cache, id);
if (index !== -1) {
argsMap.splice(index, 1);
cache.splice(index, 1);
}
},
clear: function () {
argsMap = [];
cache = [];
}
};
};

71
node_modules/memoizee/normalizers/get-fixed.js generated vendored Normal file
View file

@ -0,0 +1,71 @@
"use strict";
var indexOf = require("es5-ext/array/#/e-index-of")
, create = Object.create;
module.exports = function (length) {
var lastId = 0, map = [[], []], cache = create(null);
return {
get: function (args) {
var index = 0, set = map, i;
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) return null;
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) return null;
return set[1][i] || null;
},
set: function (args) {
var index = 0, set = map, i;
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) {
i = set[0].push(args[index]) - 1;
set[1].push([[], []]);
}
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) {
i = set[0].push(args[index]) - 1;
}
set[1][i] = ++lastId;
cache[lastId] = args;
return lastId;
},
delete: function (id) {
var index = 0, set = map, i, path = [], args = cache[id];
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) {
return;
}
path.push(set, i);
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) {
return;
}
id = set[1][i];
set[0].splice(i, 1);
set[1].splice(i, 1);
while (!set[0].length && path.length) {
i = path.pop();
set = path.pop();
set[0].splice(i, 1);
set[1].splice(i, 1);
}
delete cache[id];
},
clear: function () {
map = [[], []];
cache = create(null);
}
};
};

View file

@ -0,0 +1,16 @@
"use strict";
module.exports = function (length) {
if (!length) {
return function () {
return "";
};
}
return function (args) {
var id = String(args[0]), i = 0, currentLength = length;
while (--currentLength) {
id += "\u0001" + args[++i];
}
return id;
};
};

90
node_modules/memoizee/normalizers/get.js generated vendored Normal file
View file

@ -0,0 +1,90 @@
/* eslint max-statements: 0 */
"use strict";
var indexOf = require("es5-ext/array/#/e-index-of");
var create = Object.create;
module.exports = function () {
var lastId = 0, map = [], cache = create(null);
return {
get: function (args) {
var index = 0, set = map, i, length = args.length;
if (length === 0) return set[length] || null;
if ((set = set[length])) {
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) return null;
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) return null;
return set[1][i] || null;
}
return null;
},
set: function (args) {
var index = 0, set = map, i, length = args.length;
if (length === 0) {
set[length] = ++lastId;
} else {
if (!set[length]) {
set[length] = [[], []];
}
set = set[length];
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) {
i = set[0].push(args[index]) - 1;
set[1].push([[], []]);
}
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) {
i = set[0].push(args[index]) - 1;
}
set[1][i] = ++lastId;
}
cache[lastId] = args;
return lastId;
},
delete: function (id) {
var index = 0, set = map, i, args = cache[id], length = args.length, path = [];
if (length === 0) {
delete set[length];
} else if ((set = set[length])) {
while (index < length - 1) {
i = indexOf.call(set[0], args[index]);
if (i === -1) {
return;
}
path.push(set, i);
set = set[1][i];
++index;
}
i = indexOf.call(set[0], args[index]);
if (i === -1) {
return;
}
id = set[1][i];
set[0].splice(i, 1);
set[1].splice(i, 1);
while (!set[0].length && path.length) {
i = path.pop();
set = path.pop();
set[0].splice(i, 1);
set[1].splice(i, 1);
}
}
delete cache[id];
},
clear: function () {
map = [];
cache = create(null);
}
};
};

9
node_modules/memoizee/normalizers/primitive.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
"use strict";
module.exports = function (args) {
var id, i, length = args.length;
if (!length) return "\u0002";
id = String(args[i = 0]);
while (--length) id += "\u0001" + args[++i];
return id;
};