@nuxt/devtools 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/chunks/module-main.mjs +683 -666
- package/dist/chunks/vscode.mjs +34 -30
- package/dist/cli.mjs +21 -60
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/__inspecting/index.html +2 -2
- package/dist/client/_nuxt/{Badge.ec9e349b.js → Badge.d9b6d9b1.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.29183a21.js → FilepathItem.vue.31689a0a.js} +1 -1
- package/dist/client/_nuxt/{LaunchPage.vue.f4239533.js → LaunchPage.vue.65011890.js} +1 -1
- package/dist/client/_nuxt/{NButton.vue.09cc4471.js → NButton.vue.56759fc1.js} +1 -1
- package/dist/client/_nuxt/{NIcon.vue.701f4547.js → NIcon.vue.c1ad97a9.js} +1 -1
- package/dist/client/_nuxt/NTextInput.vue.b6c079ee.js +1 -0
- package/dist/client/_nuxt/{NuxtLogo.9f2db884.js → NuxtLogo.9303af79.js} +1 -1
- package/dist/client/_nuxt/SectionBlock.48da9d80.css +1 -0
- package/dist/client/_nuxt/SectionBlock.885bbad5.js +1 -0
- package/dist/client/_nuxt/{Settings.vue.b55fa306.js → Settings.vue.dda6fcf5.js} +1 -1
- package/dist/client/_nuxt/{StateEditor.989cce56.css → StateEditor.c82309e2.css} +1 -1
- package/dist/client/_nuxt/{StateEditor.vue.ab9d7157.js → StateEditor.vue.0f1b994b.js} +1 -1
- package/dist/client/_nuxt/StateEditor.vue.3374c6ec.js +1 -0
- package/dist/client/_nuxt/{TabIcon.vue.6890c56a.js → TabIcon.vue.8d3722ca.js} +1 -1
- package/dist/client/_nuxt/{__inspecting.12d34e8c.js → __inspecting.6fe111b0.js} +1 -1
- package/dist/client/_nuxt/{asyncData.c8345f31.js → asyncData.d544d421.js} +1 -1
- package/dist/client/_nuxt/{components.08e98322.js → components.25d13f1f.js} +1 -1
- package/dist/client/_nuxt/composables.80d3af7a.js +1 -0
- package/dist/client/_nuxt/{context.d25709fd.js → context.b32078d3.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_.89baf527.js → custom-_name_.14809d72.js} +1 -1
- package/dist/client/_nuxt/default.7ecded8d.js +1 -0
- package/dist/client/_nuxt/editor.b2159474.js +1 -0
- package/dist/client/_nuxt/entry.43bdd1fb.css +1 -0
- package/dist/client/_nuxt/{entry.d28dd037.js → entry.b1094864.js} +1 -1
- package/dist/client/_nuxt/{error-404.bdee7391.js → error-404.2ee33711.js} +1 -1
- package/dist/client/_nuxt/{error-500.c5180cef.js → error-500.ef980084.js} +1 -1
- package/dist/client/_nuxt/{error-component.ae83d235.js → error-component.7b202115.js} +2 -2
- package/dist/client/_nuxt/{hooks.8f89faa2.js → hooks.ca7ea52c.js} +1 -1
- package/dist/client/_nuxt/imports.f7013fa4.js +1 -0
- package/dist/client/_nuxt/{index.fe0907d3.js → index.2ad8ed93.js} +1 -1
- package/dist/client/_nuxt/layouts.b684dcc1.js +1 -0
- package/dist/client/_nuxt/{middleware.5410fce5.js → middleware.e10aa06d.js} +1 -1
- package/dist/client/_nuxt/{modules.6fc7bd71.js → modules.0b22b757.js} +1 -1
- package/dist/client/_nuxt/{none.76eeebc3.js → none.38bfd553.js} +1 -1
- package/dist/client/_nuxt/{nuxt-link.3aeeed3f.js → nuxt-link.752dfef9.js} +1 -1
- package/dist/client/_nuxt/{overview.e7e9880f.js → overview.d488d202.js} +1 -1
- package/dist/client/_nuxt/{pages.40900507.js → pages.22ce604b.js} +1 -1
- package/dist/client/_nuxt/payload.5372dcff.js +1 -0
- package/dist/client/_nuxt/{plugins.8195b406.js → plugins.f9b29762.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.7cc77728.js → runtime-configs.99425f61.js} +1 -1
- package/dist/client/_nuxt/{server-routes.ffdf17b0.js → server-routes.763958ec.js} +1 -1
- package/dist/client/_nuxt/{state.a5c5a841.js → state.65ceafcf.js} +1 -1
- package/dist/client/_nuxt/{unocss-runtime.1fec3315.js → unocss-runtime.c4939419.js} +1 -1
- package/dist/client/_nuxt/{virtual-files.a26c8c69.js → virtual-files.13f3141f.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/modules/components/index.html +2 -2
- package/dist/client/modules/hooks/index.html +2 -2
- package/dist/client/modules/imports/index.html +2 -2
- package/dist/client/modules/layouts/index.html +2 -2
- package/dist/client/modules/middleware/index.html +2 -2
- package/dist/client/modules/modules/index.html +2 -2
- package/dist/client/modules/overview/index.html +2 -2
- package/dist/client/modules/pages/index.html +2 -2
- package/dist/client/modules/payload/index.html +2 -2
- package/dist/client/modules/plugins/index.html +2 -2
- package/dist/client/modules/runtime-configs/index.html +2 -2
- package/dist/client/modules/server-routes/index.html +2 -2
- package/dist/client/modules/virtual-files/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/shared/{devtools.28239661.mjs → devtools.e6742cbd.mjs} +1 -1
- package/package.json +4 -3
- package/dist/client/_nuxt/NTextInput.vue.276e32b3.js +0 -1
- package/dist/client/_nuxt/SectionBlock.082cb101.css +0 -1
- package/dist/client/_nuxt/SectionBlock.8ff5d737.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.d668b11c.js +0 -1
- package/dist/client/_nuxt/composables.8c342cc5.js +0 -1
- package/dist/client/_nuxt/default.975e4e70.js +0 -1
- package/dist/client/_nuxt/editor.f74d7351.js +0 -1
- package/dist/client/_nuxt/entry.e7b3d8fd.css +0 -1
- package/dist/client/_nuxt/imports.f7970750.js +0 -1
- package/dist/client/_nuxt/layouts.d5a3dabe.js +0 -1
- package/dist/client/_nuxt/payload.36dbfdde.js +0 -1
|
@@ -15,7 +15,7 @@ import require$$0$4 from 'url';
|
|
|
15
15
|
import * as qs from 'querystring';
|
|
16
16
|
import require$$0$5 from 'tty';
|
|
17
17
|
import isInstalledGlobally from 'is-installed-globally';
|
|
18
|
-
import { v as version } from '../shared/devtools.
|
|
18
|
+
import { v as version } from '../shared/devtools.e6742cbd.mjs';
|
|
19
19
|
import { createBirpcGroup } from 'birpc';
|
|
20
20
|
import { resolvePreset } from 'unimport';
|
|
21
21
|
import { join as join$1, dirname, resolve as resolve$1 } from 'pathe';
|
|
@@ -2289,7 +2289,7 @@ const { tokenChars: tokenChars$1 } = validationExports;
|
|
|
2289
2289
|
* parameter value
|
|
2290
2290
|
* @private
|
|
2291
2291
|
*/
|
|
2292
|
-
function push
|
|
2292
|
+
function push(dest, name, elem) {
|
|
2293
2293
|
if (dest[name] === undefined) dest[name] = [elem];
|
|
2294
2294
|
else dest[name].push(elem);
|
|
2295
2295
|
}
|
|
@@ -2333,7 +2333,7 @@ function parse$b(header) {
|
|
|
2333
2333
|
if (end === -1) end = i;
|
|
2334
2334
|
const name = header.slice(start, end);
|
|
2335
2335
|
if (code === 0x2c) {
|
|
2336
|
-
push
|
|
2336
|
+
push(offers, name, params);
|
|
2337
2337
|
params = Object.create(null);
|
|
2338
2338
|
} else {
|
|
2339
2339
|
extensionName = name;
|
|
@@ -2354,9 +2354,9 @@ function parse$b(header) {
|
|
|
2354
2354
|
}
|
|
2355
2355
|
|
|
2356
2356
|
if (end === -1) end = i;
|
|
2357
|
-
push
|
|
2357
|
+
push(params, header.slice(start, end), true);
|
|
2358
2358
|
if (code === 0x2c) {
|
|
2359
|
-
push
|
|
2359
|
+
push(offers, extensionName, params);
|
|
2360
2360
|
params = Object.create(null);
|
|
2361
2361
|
extensionName = undefined;
|
|
2362
2362
|
}
|
|
@@ -2409,9 +2409,9 @@ function parse$b(header) {
|
|
|
2409
2409
|
value = value.replace(/\\/g, '');
|
|
2410
2410
|
mustUnescape = false;
|
|
2411
2411
|
}
|
|
2412
|
-
push
|
|
2412
|
+
push(params, paramName, value);
|
|
2413
2413
|
if (code === 0x2c) {
|
|
2414
|
-
push
|
|
2414
|
+
push(offers, extensionName, params);
|
|
2415
2415
|
params = Object.create(null);
|
|
2416
2416
|
extensionName = undefined;
|
|
2417
2417
|
}
|
|
@@ -2431,16 +2431,16 @@ function parse$b(header) {
|
|
|
2431
2431
|
if (end === -1) end = i;
|
|
2432
2432
|
const token = header.slice(start, end);
|
|
2433
2433
|
if (extensionName === undefined) {
|
|
2434
|
-
push
|
|
2434
|
+
push(offers, token, params);
|
|
2435
2435
|
} else {
|
|
2436
2436
|
if (paramName === undefined) {
|
|
2437
|
-
push
|
|
2437
|
+
push(params, token, true);
|
|
2438
2438
|
} else if (mustUnescape) {
|
|
2439
|
-
push
|
|
2439
|
+
push(params, paramName, token.replace(/\\/g, ''));
|
|
2440
2440
|
} else {
|
|
2441
|
-
push
|
|
2441
|
+
push(params, paramName, token);
|
|
2442
2442
|
}
|
|
2443
|
-
push
|
|
2443
|
+
push(offers, extensionName, params);
|
|
2444
2444
|
}
|
|
2445
2445
|
|
|
2446
2446
|
return offers;
|
|
@@ -6085,765 +6085,782 @@ function requireIterator () {
|
|
|
6085
6085
|
return iterator;
|
|
6086
6086
|
}
|
|
6087
6087
|
|
|
6088
|
-
var yallist
|
|
6088
|
+
var yallist;
|
|
6089
|
+
var hasRequiredYallist;
|
|
6089
6090
|
|
|
6090
|
-
|
|
6091
|
-
|
|
6091
|
+
function requireYallist () {
|
|
6092
|
+
if (hasRequiredYallist) return yallist;
|
|
6093
|
+
hasRequiredYallist = 1;
|
|
6094
|
+
yallist = Yallist;
|
|
6092
6095
|
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
if (!(self instanceof Yallist$1)) {
|
|
6096
|
-
self = new Yallist$1();
|
|
6097
|
-
}
|
|
6096
|
+
Yallist.Node = Node;
|
|
6097
|
+
Yallist.create = Yallist;
|
|
6098
6098
|
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6099
|
+
function Yallist (list) {
|
|
6100
|
+
var self = this;
|
|
6101
|
+
if (!(self instanceof Yallist)) {
|
|
6102
|
+
self = new Yallist();
|
|
6103
|
+
}
|
|
6102
6104
|
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
});
|
|
6107
|
-
} else if (arguments.length > 0) {
|
|
6108
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
6109
|
-
self.push(arguments[i]);
|
|
6110
|
-
}
|
|
6111
|
-
}
|
|
6105
|
+
self.tail = null;
|
|
6106
|
+
self.head = null;
|
|
6107
|
+
self.length = 0;
|
|
6112
6108
|
|
|
6113
|
-
|
|
6114
|
-
|
|
6109
|
+
if (list && typeof list.forEach === 'function') {
|
|
6110
|
+
list.forEach(function (item) {
|
|
6111
|
+
self.push(item);
|
|
6112
|
+
});
|
|
6113
|
+
} else if (arguments.length > 0) {
|
|
6114
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
6115
|
+
self.push(arguments[i]);
|
|
6116
|
+
}
|
|
6117
|
+
}
|
|
6115
6118
|
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
throw new Error('removing node which does not belong to this list')
|
|
6119
|
-
}
|
|
6119
|
+
return self
|
|
6120
|
+
}
|
|
6120
6121
|
|
|
6121
|
-
|
|
6122
|
-
|
|
6122
|
+
Yallist.prototype.removeNode = function (node) {
|
|
6123
|
+
if (node.list !== this) {
|
|
6124
|
+
throw new Error('removing node which does not belong to this list')
|
|
6125
|
+
}
|
|
6123
6126
|
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
}
|
|
6127
|
+
var next = node.next;
|
|
6128
|
+
var prev = node.prev;
|
|
6127
6129
|
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6130
|
+
if (next) {
|
|
6131
|
+
next.prev = prev;
|
|
6132
|
+
}
|
|
6131
6133
|
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
if (node === this.tail) {
|
|
6136
|
-
this.tail = prev;
|
|
6137
|
-
}
|
|
6134
|
+
if (prev) {
|
|
6135
|
+
prev.next = next;
|
|
6136
|
+
}
|
|
6138
6137
|
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6138
|
+
if (node === this.head) {
|
|
6139
|
+
this.head = next;
|
|
6140
|
+
}
|
|
6141
|
+
if (node === this.tail) {
|
|
6142
|
+
this.tail = prev;
|
|
6143
|
+
}
|
|
6143
6144
|
|
|
6144
|
-
|
|
6145
|
-
|
|
6145
|
+
node.list.length--;
|
|
6146
|
+
node.next = null;
|
|
6147
|
+
node.prev = null;
|
|
6148
|
+
node.list = null;
|
|
6146
6149
|
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
return
|
|
6150
|
-
}
|
|
6150
|
+
return next
|
|
6151
|
+
};
|
|
6151
6152
|
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6153
|
+
Yallist.prototype.unshiftNode = function (node) {
|
|
6154
|
+
if (node === this.head) {
|
|
6155
|
+
return
|
|
6156
|
+
}
|
|
6155
6157
|
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
if (head) {
|
|
6160
|
-
head.prev = node;
|
|
6161
|
-
}
|
|
6158
|
+
if (node.list) {
|
|
6159
|
+
node.list.removeNode(node);
|
|
6160
|
+
}
|
|
6162
6161
|
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
}
|
|
6162
|
+
var head = this.head;
|
|
6163
|
+
node.list = this;
|
|
6164
|
+
node.next = head;
|
|
6165
|
+
if (head) {
|
|
6166
|
+
head.prev = node;
|
|
6167
|
+
}
|
|
6169
6168
|
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6169
|
+
this.head = node;
|
|
6170
|
+
if (!this.tail) {
|
|
6171
|
+
this.tail = node;
|
|
6172
|
+
}
|
|
6173
|
+
this.length++;
|
|
6174
|
+
};
|
|
6174
6175
|
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6176
|
+
Yallist.prototype.pushNode = function (node) {
|
|
6177
|
+
if (node === this.tail) {
|
|
6178
|
+
return
|
|
6179
|
+
}
|
|
6178
6180
|
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
if (tail) {
|
|
6183
|
-
tail.next = node;
|
|
6184
|
-
}
|
|
6181
|
+
if (node.list) {
|
|
6182
|
+
node.list.removeNode(node);
|
|
6183
|
+
}
|
|
6185
6184
|
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
}
|
|
6185
|
+
var tail = this.tail;
|
|
6186
|
+
node.list = this;
|
|
6187
|
+
node.prev = tail;
|
|
6188
|
+
if (tail) {
|
|
6189
|
+
tail.next = node;
|
|
6190
|
+
}
|
|
6192
6191
|
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
};
|
|
6192
|
+
this.tail = node;
|
|
6193
|
+
if (!this.head) {
|
|
6194
|
+
this.head = node;
|
|
6195
|
+
}
|
|
6196
|
+
this.length++;
|
|
6197
|
+
};
|
|
6199
6198
|
|
|
6200
|
-
Yallist
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
};
|
|
6199
|
+
Yallist.prototype.push = function () {
|
|
6200
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
6201
|
+
push(this, arguments[i]);
|
|
6202
|
+
}
|
|
6203
|
+
return this.length
|
|
6204
|
+
};
|
|
6206
6205
|
|
|
6207
|
-
Yallist
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6206
|
+
Yallist.prototype.unshift = function () {
|
|
6207
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
6208
|
+
unshift(this, arguments[i]);
|
|
6209
|
+
}
|
|
6210
|
+
return this.length
|
|
6211
|
+
};
|
|
6211
6212
|
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
} else {
|
|
6217
|
-
this.head = null;
|
|
6218
|
-
}
|
|
6219
|
-
this.length--;
|
|
6220
|
-
return res
|
|
6221
|
-
};
|
|
6213
|
+
Yallist.prototype.pop = function () {
|
|
6214
|
+
if (!this.tail) {
|
|
6215
|
+
return undefined
|
|
6216
|
+
}
|
|
6222
6217
|
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6218
|
+
var res = this.tail.value;
|
|
6219
|
+
this.tail = this.tail.prev;
|
|
6220
|
+
if (this.tail) {
|
|
6221
|
+
this.tail.next = null;
|
|
6222
|
+
} else {
|
|
6223
|
+
this.head = null;
|
|
6224
|
+
}
|
|
6225
|
+
this.length--;
|
|
6226
|
+
return res
|
|
6227
|
+
};
|
|
6227
6228
|
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
} else {
|
|
6233
|
-
this.tail = null;
|
|
6234
|
-
}
|
|
6235
|
-
this.length--;
|
|
6236
|
-
return res
|
|
6237
|
-
};
|
|
6229
|
+
Yallist.prototype.shift = function () {
|
|
6230
|
+
if (!this.head) {
|
|
6231
|
+
return undefined
|
|
6232
|
+
}
|
|
6238
6233
|
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
}
|
|
6234
|
+
var res = this.head.value;
|
|
6235
|
+
this.head = this.head.next;
|
|
6236
|
+
if (this.head) {
|
|
6237
|
+
this.head.prev = null;
|
|
6238
|
+
} else {
|
|
6239
|
+
this.tail = null;
|
|
6240
|
+
}
|
|
6241
|
+
this.length--;
|
|
6242
|
+
return res
|
|
6243
|
+
};
|
|
6246
6244
|
|
|
6247
|
-
Yallist
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
};
|
|
6245
|
+
Yallist.prototype.forEach = function (fn, thisp) {
|
|
6246
|
+
thisp = thisp || this;
|
|
6247
|
+
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
6248
|
+
fn.call(thisp, walker.value, i, this);
|
|
6249
|
+
walker = walker.next;
|
|
6250
|
+
}
|
|
6251
|
+
};
|
|
6254
6252
|
|
|
6255
|
-
Yallist
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
}
|
|
6263
|
-
};
|
|
6253
|
+
Yallist.prototype.forEachReverse = function (fn, thisp) {
|
|
6254
|
+
thisp = thisp || this;
|
|
6255
|
+
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
6256
|
+
fn.call(thisp, walker.value, i, this);
|
|
6257
|
+
walker = walker.prev;
|
|
6258
|
+
}
|
|
6259
|
+
};
|
|
6264
6260
|
|
|
6265
|
-
Yallist
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
};
|
|
6261
|
+
Yallist.prototype.get = function (n) {
|
|
6262
|
+
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
6263
|
+
// abort out of the list early if we hit a cycle
|
|
6264
|
+
walker = walker.next;
|
|
6265
|
+
}
|
|
6266
|
+
if (i === n && walker !== null) {
|
|
6267
|
+
return walker.value
|
|
6268
|
+
}
|
|
6269
|
+
};
|
|
6274
6270
|
|
|
6275
|
-
Yallist
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
};
|
|
6271
|
+
Yallist.prototype.getReverse = function (n) {
|
|
6272
|
+
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
6273
|
+
// abort out of the list early if we hit a cycle
|
|
6274
|
+
walker = walker.prev;
|
|
6275
|
+
}
|
|
6276
|
+
if (i === n && walker !== null) {
|
|
6277
|
+
return walker.value
|
|
6278
|
+
}
|
|
6279
|
+
};
|
|
6284
6280
|
|
|
6285
|
-
Yallist
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
};
|
|
6281
|
+
Yallist.prototype.map = function (fn, thisp) {
|
|
6282
|
+
thisp = thisp || this;
|
|
6283
|
+
var res = new Yallist();
|
|
6284
|
+
for (var walker = this.head; walker !== null;) {
|
|
6285
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
6286
|
+
walker = walker.next;
|
|
6287
|
+
}
|
|
6288
|
+
return res
|
|
6289
|
+
};
|
|
6294
6290
|
|
|
6295
|
-
Yallist
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
throw new TypeError('Reduce of empty list with no initial value')
|
|
6305
|
-
}
|
|
6291
|
+
Yallist.prototype.mapReverse = function (fn, thisp) {
|
|
6292
|
+
thisp = thisp || this;
|
|
6293
|
+
var res = new Yallist();
|
|
6294
|
+
for (var walker = this.tail; walker !== null;) {
|
|
6295
|
+
res.push(fn.call(thisp, walker.value, this));
|
|
6296
|
+
walker = walker.prev;
|
|
6297
|
+
}
|
|
6298
|
+
return res
|
|
6299
|
+
};
|
|
6306
6300
|
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6301
|
+
Yallist.prototype.reduce = function (fn, initial) {
|
|
6302
|
+
var acc;
|
|
6303
|
+
var walker = this.head;
|
|
6304
|
+
if (arguments.length > 1) {
|
|
6305
|
+
acc = initial;
|
|
6306
|
+
} else if (this.head) {
|
|
6307
|
+
walker = this.head.next;
|
|
6308
|
+
acc = this.head.value;
|
|
6309
|
+
} else {
|
|
6310
|
+
throw new TypeError('Reduce of empty list with no initial value')
|
|
6311
|
+
}
|
|
6311
6312
|
|
|
6312
|
-
|
|
6313
|
-
|
|
6313
|
+
for (var i = 0; walker !== null; i++) {
|
|
6314
|
+
acc = fn(acc, walker.value, i);
|
|
6315
|
+
walker = walker.next;
|
|
6316
|
+
}
|
|
6314
6317
|
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
var walker = this.tail;
|
|
6318
|
-
if (arguments.length > 1) {
|
|
6319
|
-
acc = initial;
|
|
6320
|
-
} else if (this.tail) {
|
|
6321
|
-
walker = this.tail.prev;
|
|
6322
|
-
acc = this.tail.value;
|
|
6323
|
-
} else {
|
|
6324
|
-
throw new TypeError('Reduce of empty list with no initial value')
|
|
6325
|
-
}
|
|
6318
|
+
return acc
|
|
6319
|
+
};
|
|
6326
6320
|
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6321
|
+
Yallist.prototype.reduceReverse = function (fn, initial) {
|
|
6322
|
+
var acc;
|
|
6323
|
+
var walker = this.tail;
|
|
6324
|
+
if (arguments.length > 1) {
|
|
6325
|
+
acc = initial;
|
|
6326
|
+
} else if (this.tail) {
|
|
6327
|
+
walker = this.tail.prev;
|
|
6328
|
+
acc = this.tail.value;
|
|
6329
|
+
} else {
|
|
6330
|
+
throw new TypeError('Reduce of empty list with no initial value')
|
|
6331
|
+
}
|
|
6331
6332
|
|
|
6332
|
-
|
|
6333
|
-
|
|
6333
|
+
for (var i = this.length - 1; walker !== null; i--) {
|
|
6334
|
+
acc = fn(acc, walker.value, i);
|
|
6335
|
+
walker = walker.prev;
|
|
6336
|
+
}
|
|
6334
6337
|
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
6338
|
-
arr[i] = walker.value;
|
|
6339
|
-
walker = walker.next;
|
|
6340
|
-
}
|
|
6341
|
-
return arr
|
|
6342
|
-
};
|
|
6338
|
+
return acc
|
|
6339
|
+
};
|
|
6343
6340
|
|
|
6344
|
-
Yallist
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
};
|
|
6341
|
+
Yallist.prototype.toArray = function () {
|
|
6342
|
+
var arr = new Array(this.length);
|
|
6343
|
+
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
6344
|
+
arr[i] = walker.value;
|
|
6345
|
+
walker = walker.next;
|
|
6346
|
+
}
|
|
6347
|
+
return arr
|
|
6348
|
+
};
|
|
6352
6349
|
|
|
6353
|
-
Yallist
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
}
|
|
6362
|
-
var ret = new Yallist$1();
|
|
6363
|
-
if (to < from || to < 0) {
|
|
6364
|
-
return ret
|
|
6365
|
-
}
|
|
6366
|
-
if (from < 0) {
|
|
6367
|
-
from = 0;
|
|
6368
|
-
}
|
|
6369
|
-
if (to > this.length) {
|
|
6370
|
-
to = this.length;
|
|
6371
|
-
}
|
|
6372
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
6373
|
-
walker = walker.next;
|
|
6374
|
-
}
|
|
6375
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
6376
|
-
ret.push(walker.value);
|
|
6377
|
-
}
|
|
6378
|
-
return ret
|
|
6379
|
-
};
|
|
6350
|
+
Yallist.prototype.toArrayReverse = function () {
|
|
6351
|
+
var arr = new Array(this.length);
|
|
6352
|
+
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
6353
|
+
arr[i] = walker.value;
|
|
6354
|
+
walker = walker.prev;
|
|
6355
|
+
}
|
|
6356
|
+
return arr
|
|
6357
|
+
};
|
|
6380
6358
|
|
|
6381
|
-
Yallist
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
};
|
|
6359
|
+
Yallist.prototype.slice = function (from, to) {
|
|
6360
|
+
to = to || this.length;
|
|
6361
|
+
if (to < 0) {
|
|
6362
|
+
to += this.length;
|
|
6363
|
+
}
|
|
6364
|
+
from = from || 0;
|
|
6365
|
+
if (from < 0) {
|
|
6366
|
+
from += this.length;
|
|
6367
|
+
}
|
|
6368
|
+
var ret = new Yallist();
|
|
6369
|
+
if (to < from || to < 0) {
|
|
6370
|
+
return ret
|
|
6371
|
+
}
|
|
6372
|
+
if (from < 0) {
|
|
6373
|
+
from = 0;
|
|
6374
|
+
}
|
|
6375
|
+
if (to > this.length) {
|
|
6376
|
+
to = this.length;
|
|
6377
|
+
}
|
|
6378
|
+
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
6379
|
+
walker = walker.next;
|
|
6380
|
+
}
|
|
6381
|
+
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
6382
|
+
ret.push(walker.value);
|
|
6383
|
+
}
|
|
6384
|
+
return ret
|
|
6385
|
+
};
|
|
6408
6386
|
|
|
6409
|
-
Yallist
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6387
|
+
Yallist.prototype.sliceReverse = function (from, to) {
|
|
6388
|
+
to = to || this.length;
|
|
6389
|
+
if (to < 0) {
|
|
6390
|
+
to += this.length;
|
|
6391
|
+
}
|
|
6392
|
+
from = from || 0;
|
|
6393
|
+
if (from < 0) {
|
|
6394
|
+
from += this.length;
|
|
6395
|
+
}
|
|
6396
|
+
var ret = new Yallist();
|
|
6397
|
+
if (to < from || to < 0) {
|
|
6398
|
+
return ret
|
|
6399
|
+
}
|
|
6400
|
+
if (from < 0) {
|
|
6401
|
+
from = 0;
|
|
6402
|
+
}
|
|
6403
|
+
if (to > this.length) {
|
|
6404
|
+
to = this.length;
|
|
6405
|
+
}
|
|
6406
|
+
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
6407
|
+
walker = walker.prev;
|
|
6408
|
+
}
|
|
6409
|
+
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
6410
|
+
ret.push(walker.value);
|
|
6411
|
+
}
|
|
6412
|
+
return ret
|
|
6413
|
+
};
|
|
6416
6414
|
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6415
|
+
Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
|
|
6416
|
+
if (start > this.length) {
|
|
6417
|
+
start = this.length - 1;
|
|
6418
|
+
}
|
|
6419
|
+
if (start < 0) {
|
|
6420
|
+
start = this.length + start;
|
|
6421
|
+
}
|
|
6420
6422
|
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
walker = this.removeNode(walker);
|
|
6425
|
-
}
|
|
6426
|
-
if (walker === null) {
|
|
6427
|
-
walker = this.tail;
|
|
6428
|
-
}
|
|
6423
|
+
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
6424
|
+
walker = walker.next;
|
|
6425
|
+
}
|
|
6429
6426
|
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6427
|
+
var ret = [];
|
|
6428
|
+
for (var i = 0; walker && i < deleteCount; i++) {
|
|
6429
|
+
ret.push(walker.value);
|
|
6430
|
+
walker = this.removeNode(walker);
|
|
6431
|
+
}
|
|
6432
|
+
if (walker === null) {
|
|
6433
|
+
walker = this.tail;
|
|
6434
|
+
}
|
|
6433
6435
|
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
return ret;
|
|
6438
|
-
};
|
|
6436
|
+
if (walker !== this.head && walker !== this.tail) {
|
|
6437
|
+
walker = walker.prev;
|
|
6438
|
+
}
|
|
6439
6439
|
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
walker.prev = walker.next;
|
|
6446
|
-
walker.next = p;
|
|
6447
|
-
}
|
|
6448
|
-
this.head = tail;
|
|
6449
|
-
this.tail = head;
|
|
6450
|
-
return this
|
|
6451
|
-
};
|
|
6440
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
6441
|
+
walker = insert(this, walker, nodes[i]);
|
|
6442
|
+
}
|
|
6443
|
+
return ret;
|
|
6444
|
+
};
|
|
6452
6445
|
|
|
6453
|
-
function
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6446
|
+
Yallist.prototype.reverse = function () {
|
|
6447
|
+
var head = this.head;
|
|
6448
|
+
var tail = this.tail;
|
|
6449
|
+
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
6450
|
+
var p = walker.prev;
|
|
6451
|
+
walker.prev = walker.next;
|
|
6452
|
+
walker.next = p;
|
|
6453
|
+
}
|
|
6454
|
+
this.head = tail;
|
|
6455
|
+
this.tail = head;
|
|
6456
|
+
return this
|
|
6457
|
+
};
|
|
6457
6458
|
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
self.head = inserted;
|
|
6463
|
-
}
|
|
6459
|
+
function insert (self, node, value) {
|
|
6460
|
+
var inserted = node === self.head ?
|
|
6461
|
+
new Node(value, null, node, self) :
|
|
6462
|
+
new Node(value, node, node.next, self);
|
|
6464
6463
|
|
|
6465
|
-
|
|
6464
|
+
if (inserted.next === null) {
|
|
6465
|
+
self.tail = inserted;
|
|
6466
|
+
}
|
|
6467
|
+
if (inserted.prev === null) {
|
|
6468
|
+
self.head = inserted;
|
|
6469
|
+
}
|
|
6466
6470
|
|
|
6467
|
-
|
|
6468
|
-
}
|
|
6471
|
+
self.length++;
|
|
6469
6472
|
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
if (!self.head) {
|
|
6473
|
-
self.head = self.tail;
|
|
6474
|
-
}
|
|
6475
|
-
self.length++;
|
|
6476
|
-
}
|
|
6473
|
+
return inserted
|
|
6474
|
+
}
|
|
6477
6475
|
|
|
6478
|
-
function
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
}
|
|
6476
|
+
function push (self, item) {
|
|
6477
|
+
self.tail = new Node(item, self.tail, null, self);
|
|
6478
|
+
if (!self.head) {
|
|
6479
|
+
self.head = self.tail;
|
|
6480
|
+
}
|
|
6481
|
+
self.length++;
|
|
6482
|
+
}
|
|
6485
6483
|
|
|
6486
|
-
function
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6484
|
+
function unshift (self, item) {
|
|
6485
|
+
self.head = new Node(item, null, self.head, self);
|
|
6486
|
+
if (!self.tail) {
|
|
6487
|
+
self.tail = self.head;
|
|
6488
|
+
}
|
|
6489
|
+
self.length++;
|
|
6490
|
+
}
|
|
6490
6491
|
|
|
6491
|
-
|
|
6492
|
-
|
|
6492
|
+
function Node (value, prev, next, list) {
|
|
6493
|
+
if (!(this instanceof Node)) {
|
|
6494
|
+
return new Node(value, prev, next, list)
|
|
6495
|
+
}
|
|
6493
6496
|
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
this.prev = prev;
|
|
6497
|
-
} else {
|
|
6498
|
-
this.prev = null;
|
|
6499
|
-
}
|
|
6497
|
+
this.list = list;
|
|
6498
|
+
this.value = value;
|
|
6500
6499
|
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
}
|
|
6500
|
+
if (prev) {
|
|
6501
|
+
prev.next = this;
|
|
6502
|
+
this.prev = prev;
|
|
6503
|
+
} else {
|
|
6504
|
+
this.prev = null;
|
|
6505
|
+
}
|
|
6508
6506
|
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
}
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
const MAX = Symbol('max');
|
|
6518
|
-
const LENGTH = Symbol('length');
|
|
6519
|
-
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
6520
|
-
const ALLOW_STALE = Symbol('allowStale');
|
|
6521
|
-
const MAX_AGE = Symbol('maxAge');
|
|
6522
|
-
const DISPOSE = Symbol('dispose');
|
|
6523
|
-
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
|
|
6524
|
-
const LRU_LIST = Symbol('lruList');
|
|
6525
|
-
const CACHE = Symbol('cache');
|
|
6526
|
-
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
6527
|
-
|
|
6528
|
-
const naiveLength = () => 1;
|
|
6529
|
-
|
|
6530
|
-
// lruList is a yallist where the head is the youngest
|
|
6531
|
-
// item, and the tail is the oldest. the list contains the Hit
|
|
6532
|
-
// objects as the entries.
|
|
6533
|
-
// Each Hit object has a reference to its Yallist.Node. This
|
|
6534
|
-
// never changes.
|
|
6535
|
-
//
|
|
6536
|
-
// cache is a Map (or PseudoMap) that matches the keys to
|
|
6537
|
-
// the Yallist.Node object.
|
|
6538
|
-
class LRUCache {
|
|
6539
|
-
constructor (options) {
|
|
6540
|
-
if (typeof options === 'number')
|
|
6541
|
-
options = { max: options };
|
|
6542
|
-
|
|
6543
|
-
if (!options)
|
|
6544
|
-
options = {};
|
|
6507
|
+
if (next) {
|
|
6508
|
+
next.prev = this;
|
|
6509
|
+
this.next = next;
|
|
6510
|
+
} else {
|
|
6511
|
+
this.next = null;
|
|
6512
|
+
}
|
|
6513
|
+
}
|
|
6545
6514
|
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6515
|
+
try {
|
|
6516
|
+
// add if support for Symbol.iterator is present
|
|
6517
|
+
requireIterator()(Yallist);
|
|
6518
|
+
} catch (er) {}
|
|
6519
|
+
return yallist;
|
|
6520
|
+
}
|
|
6550
6521
|
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6522
|
+
var lruCache;
|
|
6523
|
+
var hasRequiredLruCache;
|
|
6524
|
+
|
|
6525
|
+
function requireLruCache () {
|
|
6526
|
+
if (hasRequiredLruCache) return lruCache;
|
|
6527
|
+
hasRequiredLruCache = 1;
|
|
6528
|
+
|
|
6529
|
+
// A linked list to keep track of recently-used-ness
|
|
6530
|
+
const Yallist = requireYallist();
|
|
6531
|
+
|
|
6532
|
+
const MAX = Symbol('max');
|
|
6533
|
+
const LENGTH = Symbol('length');
|
|
6534
|
+
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
6535
|
+
const ALLOW_STALE = Symbol('allowStale');
|
|
6536
|
+
const MAX_AGE = Symbol('maxAge');
|
|
6537
|
+
const DISPOSE = Symbol('dispose');
|
|
6538
|
+
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
|
|
6539
|
+
const LRU_LIST = Symbol('lruList');
|
|
6540
|
+
const CACHE = Symbol('cache');
|
|
6541
|
+
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
6542
|
+
|
|
6543
|
+
const naiveLength = () => 1;
|
|
6544
|
+
|
|
6545
|
+
// lruList is a yallist where the head is the youngest
|
|
6546
|
+
// item, and the tail is the oldest. the list contains the Hit
|
|
6547
|
+
// objects as the entries.
|
|
6548
|
+
// Each Hit object has a reference to its Yallist.Node. This
|
|
6549
|
+
// never changes.
|
|
6550
|
+
//
|
|
6551
|
+
// cache is a Map (or PseudoMap) that matches the keys to
|
|
6552
|
+
// the Yallist.Node object.
|
|
6553
|
+
class LRUCache {
|
|
6554
|
+
constructor (options) {
|
|
6555
|
+
if (typeof options === 'number')
|
|
6556
|
+
options = { max: options };
|
|
6557
|
+
|
|
6558
|
+
if (!options)
|
|
6559
|
+
options = {};
|
|
6560
|
+
|
|
6561
|
+
if (options.max && (typeof options.max !== 'number' || options.max < 0))
|
|
6562
|
+
throw new TypeError('max must be a non-negative number')
|
|
6563
|
+
// Kind of weird to have a default max of Infinity, but oh well.
|
|
6564
|
+
this[MAX] = options.max || Infinity;
|
|
6565
|
+
|
|
6566
|
+
const lc = options.length || naiveLength;
|
|
6567
|
+
this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
|
|
6568
|
+
this[ALLOW_STALE] = options.stale || false;
|
|
6569
|
+
if (options.maxAge && typeof options.maxAge !== 'number')
|
|
6570
|
+
throw new TypeError('maxAge must be a number')
|
|
6571
|
+
this[MAX_AGE] = options.maxAge || 0;
|
|
6572
|
+
this[DISPOSE] = options.dispose;
|
|
6573
|
+
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
6574
|
+
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
6575
|
+
this.reset();
|
|
6576
|
+
}
|
|
6562
6577
|
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6578
|
+
// resize the cache when the max changes.
|
|
6579
|
+
set max (mL) {
|
|
6580
|
+
if (typeof mL !== 'number' || mL < 0)
|
|
6581
|
+
throw new TypeError('max must be a non-negative number')
|
|
6567
6582
|
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6583
|
+
this[MAX] = mL || Infinity;
|
|
6584
|
+
trim(this);
|
|
6585
|
+
}
|
|
6586
|
+
get max () {
|
|
6587
|
+
return this[MAX]
|
|
6588
|
+
}
|
|
6574
6589
|
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6590
|
+
set allowStale (allowStale) {
|
|
6591
|
+
this[ALLOW_STALE] = !!allowStale;
|
|
6592
|
+
}
|
|
6593
|
+
get allowStale () {
|
|
6594
|
+
return this[ALLOW_STALE]
|
|
6595
|
+
}
|
|
6581
6596
|
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6597
|
+
set maxAge (mA) {
|
|
6598
|
+
if (typeof mA !== 'number')
|
|
6599
|
+
throw new TypeError('maxAge must be a non-negative number')
|
|
6585
6600
|
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6601
|
+
this[MAX_AGE] = mA;
|
|
6602
|
+
trim(this);
|
|
6603
|
+
}
|
|
6604
|
+
get maxAge () {
|
|
6605
|
+
return this[MAX_AGE]
|
|
6606
|
+
}
|
|
6592
6607
|
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6608
|
+
// resize the cache when the lengthCalculator changes.
|
|
6609
|
+
set lengthCalculator (lC) {
|
|
6610
|
+
if (typeof lC !== 'function')
|
|
6611
|
+
lC = naiveLength;
|
|
6612
|
+
|
|
6613
|
+
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
6614
|
+
this[LENGTH_CALCULATOR] = lC;
|
|
6615
|
+
this[LENGTH] = 0;
|
|
6616
|
+
this[LRU_LIST].forEach(hit => {
|
|
6617
|
+
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
6618
|
+
this[LENGTH] += hit.length;
|
|
6619
|
+
});
|
|
6620
|
+
}
|
|
6621
|
+
trim(this);
|
|
6622
|
+
}
|
|
6623
|
+
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
|
6597
6624
|
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
this[LENGTH] = 0;
|
|
6601
|
-
this[LRU_LIST].forEach(hit => {
|
|
6602
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
6603
|
-
this[LENGTH] += hit.length;
|
|
6604
|
-
});
|
|
6605
|
-
}
|
|
6606
|
-
trim(this);
|
|
6607
|
-
}
|
|
6608
|
-
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
|
6625
|
+
get length () { return this[LENGTH] }
|
|
6626
|
+
get itemCount () { return this[LRU_LIST].length }
|
|
6609
6627
|
|
|
6610
|
-
|
|
6611
|
-
|
|
6628
|
+
rforEach (fn, thisp) {
|
|
6629
|
+
thisp = thisp || this;
|
|
6630
|
+
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
|
6631
|
+
const prev = walker.prev;
|
|
6632
|
+
forEachStep(this, fn, walker, thisp);
|
|
6633
|
+
walker = prev;
|
|
6634
|
+
}
|
|
6635
|
+
}
|
|
6612
6636
|
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6637
|
+
forEach (fn, thisp) {
|
|
6638
|
+
thisp = thisp || this;
|
|
6639
|
+
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
|
6640
|
+
const next = walker.next;
|
|
6641
|
+
forEachStep(this, fn, walker, thisp);
|
|
6642
|
+
walker = next;
|
|
6643
|
+
}
|
|
6644
|
+
}
|
|
6621
6645
|
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
const next = walker.next;
|
|
6626
|
-
forEachStep(this, fn, walker, thisp);
|
|
6627
|
-
walker = next;
|
|
6628
|
-
}
|
|
6629
|
-
}
|
|
6646
|
+
keys () {
|
|
6647
|
+
return this[LRU_LIST].toArray().map(k => k.key)
|
|
6648
|
+
}
|
|
6630
6649
|
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6650
|
+
values () {
|
|
6651
|
+
return this[LRU_LIST].toArray().map(k => k.value)
|
|
6652
|
+
}
|
|
6634
6653
|
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6654
|
+
reset () {
|
|
6655
|
+
if (this[DISPOSE] &&
|
|
6656
|
+
this[LRU_LIST] &&
|
|
6657
|
+
this[LRU_LIST].length) {
|
|
6658
|
+
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
6659
|
+
}
|
|
6638
6660
|
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
6644
|
-
}
|
|
6661
|
+
this[CACHE] = new Map(); // hash of items by key
|
|
6662
|
+
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
6663
|
+
this[LENGTH] = 0; // length of items in the list
|
|
6664
|
+
}
|
|
6645
6665
|
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6666
|
+
dump () {
|
|
6667
|
+
return this[LRU_LIST].map(hit =>
|
|
6668
|
+
isStale(this, hit) ? false : {
|
|
6669
|
+
k: hit.key,
|
|
6670
|
+
v: hit.value,
|
|
6671
|
+
e: hit.now + (hit.maxAge || 0)
|
|
6672
|
+
}).toArray().filter(h => h)
|
|
6673
|
+
}
|
|
6650
6674
|
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
k: hit.key,
|
|
6655
|
-
v: hit.value,
|
|
6656
|
-
e: hit.now + (hit.maxAge || 0)
|
|
6657
|
-
}).toArray().filter(h => h)
|
|
6658
|
-
}
|
|
6675
|
+
dumpLru () {
|
|
6676
|
+
return this[LRU_LIST]
|
|
6677
|
+
}
|
|
6659
6678
|
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
}
|
|
6679
|
+
set (key, value, maxAge) {
|
|
6680
|
+
maxAge = maxAge || this[MAX_AGE];
|
|
6663
6681
|
|
|
6664
|
-
|
|
6665
|
-
|
|
6682
|
+
if (maxAge && typeof maxAge !== 'number')
|
|
6683
|
+
throw new TypeError('maxAge must be a number')
|
|
6666
6684
|
|
|
6667
|
-
|
|
6668
|
-
|
|
6685
|
+
const now = maxAge ? Date.now() : 0;
|
|
6686
|
+
const len = this[LENGTH_CALCULATOR](value, key);
|
|
6669
6687
|
|
|
6670
|
-
|
|
6671
|
-
|
|
6688
|
+
if (this[CACHE].has(key)) {
|
|
6689
|
+
if (len > this[MAX]) {
|
|
6690
|
+
del(this, this[CACHE].get(key));
|
|
6691
|
+
return false
|
|
6692
|
+
}
|
|
6672
6693
|
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
del(this, this[CACHE].get(key));
|
|
6676
|
-
return false
|
|
6677
|
-
}
|
|
6694
|
+
const node = this[CACHE].get(key);
|
|
6695
|
+
const item = node.value;
|
|
6678
6696
|
|
|
6679
|
-
|
|
6680
|
-
|
|
6697
|
+
// dispose of the old one before overwriting
|
|
6698
|
+
// split out into 2 ifs for better coverage tracking
|
|
6699
|
+
if (this[DISPOSE]) {
|
|
6700
|
+
if (!this[NO_DISPOSE_ON_SET])
|
|
6701
|
+
this[DISPOSE](key, item.value);
|
|
6702
|
+
}
|
|
6681
6703
|
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6704
|
+
item.now = now;
|
|
6705
|
+
item.maxAge = maxAge;
|
|
6706
|
+
item.value = value;
|
|
6707
|
+
this[LENGTH] += len - item.length;
|
|
6708
|
+
item.length = len;
|
|
6709
|
+
this.get(key);
|
|
6710
|
+
trim(this);
|
|
6711
|
+
return true
|
|
6712
|
+
}
|
|
6688
6713
|
|
|
6689
|
-
|
|
6690
|
-
item.maxAge = maxAge;
|
|
6691
|
-
item.value = value;
|
|
6692
|
-
this[LENGTH] += len - item.length;
|
|
6693
|
-
item.length = len;
|
|
6694
|
-
this.get(key);
|
|
6695
|
-
trim(this);
|
|
6696
|
-
return true
|
|
6697
|
-
}
|
|
6714
|
+
const hit = new Entry(key, value, len, now, maxAge);
|
|
6698
6715
|
|
|
6699
|
-
|
|
6716
|
+
// oversized objects fall out of cache automatically.
|
|
6717
|
+
if (hit.length > this[MAX]) {
|
|
6718
|
+
if (this[DISPOSE])
|
|
6719
|
+
this[DISPOSE](key, value);
|
|
6700
6720
|
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
if (this[DISPOSE])
|
|
6704
|
-
this[DISPOSE](key, value);
|
|
6721
|
+
return false
|
|
6722
|
+
}
|
|
6705
6723
|
|
|
6706
|
-
|
|
6707
|
-
|
|
6724
|
+
this[LENGTH] += hit.length;
|
|
6725
|
+
this[LRU_LIST].unshift(hit);
|
|
6726
|
+
this[CACHE].set(key, this[LRU_LIST].head);
|
|
6727
|
+
trim(this);
|
|
6728
|
+
return true
|
|
6729
|
+
}
|
|
6708
6730
|
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
}
|
|
6731
|
+
has (key) {
|
|
6732
|
+
if (!this[CACHE].has(key)) return false
|
|
6733
|
+
const hit = this[CACHE].get(key).value;
|
|
6734
|
+
return !isStale(this, hit)
|
|
6735
|
+
}
|
|
6715
6736
|
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
return !isStale(this, hit)
|
|
6720
|
-
}
|
|
6737
|
+
get (key) {
|
|
6738
|
+
return get(this, key, true)
|
|
6739
|
+
}
|
|
6721
6740
|
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6741
|
+
peek (key) {
|
|
6742
|
+
return get(this, key, false)
|
|
6743
|
+
}
|
|
6725
6744
|
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6745
|
+
pop () {
|
|
6746
|
+
const node = this[LRU_LIST].tail;
|
|
6747
|
+
if (!node)
|
|
6748
|
+
return null
|
|
6729
6749
|
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
return null
|
|
6750
|
+
del(this, node);
|
|
6751
|
+
return node.value
|
|
6752
|
+
}
|
|
6734
6753
|
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6754
|
+
del (key) {
|
|
6755
|
+
del(this, this[CACHE].get(key));
|
|
6756
|
+
}
|
|
6738
6757
|
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6758
|
+
load (arr) {
|
|
6759
|
+
// reset the cache
|
|
6760
|
+
this.reset();
|
|
6761
|
+
|
|
6762
|
+
const now = Date.now();
|
|
6763
|
+
// A previous serialized cache has the most recent items first
|
|
6764
|
+
for (let l = arr.length - 1; l >= 0; l--) {
|
|
6765
|
+
const hit = arr[l];
|
|
6766
|
+
const expiresAt = hit.e || 0;
|
|
6767
|
+
if (expiresAt === 0)
|
|
6768
|
+
// the item was created without expiration in a non aged cache
|
|
6769
|
+
this.set(hit.k, hit.v);
|
|
6770
|
+
else {
|
|
6771
|
+
const maxAge = expiresAt - now;
|
|
6772
|
+
// dont add already expired items
|
|
6773
|
+
if (maxAge > 0) {
|
|
6774
|
+
this.set(hit.k, hit.v, maxAge);
|
|
6775
|
+
}
|
|
6776
|
+
}
|
|
6777
|
+
}
|
|
6778
|
+
}
|
|
6742
6779
|
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6780
|
+
prune () {
|
|
6781
|
+
this[CACHE].forEach((value, key) => get(this, key, false));
|
|
6782
|
+
}
|
|
6783
|
+
}
|
|
6746
6784
|
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6785
|
+
const get = (self, key, doUse) => {
|
|
6786
|
+
const node = self[CACHE].get(key);
|
|
6787
|
+
if (node) {
|
|
6788
|
+
const hit = node.value;
|
|
6789
|
+
if (isStale(self, hit)) {
|
|
6790
|
+
del(self, node);
|
|
6791
|
+
if (!self[ALLOW_STALE])
|
|
6792
|
+
return undefined
|
|
6793
|
+
} else {
|
|
6794
|
+
if (doUse) {
|
|
6795
|
+
if (self[UPDATE_AGE_ON_GET])
|
|
6796
|
+
node.value.now = Date.now();
|
|
6797
|
+
self[LRU_LIST].unshiftNode(node);
|
|
6798
|
+
}
|
|
6799
|
+
}
|
|
6800
|
+
return hit.value
|
|
6801
|
+
}
|
|
6802
|
+
};
|
|
6764
6803
|
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
}
|
|
6804
|
+
const isStale = (self, hit) => {
|
|
6805
|
+
if (!hit || (!hit.maxAge && !self[MAX_AGE]))
|
|
6806
|
+
return false
|
|
6769
6807
|
|
|
6770
|
-
const
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
if (isStale(self, hit)) {
|
|
6775
|
-
del(self, node);
|
|
6776
|
-
if (!self[ALLOW_STALE])
|
|
6777
|
-
return undefined
|
|
6778
|
-
} else {
|
|
6779
|
-
if (doUse) {
|
|
6780
|
-
if (self[UPDATE_AGE_ON_GET])
|
|
6781
|
-
node.value.now = Date.now();
|
|
6782
|
-
self[LRU_LIST].unshiftNode(node);
|
|
6783
|
-
}
|
|
6784
|
-
}
|
|
6785
|
-
return hit.value
|
|
6786
|
-
}
|
|
6787
|
-
};
|
|
6808
|
+
const diff = Date.now() - hit.now;
|
|
6809
|
+
return hit.maxAge ? diff > hit.maxAge
|
|
6810
|
+
: self[MAX_AGE] && (diff > self[MAX_AGE])
|
|
6811
|
+
};
|
|
6788
6812
|
|
|
6789
|
-
const
|
|
6790
|
-
|
|
6791
|
-
|
|
6813
|
+
const trim = self => {
|
|
6814
|
+
if (self[LENGTH] > self[MAX]) {
|
|
6815
|
+
for (let walker = self[LRU_LIST].tail;
|
|
6816
|
+
self[LENGTH] > self[MAX] && walker !== null;) {
|
|
6817
|
+
// We know that we're about to delete this one, and also
|
|
6818
|
+
// what the next least recently used key will be, so just
|
|
6819
|
+
// go ahead and set it now.
|
|
6820
|
+
const prev = walker.prev;
|
|
6821
|
+
del(self, walker);
|
|
6822
|
+
walker = prev;
|
|
6823
|
+
}
|
|
6824
|
+
}
|
|
6825
|
+
};
|
|
6792
6826
|
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6827
|
+
const del = (self, node) => {
|
|
6828
|
+
if (node) {
|
|
6829
|
+
const hit = node.value;
|
|
6830
|
+
if (self[DISPOSE])
|
|
6831
|
+
self[DISPOSE](hit.key, hit.value);
|
|
6797
6832
|
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
// what the next least recently used key will be, so just
|
|
6804
|
-
// go ahead and set it now.
|
|
6805
|
-
const prev = walker.prev;
|
|
6806
|
-
del(self, walker);
|
|
6807
|
-
walker = prev;
|
|
6808
|
-
}
|
|
6809
|
-
}
|
|
6810
|
-
};
|
|
6833
|
+
self[LENGTH] -= hit.length;
|
|
6834
|
+
self[CACHE].delete(hit.key);
|
|
6835
|
+
self[LRU_LIST].removeNode(node);
|
|
6836
|
+
}
|
|
6837
|
+
};
|
|
6811
6838
|
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6839
|
+
class Entry {
|
|
6840
|
+
constructor (key, value, length, now, maxAge) {
|
|
6841
|
+
this.key = key;
|
|
6842
|
+
this.value = value;
|
|
6843
|
+
this.length = length;
|
|
6844
|
+
this.now = now;
|
|
6845
|
+
this.maxAge = maxAge || 0;
|
|
6846
|
+
}
|
|
6847
|
+
}
|
|
6817
6848
|
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6849
|
+
const forEachStep = (self, fn, node, thisp) => {
|
|
6850
|
+
let hit = node.value;
|
|
6851
|
+
if (isStale(self, hit)) {
|
|
6852
|
+
del(self, node);
|
|
6853
|
+
if (!self[ALLOW_STALE])
|
|
6854
|
+
hit = undefined;
|
|
6855
|
+
}
|
|
6856
|
+
if (hit)
|
|
6857
|
+
fn.call(thisp, hit.value, hit.key, self);
|
|
6858
|
+
};
|
|
6823
6859
|
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
this.key = key;
|
|
6827
|
-
this.value = value;
|
|
6828
|
-
this.length = length;
|
|
6829
|
-
this.now = now;
|
|
6830
|
-
this.maxAge = maxAge || 0;
|
|
6831
|
-
}
|
|
6860
|
+
lruCache = LRUCache;
|
|
6861
|
+
return lruCache;
|
|
6832
6862
|
}
|
|
6833
6863
|
|
|
6834
|
-
const forEachStep = (self, fn, node, thisp) => {
|
|
6835
|
-
let hit = node.value;
|
|
6836
|
-
if (isStale(self, hit)) {
|
|
6837
|
-
del(self, node);
|
|
6838
|
-
if (!self[ALLOW_STALE])
|
|
6839
|
-
hit = undefined;
|
|
6840
|
-
}
|
|
6841
|
-
if (hit)
|
|
6842
|
-
fn.call(thisp, hit.value, hit.key, self);
|
|
6843
|
-
};
|
|
6844
|
-
|
|
6845
|
-
var lruCache = LRUCache;
|
|
6846
|
-
|
|
6847
6864
|
var range;
|
|
6848
6865
|
var hasRequiredRange;
|
|
6849
6866
|
|
|
@@ -7044,7 +7061,7 @@ function requireRange () {
|
|
|
7044
7061
|
}
|
|
7045
7062
|
range = Range;
|
|
7046
7063
|
|
|
7047
|
-
const LRU =
|
|
7064
|
+
const LRU = requireLruCache();
|
|
7048
7065
|
const cache = new LRU({ max: 1000 });
|
|
7049
7066
|
|
|
7050
7067
|
const parseOptions = parseOptions_1;
|