@zuplo/cli 6.70.29 → 6.70.31
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/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +8 -8
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +21 -21
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +2 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -1
- package/node_modules/pg-protocol/dist/serializer.d.ts +1 -0
- package/node_modules/pg-protocol/package.json +4 -4
- package/node_modules/pg-protocol/src/buffer-reader.ts +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/qs/CHANGELOG.md +10 -0
- package/node_modules/qs/README.md +1 -1
- package/node_modules/qs/dist/qs.js +15 -15
- package/node_modules/qs/eslint.config.mjs +1 -0
- package/node_modules/qs/lib/parse.js +52 -22
- package/node_modules/qs/lib/stringify.js +11 -4
- package/node_modules/qs/package.json +2 -2
- package/node_modules/qs/test/parse.js +49 -0
- package/node_modules/qs/test/stringify.js +129 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/package.json +8 -8
- package/node_modules/toad-cache/dist/toad-cache.cjs +185 -185
- package/node_modules/toad-cache/dist/toad-cache.mjs +181 -181
- package/node_modules/toad-cache/package.json +33 -31
- package/package.json +6 -6
|
@@ -880,6 +880,7 @@ class LRUCache {
|
|
|
880
880
|
status.key = k;
|
|
881
881
|
if (v !== undefined)
|
|
882
882
|
status.value = v;
|
|
883
|
+
status.cache = this;
|
|
883
884
|
}
|
|
884
885
|
const result = this.#set(k, v, setOptions);
|
|
885
886
|
if (status && diagnostics_channel_js_1.metrics.hasSubscribers) {
|
|
@@ -887,7 +888,7 @@ class LRUCache {
|
|
|
887
888
|
}
|
|
888
889
|
return result;
|
|
889
890
|
}
|
|
890
|
-
#set(k, v, setOptions
|
|
891
|
+
#set(k, v, setOptions, bf) {
|
|
891
892
|
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
|
|
892
893
|
if (v === undefined) {
|
|
893
894
|
if (status)
|
|
@@ -896,7 +897,8 @@ class LRUCache {
|
|
|
896
897
|
return this;
|
|
897
898
|
}
|
|
898
899
|
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
899
|
-
|
|
900
|
+
const isBF = this.#isBackgroundFetch(v);
|
|
901
|
+
if (status && !isBF)
|
|
900
902
|
status.value = v;
|
|
901
903
|
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status);
|
|
902
904
|
// if the item doesn't fit, don't do anything
|
|
@@ -928,52 +930,68 @@ class LRUCache {
|
|
|
928
930
|
if (status)
|
|
929
931
|
status.set = 'add';
|
|
930
932
|
noUpdateTTL = false;
|
|
931
|
-
if (this.#hasOnInsert) {
|
|
933
|
+
if (this.#hasOnInsert && !isBF) {
|
|
932
934
|
this.#onInsert?.(v, k, 'add');
|
|
933
935
|
}
|
|
934
936
|
}
|
|
935
937
|
else {
|
|
936
938
|
// update
|
|
939
|
+
// might be updating a background fetch!
|
|
937
940
|
this.#moveToTail(index);
|
|
938
941
|
const oldVal = this.#valList[index];
|
|
939
942
|
if (v !== oldVal) {
|
|
940
|
-
if (
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
943
|
+
if (!noDisposeOnSet) {
|
|
944
|
+
if (this.#isBackgroundFetch(oldVal)) {
|
|
945
|
+
if (oldVal !== bf) {
|
|
946
|
+
// setting over a background fetch, not merely resolving it.
|
|
947
|
+
oldVal.__abortController.abort(new Error('replaced'));
|
|
948
|
+
}
|
|
949
|
+
const { __staleWhileFetching: s } = oldVal;
|
|
950
|
+
if (s !== undefined && s !== v) {
|
|
951
|
+
if (this.#hasDispose) {
|
|
952
|
+
this.#dispose?.(s, k, 'set');
|
|
953
|
+
}
|
|
954
|
+
if (this.#hasDisposeAfter) {
|
|
955
|
+
this.#disposed?.push([s, k, 'set']);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
else {
|
|
944
960
|
if (this.#hasDispose) {
|
|
945
|
-
this.#dispose?.(
|
|
961
|
+
this.#dispose?.(oldVal, k, 'set');
|
|
946
962
|
}
|
|
947
963
|
if (this.#hasDisposeAfter) {
|
|
948
|
-
this.#disposed?.push([
|
|
964
|
+
this.#disposed?.push([oldVal, k, 'set']);
|
|
949
965
|
}
|
|
950
966
|
}
|
|
951
967
|
}
|
|
952
|
-
else if (!noDisposeOnSet) {
|
|
953
|
-
if (this.#hasDispose) {
|
|
954
|
-
this.#dispose?.(oldVal, k, 'set');
|
|
955
|
-
}
|
|
956
|
-
if (this.#hasDisposeAfter) {
|
|
957
|
-
this.#disposed?.push([oldVal, k, 'set']);
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
968
|
this.#removeItemSize(index);
|
|
961
969
|
this.#addItemSize(index, size, status);
|
|
962
970
|
this.#valList[index] = v;
|
|
963
|
-
if (
|
|
964
|
-
status.set = 'replace';
|
|
971
|
+
if (!isBF) {
|
|
965
972
|
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?
|
|
966
973
|
oldVal.__staleWhileFetching
|
|
967
974
|
: oldVal;
|
|
968
|
-
|
|
969
|
-
|
|
975
|
+
const setType = oldValue === undefined ? 'add'
|
|
976
|
+
: v !== oldValue ? 'replace'
|
|
977
|
+
: 'update';
|
|
978
|
+
if (status) {
|
|
979
|
+
status.set = setType;
|
|
980
|
+
if (oldValue !== undefined)
|
|
981
|
+
status.oldValue = oldValue;
|
|
982
|
+
}
|
|
983
|
+
if (this.#hasOnInsert) {
|
|
984
|
+
this.onInsert?.(v, k, setType);
|
|
985
|
+
}
|
|
970
986
|
}
|
|
971
987
|
}
|
|
972
|
-
else if (
|
|
973
|
-
status
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
this
|
|
988
|
+
else if (!isBF) {
|
|
989
|
+
if (status) {
|
|
990
|
+
status.set = 'update';
|
|
991
|
+
}
|
|
992
|
+
if (this.#hasOnInsert) {
|
|
993
|
+
this.onInsert?.(v, k, 'update');
|
|
994
|
+
}
|
|
977
995
|
}
|
|
978
996
|
}
|
|
979
997
|
if (ttl !== 0 && !this.#ttls) {
|
|
@@ -1028,15 +1046,18 @@ class LRUCache {
|
|
|
1028
1046
|
const head = this.#head;
|
|
1029
1047
|
const k = this.#keyList[head];
|
|
1030
1048
|
const v = this.#valList[head];
|
|
1031
|
-
|
|
1049
|
+
const isBF = this.#isBackgroundFetch(v);
|
|
1050
|
+
if (isBF) {
|
|
1032
1051
|
v.__abortController.abort(new Error('evicted'));
|
|
1033
1052
|
}
|
|
1034
|
-
|
|
1053
|
+
const oldValue = isBF ? v.__staleWhileFetching : v;
|
|
1054
|
+
if ((this.#hasDispose || this.#hasDisposeAfter) &&
|
|
1055
|
+
oldValue !== undefined) {
|
|
1035
1056
|
if (this.#hasDispose) {
|
|
1036
|
-
this.#dispose?.(
|
|
1057
|
+
this.#dispose?.(oldValue, k, 'evict');
|
|
1037
1058
|
}
|
|
1038
1059
|
if (this.#hasDisposeAfter) {
|
|
1039
|
-
this.#disposed?.push([
|
|
1060
|
+
this.#disposed?.push([oldValue, k, 'evict']);
|
|
1040
1061
|
}
|
|
1041
1062
|
}
|
|
1042
1063
|
this.#removeItemSize(head);
|
|
@@ -1083,6 +1104,7 @@ class LRUCache {
|
|
|
1083
1104
|
if (status) {
|
|
1084
1105
|
status.op = 'has';
|
|
1085
1106
|
status.key = k;
|
|
1107
|
+
status.cache = this;
|
|
1086
1108
|
}
|
|
1087
1109
|
const result = this.#has(k, hasOptions);
|
|
1088
1110
|
if (diagnostics_channel_js_1.metrics.hasSubscribers)
|
|
@@ -1130,6 +1152,7 @@ class LRUCache {
|
|
|
1130
1152
|
if (status) {
|
|
1131
1153
|
status.op = 'peek';
|
|
1132
1154
|
status.key = k;
|
|
1155
|
+
status.cache = this;
|
|
1133
1156
|
}
|
|
1134
1157
|
peekOptions.status = status;
|
|
1135
1158
|
const result = this.#peek(k, peekOptions);
|
|
@@ -1212,7 +1235,7 @@ class LRUCache {
|
|
|
1212
1235
|
else {
|
|
1213
1236
|
if (options.status)
|
|
1214
1237
|
options.status.fetchUpdated = true;
|
|
1215
|
-
this.#set(k, v, fetchOpts.options);
|
|
1238
|
+
this.#set(k, v, fetchOpts.options, bf);
|
|
1216
1239
|
}
|
|
1217
1240
|
}
|
|
1218
1241
|
return v;
|
|
@@ -1258,9 +1281,6 @@ class LRUCache {
|
|
|
1258
1281
|
};
|
|
1259
1282
|
const pcall = (res, rej) => {
|
|
1260
1283
|
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
1261
|
-
if (fmp && fmp instanceof Promise) {
|
|
1262
|
-
fmp.then(v => res(v === undefined ? undefined : v), rej);
|
|
1263
|
-
}
|
|
1264
1284
|
// ignored, we go until we finish, regardless.
|
|
1265
1285
|
// defer check until we are actually aborting,
|
|
1266
1286
|
// so fetchMethod can override.
|
|
@@ -1273,6 +1293,12 @@ class LRUCache {
|
|
|
1273
1293
|
}
|
|
1274
1294
|
}
|
|
1275
1295
|
});
|
|
1296
|
+
if (fmp && fmp instanceof Promise) {
|
|
1297
|
+
fmp.then(v => res(v === undefined ? undefined : v), rej);
|
|
1298
|
+
}
|
|
1299
|
+
else if (fmp !== undefined) {
|
|
1300
|
+
res(fmp);
|
|
1301
|
+
}
|
|
1276
1302
|
};
|
|
1277
1303
|
if (options.status)
|
|
1278
1304
|
options.status.fetchDispatched = true;
|
|
@@ -1328,6 +1354,7 @@ class LRUCache {
|
|
|
1328
1354
|
status.key = k;
|
|
1329
1355
|
if (forceRefresh)
|
|
1330
1356
|
status.forceRefresh = true;
|
|
1357
|
+
status.cache = this;
|
|
1331
1358
|
}
|
|
1332
1359
|
if (!this.#hasFetchMethod) {
|
|
1333
1360
|
if (status)
|
|
@@ -1430,6 +1457,7 @@ class LRUCache {
|
|
|
1430
1457
|
if (memoOptions.context) {
|
|
1431
1458
|
status.context = memoOptions.context;
|
|
1432
1459
|
}
|
|
1460
|
+
status.cache = this;
|
|
1433
1461
|
}
|
|
1434
1462
|
const result = this.#memo(k, memoOptions);
|
|
1435
1463
|
if (status)
|
|
@@ -1476,6 +1504,7 @@ class LRUCache {
|
|
|
1476
1504
|
if (status) {
|
|
1477
1505
|
status.op = 'get';
|
|
1478
1506
|
status.key = k;
|
|
1507
|
+
status.cache = this;
|
|
1479
1508
|
}
|
|
1480
1509
|
const result = this.#get(k, getOptions);
|
|
1481
1510
|
if (status) {
|
|
@@ -1574,6 +1603,7 @@ class LRUCache {
|
|
|
1574
1603
|
op: 'delete',
|
|
1575
1604
|
delete: reason,
|
|
1576
1605
|
key: k,
|
|
1606
|
+
cache: this,
|
|
1577
1607
|
});
|
|
1578
1608
|
}
|
|
1579
1609
|
let deleted = false;
|
|
@@ -1654,7 +1684,7 @@ class LRUCache {
|
|
|
1654
1684
|
}
|
|
1655
1685
|
}
|
|
1656
1686
|
this.#keyMap.clear();
|
|
1657
|
-
this.#valList.fill(undefined);
|
|
1687
|
+
void this.#valList.fill(undefined);
|
|
1658
1688
|
this.#keyList.fill(undefined);
|
|
1659
1689
|
if (this.#ttls && this.#starts) {
|
|
1660
1690
|
this.#ttls.fill(0);
|