@netlify/plugin-nextjs 5.2.2 → 5.3.1
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/dist/build/advanced-api-routes.js +1 -1
- package/dist/build/cache.js +1 -1
- package/dist/build/content/prerendered.js +4 -4
- package/dist/build/content/server.js +10 -9
- package/dist/build/content/static.js +4 -4
- package/dist/build/functions/edge.js +2 -2
- package/dist/build/functions/server.js +4 -4
- package/dist/build/image-cdn.js +17 -33
- package/dist/build/plugin-context.js +17 -5
- package/dist/build/verification.js +2 -10
- package/dist/esm-chunks/{chunk-PDPDW32D.js → chunk-5QSXBV7L.js} +1 -1
- package/dist/esm-chunks/{chunk-PJG75HGC.js → chunk-EFGWM7RS.js} +38 -655
- package/dist/esm-chunks/{chunk-VZNKO4OO.js → chunk-FHR56UHE.js} +56 -111
- package/dist/esm-chunks/{chunk-Y3K5Q6FP.js → chunk-GNGHTHMQ.js} +51 -86
- package/dist/esm-chunks/{chunk-5JVNISGM.js → chunk-OEQOKJGE.js} +1 -2
- package/dist/esm-chunks/{package-YOCAX5OR.js → package-JXSICZZN.js} +9 -9
- package/dist/index.js +4 -9
- package/dist/run/config.js +1 -1
- package/dist/run/constants.js +1 -1
- package/dist/run/handlers/cache.cjs +8 -10
- package/dist/run/handlers/server.js +353 -501
- package/dist/run/handlers/tracer.cjs +36 -60
- package/dist/run/handlers/tracing.js +1192 -1592
- package/dist/run/headers.js +1 -1
- package/dist/run/next.cjs +42 -78
- package/dist/run/revalidate.js +1 -1
- package/dist/run/{systemlog.js → systemlog.cjs} +31 -11
- package/dist/shared/blobkey.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
__commonJS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OEQOKJGE.js";
|
|
10
10
|
|
|
11
11
|
// node_modules/semver/internal/constants.js
|
|
12
12
|
var require_constants = __commonJS({
|
|
@@ -300,7 +300,7 @@ var require_semver = __commonJS({
|
|
|
300
300
|
do {
|
|
301
301
|
const a = this.build[i];
|
|
302
302
|
const b = other.build[i];
|
|
303
|
-
debug("
|
|
303
|
+
debug("build compare", i, a, b);
|
|
304
304
|
if (a === void 0 && b === void 0) {
|
|
305
305
|
return 0;
|
|
306
306
|
} else if (b === void 0) {
|
|
@@ -771,655 +771,39 @@ var require_coerce = __commonJS({
|
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
773
|
|
|
774
|
-
// node_modules/semver/
|
|
775
|
-
var
|
|
776
|
-
"node_modules/semver/
|
|
777
|
-
"use strict";
|
|
778
|
-
module.exports = function(Yallist) {
|
|
779
|
-
Yallist.prototype[Symbol.iterator] = function* () {
|
|
780
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
|
781
|
-
yield walker.value;
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
|
|
788
|
-
// node_modules/semver/node_modules/yallist/yallist.js
|
|
789
|
-
var require_yallist = __commonJS({
|
|
790
|
-
"node_modules/semver/node_modules/yallist/yallist.js"(exports, module) {
|
|
791
|
-
"use strict";
|
|
792
|
-
module.exports = Yallist;
|
|
793
|
-
Yallist.Node = Node;
|
|
794
|
-
Yallist.create = Yallist;
|
|
795
|
-
function Yallist(list) {
|
|
796
|
-
var self = this;
|
|
797
|
-
if (!(self instanceof Yallist)) {
|
|
798
|
-
self = new Yallist();
|
|
799
|
-
}
|
|
800
|
-
self.tail = null;
|
|
801
|
-
self.head = null;
|
|
802
|
-
self.length = 0;
|
|
803
|
-
if (list && typeof list.forEach === "function") {
|
|
804
|
-
list.forEach(function(item) {
|
|
805
|
-
self.push(item);
|
|
806
|
-
});
|
|
807
|
-
} else if (arguments.length > 0) {
|
|
808
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
809
|
-
self.push(arguments[i]);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
return self;
|
|
813
|
-
}
|
|
814
|
-
Yallist.prototype.removeNode = function(node) {
|
|
815
|
-
if (node.list !== this) {
|
|
816
|
-
throw new Error("removing node which does not belong to this list");
|
|
817
|
-
}
|
|
818
|
-
var next = node.next;
|
|
819
|
-
var prev = node.prev;
|
|
820
|
-
if (next) {
|
|
821
|
-
next.prev = prev;
|
|
822
|
-
}
|
|
823
|
-
if (prev) {
|
|
824
|
-
prev.next = next;
|
|
825
|
-
}
|
|
826
|
-
if (node === this.head) {
|
|
827
|
-
this.head = next;
|
|
828
|
-
}
|
|
829
|
-
if (node === this.tail) {
|
|
830
|
-
this.tail = prev;
|
|
831
|
-
}
|
|
832
|
-
node.list.length--;
|
|
833
|
-
node.next = null;
|
|
834
|
-
node.prev = null;
|
|
835
|
-
node.list = null;
|
|
836
|
-
return next;
|
|
837
|
-
};
|
|
838
|
-
Yallist.prototype.unshiftNode = function(node) {
|
|
839
|
-
if (node === this.head) {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
if (node.list) {
|
|
843
|
-
node.list.removeNode(node);
|
|
844
|
-
}
|
|
845
|
-
var head = this.head;
|
|
846
|
-
node.list = this;
|
|
847
|
-
node.next = head;
|
|
848
|
-
if (head) {
|
|
849
|
-
head.prev = node;
|
|
850
|
-
}
|
|
851
|
-
this.head = node;
|
|
852
|
-
if (!this.tail) {
|
|
853
|
-
this.tail = node;
|
|
854
|
-
}
|
|
855
|
-
this.length++;
|
|
856
|
-
};
|
|
857
|
-
Yallist.prototype.pushNode = function(node) {
|
|
858
|
-
if (node === this.tail) {
|
|
859
|
-
return;
|
|
860
|
-
}
|
|
861
|
-
if (node.list) {
|
|
862
|
-
node.list.removeNode(node);
|
|
863
|
-
}
|
|
864
|
-
var tail = this.tail;
|
|
865
|
-
node.list = this;
|
|
866
|
-
node.prev = tail;
|
|
867
|
-
if (tail) {
|
|
868
|
-
tail.next = node;
|
|
869
|
-
}
|
|
870
|
-
this.tail = node;
|
|
871
|
-
if (!this.head) {
|
|
872
|
-
this.head = node;
|
|
873
|
-
}
|
|
874
|
-
this.length++;
|
|
875
|
-
};
|
|
876
|
-
Yallist.prototype.push = function() {
|
|
877
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
878
|
-
push(this, arguments[i]);
|
|
879
|
-
}
|
|
880
|
-
return this.length;
|
|
881
|
-
};
|
|
882
|
-
Yallist.prototype.unshift = function() {
|
|
883
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
884
|
-
unshift(this, arguments[i]);
|
|
885
|
-
}
|
|
886
|
-
return this.length;
|
|
887
|
-
};
|
|
888
|
-
Yallist.prototype.pop = function() {
|
|
889
|
-
if (!this.tail) {
|
|
890
|
-
return void 0;
|
|
891
|
-
}
|
|
892
|
-
var res = this.tail.value;
|
|
893
|
-
this.tail = this.tail.prev;
|
|
894
|
-
if (this.tail) {
|
|
895
|
-
this.tail.next = null;
|
|
896
|
-
} else {
|
|
897
|
-
this.head = null;
|
|
898
|
-
}
|
|
899
|
-
this.length--;
|
|
900
|
-
return res;
|
|
901
|
-
};
|
|
902
|
-
Yallist.prototype.shift = function() {
|
|
903
|
-
if (!this.head) {
|
|
904
|
-
return void 0;
|
|
905
|
-
}
|
|
906
|
-
var res = this.head.value;
|
|
907
|
-
this.head = this.head.next;
|
|
908
|
-
if (this.head) {
|
|
909
|
-
this.head.prev = null;
|
|
910
|
-
} else {
|
|
911
|
-
this.tail = null;
|
|
912
|
-
}
|
|
913
|
-
this.length--;
|
|
914
|
-
return res;
|
|
915
|
-
};
|
|
916
|
-
Yallist.prototype.forEach = function(fn, thisp) {
|
|
917
|
-
thisp = thisp || this;
|
|
918
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
919
|
-
fn.call(thisp, walker.value, i, this);
|
|
920
|
-
walker = walker.next;
|
|
921
|
-
}
|
|
922
|
-
};
|
|
923
|
-
Yallist.prototype.forEachReverse = function(fn, thisp) {
|
|
924
|
-
thisp = thisp || this;
|
|
925
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
926
|
-
fn.call(thisp, walker.value, i, this);
|
|
927
|
-
walker = walker.prev;
|
|
928
|
-
}
|
|
929
|
-
};
|
|
930
|
-
Yallist.prototype.get = function(n) {
|
|
931
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
932
|
-
walker = walker.next;
|
|
933
|
-
}
|
|
934
|
-
if (i === n && walker !== null) {
|
|
935
|
-
return walker.value;
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
|
-
Yallist.prototype.getReverse = function(n) {
|
|
939
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
940
|
-
walker = walker.prev;
|
|
941
|
-
}
|
|
942
|
-
if (i === n && walker !== null) {
|
|
943
|
-
return walker.value;
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
Yallist.prototype.map = function(fn, thisp) {
|
|
947
|
-
thisp = thisp || this;
|
|
948
|
-
var res = new Yallist();
|
|
949
|
-
for (var walker = this.head; walker !== null; ) {
|
|
950
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
951
|
-
walker = walker.next;
|
|
952
|
-
}
|
|
953
|
-
return res;
|
|
954
|
-
};
|
|
955
|
-
Yallist.prototype.mapReverse = function(fn, thisp) {
|
|
956
|
-
thisp = thisp || this;
|
|
957
|
-
var res = new Yallist();
|
|
958
|
-
for (var walker = this.tail; walker !== null; ) {
|
|
959
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
960
|
-
walker = walker.prev;
|
|
961
|
-
}
|
|
962
|
-
return res;
|
|
963
|
-
};
|
|
964
|
-
Yallist.prototype.reduce = function(fn, initial) {
|
|
965
|
-
var acc;
|
|
966
|
-
var walker = this.head;
|
|
967
|
-
if (arguments.length > 1) {
|
|
968
|
-
acc = initial;
|
|
969
|
-
} else if (this.head) {
|
|
970
|
-
walker = this.head.next;
|
|
971
|
-
acc = this.head.value;
|
|
972
|
-
} else {
|
|
973
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
974
|
-
}
|
|
975
|
-
for (var i = 0; walker !== null; i++) {
|
|
976
|
-
acc = fn(acc, walker.value, i);
|
|
977
|
-
walker = walker.next;
|
|
978
|
-
}
|
|
979
|
-
return acc;
|
|
980
|
-
};
|
|
981
|
-
Yallist.prototype.reduceReverse = function(fn, initial) {
|
|
982
|
-
var acc;
|
|
983
|
-
var walker = this.tail;
|
|
984
|
-
if (arguments.length > 1) {
|
|
985
|
-
acc = initial;
|
|
986
|
-
} else if (this.tail) {
|
|
987
|
-
walker = this.tail.prev;
|
|
988
|
-
acc = this.tail.value;
|
|
989
|
-
} else {
|
|
990
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
|
991
|
-
}
|
|
992
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
|
993
|
-
acc = fn(acc, walker.value, i);
|
|
994
|
-
walker = walker.prev;
|
|
995
|
-
}
|
|
996
|
-
return acc;
|
|
997
|
-
};
|
|
998
|
-
Yallist.prototype.toArray = function() {
|
|
999
|
-
var arr = new Array(this.length);
|
|
1000
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
1001
|
-
arr[i] = walker.value;
|
|
1002
|
-
walker = walker.next;
|
|
1003
|
-
}
|
|
1004
|
-
return arr;
|
|
1005
|
-
};
|
|
1006
|
-
Yallist.prototype.toArrayReverse = function() {
|
|
1007
|
-
var arr = new Array(this.length);
|
|
1008
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
1009
|
-
arr[i] = walker.value;
|
|
1010
|
-
walker = walker.prev;
|
|
1011
|
-
}
|
|
1012
|
-
return arr;
|
|
1013
|
-
};
|
|
1014
|
-
Yallist.prototype.slice = function(from, to) {
|
|
1015
|
-
to = to || this.length;
|
|
1016
|
-
if (to < 0) {
|
|
1017
|
-
to += this.length;
|
|
1018
|
-
}
|
|
1019
|
-
from = from || 0;
|
|
1020
|
-
if (from < 0) {
|
|
1021
|
-
from += this.length;
|
|
1022
|
-
}
|
|
1023
|
-
var ret = new Yallist();
|
|
1024
|
-
if (to < from || to < 0) {
|
|
1025
|
-
return ret;
|
|
1026
|
-
}
|
|
1027
|
-
if (from < 0) {
|
|
1028
|
-
from = 0;
|
|
1029
|
-
}
|
|
1030
|
-
if (to > this.length) {
|
|
1031
|
-
to = this.length;
|
|
1032
|
-
}
|
|
1033
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
1034
|
-
walker = walker.next;
|
|
1035
|
-
}
|
|
1036
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
1037
|
-
ret.push(walker.value);
|
|
1038
|
-
}
|
|
1039
|
-
return ret;
|
|
1040
|
-
};
|
|
1041
|
-
Yallist.prototype.sliceReverse = function(from, to) {
|
|
1042
|
-
to = to || this.length;
|
|
1043
|
-
if (to < 0) {
|
|
1044
|
-
to += this.length;
|
|
1045
|
-
}
|
|
1046
|
-
from = from || 0;
|
|
1047
|
-
if (from < 0) {
|
|
1048
|
-
from += this.length;
|
|
1049
|
-
}
|
|
1050
|
-
var ret = new Yallist();
|
|
1051
|
-
if (to < from || to < 0) {
|
|
1052
|
-
return ret;
|
|
1053
|
-
}
|
|
1054
|
-
if (from < 0) {
|
|
1055
|
-
from = 0;
|
|
1056
|
-
}
|
|
1057
|
-
if (to > this.length) {
|
|
1058
|
-
to = this.length;
|
|
1059
|
-
}
|
|
1060
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
1061
|
-
walker = walker.prev;
|
|
1062
|
-
}
|
|
1063
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
1064
|
-
ret.push(walker.value);
|
|
1065
|
-
}
|
|
1066
|
-
return ret;
|
|
1067
|
-
};
|
|
1068
|
-
Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
|
|
1069
|
-
if (start > this.length) {
|
|
1070
|
-
start = this.length - 1;
|
|
1071
|
-
}
|
|
1072
|
-
if (start < 0) {
|
|
1073
|
-
start = this.length + start;
|
|
1074
|
-
}
|
|
1075
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
1076
|
-
walker = walker.next;
|
|
1077
|
-
}
|
|
1078
|
-
var ret = [];
|
|
1079
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
|
1080
|
-
ret.push(walker.value);
|
|
1081
|
-
walker = this.removeNode(walker);
|
|
1082
|
-
}
|
|
1083
|
-
if (walker === null) {
|
|
1084
|
-
walker = this.tail;
|
|
1085
|
-
}
|
|
1086
|
-
if (walker !== this.head && walker !== this.tail) {
|
|
1087
|
-
walker = walker.prev;
|
|
1088
|
-
}
|
|
1089
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
1090
|
-
walker = insert(this, walker, nodes[i]);
|
|
1091
|
-
}
|
|
1092
|
-
return ret;
|
|
1093
|
-
};
|
|
1094
|
-
Yallist.prototype.reverse = function() {
|
|
1095
|
-
var head = this.head;
|
|
1096
|
-
var tail = this.tail;
|
|
1097
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
1098
|
-
var p = walker.prev;
|
|
1099
|
-
walker.prev = walker.next;
|
|
1100
|
-
walker.next = p;
|
|
1101
|
-
}
|
|
1102
|
-
this.head = tail;
|
|
1103
|
-
this.tail = head;
|
|
1104
|
-
return this;
|
|
1105
|
-
};
|
|
1106
|
-
function insert(self, node, value) {
|
|
1107
|
-
var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
|
|
1108
|
-
if (inserted.next === null) {
|
|
1109
|
-
self.tail = inserted;
|
|
1110
|
-
}
|
|
1111
|
-
if (inserted.prev === null) {
|
|
1112
|
-
self.head = inserted;
|
|
1113
|
-
}
|
|
1114
|
-
self.length++;
|
|
1115
|
-
return inserted;
|
|
1116
|
-
}
|
|
1117
|
-
function push(self, item) {
|
|
1118
|
-
self.tail = new Node(item, self.tail, null, self);
|
|
1119
|
-
if (!self.head) {
|
|
1120
|
-
self.head = self.tail;
|
|
1121
|
-
}
|
|
1122
|
-
self.length++;
|
|
1123
|
-
}
|
|
1124
|
-
function unshift(self, item) {
|
|
1125
|
-
self.head = new Node(item, null, self.head, self);
|
|
1126
|
-
if (!self.tail) {
|
|
1127
|
-
self.tail = self.head;
|
|
1128
|
-
}
|
|
1129
|
-
self.length++;
|
|
1130
|
-
}
|
|
1131
|
-
function Node(value, prev, next, list) {
|
|
1132
|
-
if (!(this instanceof Node)) {
|
|
1133
|
-
return new Node(value, prev, next, list);
|
|
1134
|
-
}
|
|
1135
|
-
this.list = list;
|
|
1136
|
-
this.value = value;
|
|
1137
|
-
if (prev) {
|
|
1138
|
-
prev.next = this;
|
|
1139
|
-
this.prev = prev;
|
|
1140
|
-
} else {
|
|
1141
|
-
this.prev = null;
|
|
1142
|
-
}
|
|
1143
|
-
if (next) {
|
|
1144
|
-
next.prev = this;
|
|
1145
|
-
this.next = next;
|
|
1146
|
-
} else {
|
|
1147
|
-
this.next = null;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
try {
|
|
1151
|
-
require_iterator()(Yallist);
|
|
1152
|
-
} catch (er) {
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
});
|
|
1156
|
-
|
|
1157
|
-
// node_modules/semver/node_modules/lru-cache/index.js
|
|
1158
|
-
var require_lru_cache = __commonJS({
|
|
1159
|
-
"node_modules/semver/node_modules/lru-cache/index.js"(exports, module) {
|
|
1160
|
-
"use strict";
|
|
1161
|
-
var Yallist = require_yallist();
|
|
1162
|
-
var MAX = Symbol("max");
|
|
1163
|
-
var LENGTH = Symbol("length");
|
|
1164
|
-
var LENGTH_CALCULATOR = Symbol("lengthCalculator");
|
|
1165
|
-
var ALLOW_STALE = Symbol("allowStale");
|
|
1166
|
-
var MAX_AGE = Symbol("maxAge");
|
|
1167
|
-
var DISPOSE = Symbol("dispose");
|
|
1168
|
-
var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
|
|
1169
|
-
var LRU_LIST = Symbol("lruList");
|
|
1170
|
-
var CACHE = Symbol("cache");
|
|
1171
|
-
var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
|
|
1172
|
-
var naiveLength = () => 1;
|
|
774
|
+
// node_modules/semver/internal/lrucache.js
|
|
775
|
+
var require_lrucache = __commonJS({
|
|
776
|
+
"node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
1173
777
|
var LRUCache = class {
|
|
1174
|
-
constructor(
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
if (!options)
|
|
1178
|
-
options = {};
|
|
1179
|
-
if (options.max && (typeof options.max !== "number" || options.max < 0))
|
|
1180
|
-
throw new TypeError("max must be a non-negative number");
|
|
1181
|
-
const max = this[MAX] = options.max || Infinity;
|
|
1182
|
-
const lc = options.length || naiveLength;
|
|
1183
|
-
this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
|
|
1184
|
-
this[ALLOW_STALE] = options.stale || false;
|
|
1185
|
-
if (options.maxAge && typeof options.maxAge !== "number")
|
|
1186
|
-
throw new TypeError("maxAge must be a number");
|
|
1187
|
-
this[MAX_AGE] = options.maxAge || 0;
|
|
1188
|
-
this[DISPOSE] = options.dispose;
|
|
1189
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
1190
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
1191
|
-
this.reset();
|
|
1192
|
-
}
|
|
1193
|
-
// resize the cache when the max changes.
|
|
1194
|
-
set max(mL) {
|
|
1195
|
-
if (typeof mL !== "number" || mL < 0)
|
|
1196
|
-
throw new TypeError("max must be a non-negative number");
|
|
1197
|
-
this[MAX] = mL || Infinity;
|
|
1198
|
-
trim(this);
|
|
1199
|
-
}
|
|
1200
|
-
get max() {
|
|
1201
|
-
return this[MAX];
|
|
1202
|
-
}
|
|
1203
|
-
set allowStale(allowStale) {
|
|
1204
|
-
this[ALLOW_STALE] = !!allowStale;
|
|
1205
|
-
}
|
|
1206
|
-
get allowStale() {
|
|
1207
|
-
return this[ALLOW_STALE];
|
|
1208
|
-
}
|
|
1209
|
-
set maxAge(mA) {
|
|
1210
|
-
if (typeof mA !== "number")
|
|
1211
|
-
throw new TypeError("maxAge must be a non-negative number");
|
|
1212
|
-
this[MAX_AGE] = mA;
|
|
1213
|
-
trim(this);
|
|
1214
|
-
}
|
|
1215
|
-
get maxAge() {
|
|
1216
|
-
return this[MAX_AGE];
|
|
1217
|
-
}
|
|
1218
|
-
// resize the cache when the lengthCalculator changes.
|
|
1219
|
-
set lengthCalculator(lC) {
|
|
1220
|
-
if (typeof lC !== "function")
|
|
1221
|
-
lC = naiveLength;
|
|
1222
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
1223
|
-
this[LENGTH_CALCULATOR] = lC;
|
|
1224
|
-
this[LENGTH] = 0;
|
|
1225
|
-
this[LRU_LIST].forEach((hit) => {
|
|
1226
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
1227
|
-
this[LENGTH] += hit.length;
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
trim(this);
|
|
1231
|
-
}
|
|
1232
|
-
get lengthCalculator() {
|
|
1233
|
-
return this[LENGTH_CALCULATOR];
|
|
1234
|
-
}
|
|
1235
|
-
get length() {
|
|
1236
|
-
return this[LENGTH];
|
|
1237
|
-
}
|
|
1238
|
-
get itemCount() {
|
|
1239
|
-
return this[LRU_LIST].length;
|
|
1240
|
-
}
|
|
1241
|
-
rforEach(fn, thisp) {
|
|
1242
|
-
thisp = thisp || this;
|
|
1243
|
-
for (let walker = this[LRU_LIST].tail; walker !== null; ) {
|
|
1244
|
-
const prev = walker.prev;
|
|
1245
|
-
forEachStep(this, fn, walker, thisp);
|
|
1246
|
-
walker = prev;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
forEach(fn, thisp) {
|
|
1250
|
-
thisp = thisp || this;
|
|
1251
|
-
for (let walker = this[LRU_LIST].head; walker !== null; ) {
|
|
1252
|
-
const next = walker.next;
|
|
1253
|
-
forEachStep(this, fn, walker, thisp);
|
|
1254
|
-
walker = next;
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
keys() {
|
|
1258
|
-
return this[LRU_LIST].toArray().map((k) => k.key);
|
|
1259
|
-
}
|
|
1260
|
-
values() {
|
|
1261
|
-
return this[LRU_LIST].toArray().map((k) => k.value);
|
|
1262
|
-
}
|
|
1263
|
-
reset() {
|
|
1264
|
-
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
1265
|
-
this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
|
|
1266
|
-
}
|
|
1267
|
-
this[CACHE] = /* @__PURE__ */ new Map();
|
|
1268
|
-
this[LRU_LIST] = new Yallist();
|
|
1269
|
-
this[LENGTH] = 0;
|
|
1270
|
-
}
|
|
1271
|
-
dump() {
|
|
1272
|
-
return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
|
|
1273
|
-
k: hit.key,
|
|
1274
|
-
v: hit.value,
|
|
1275
|
-
e: hit.now + (hit.maxAge || 0)
|
|
1276
|
-
}).toArray().filter((h) => h);
|
|
1277
|
-
}
|
|
1278
|
-
dumpLru() {
|
|
1279
|
-
return this[LRU_LIST];
|
|
1280
|
-
}
|
|
1281
|
-
set(key, value, maxAge) {
|
|
1282
|
-
maxAge = maxAge || this[MAX_AGE];
|
|
1283
|
-
if (maxAge && typeof maxAge !== "number")
|
|
1284
|
-
throw new TypeError("maxAge must be a number");
|
|
1285
|
-
const now = maxAge ? Date.now() : 0;
|
|
1286
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
|
1287
|
-
if (this[CACHE].has(key)) {
|
|
1288
|
-
if (len > this[MAX]) {
|
|
1289
|
-
del(this, this[CACHE].get(key));
|
|
1290
|
-
return false;
|
|
1291
|
-
}
|
|
1292
|
-
const node = this[CACHE].get(key);
|
|
1293
|
-
const item = node.value;
|
|
1294
|
-
if (this[DISPOSE]) {
|
|
1295
|
-
if (!this[NO_DISPOSE_ON_SET])
|
|
1296
|
-
this[DISPOSE](key, item.value);
|
|
1297
|
-
}
|
|
1298
|
-
item.now = now;
|
|
1299
|
-
item.maxAge = maxAge;
|
|
1300
|
-
item.value = value;
|
|
1301
|
-
this[LENGTH] += len - item.length;
|
|
1302
|
-
item.length = len;
|
|
1303
|
-
this.get(key);
|
|
1304
|
-
trim(this);
|
|
1305
|
-
return true;
|
|
1306
|
-
}
|
|
1307
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
|
1308
|
-
if (hit.length > this[MAX]) {
|
|
1309
|
-
if (this[DISPOSE])
|
|
1310
|
-
this[DISPOSE](key, value);
|
|
1311
|
-
return false;
|
|
1312
|
-
}
|
|
1313
|
-
this[LENGTH] += hit.length;
|
|
1314
|
-
this[LRU_LIST].unshift(hit);
|
|
1315
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
|
1316
|
-
trim(this);
|
|
1317
|
-
return true;
|
|
1318
|
-
}
|
|
1319
|
-
has(key) {
|
|
1320
|
-
if (!this[CACHE].has(key))
|
|
1321
|
-
return false;
|
|
1322
|
-
const hit = this[CACHE].get(key).value;
|
|
1323
|
-
return !isStale(this, hit);
|
|
778
|
+
constructor() {
|
|
779
|
+
this.max = 1e3;
|
|
780
|
+
this.map = /* @__PURE__ */ new Map();
|
|
1324
781
|
}
|
|
1325
782
|
get(key) {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
if (!node)
|
|
1334
|
-
return null;
|
|
1335
|
-
del(this, node);
|
|
1336
|
-
return node.value;
|
|
1337
|
-
}
|
|
1338
|
-
del(key) {
|
|
1339
|
-
del(this, this[CACHE].get(key));
|
|
1340
|
-
}
|
|
1341
|
-
load(arr) {
|
|
1342
|
-
this.reset();
|
|
1343
|
-
const now = Date.now();
|
|
1344
|
-
for (let l = arr.length - 1; l >= 0; l--) {
|
|
1345
|
-
const hit = arr[l];
|
|
1346
|
-
const expiresAt = hit.e || 0;
|
|
1347
|
-
if (expiresAt === 0)
|
|
1348
|
-
this.set(hit.k, hit.v);
|
|
1349
|
-
else {
|
|
1350
|
-
const maxAge = expiresAt - now;
|
|
1351
|
-
if (maxAge > 0) {
|
|
1352
|
-
this.set(hit.k, hit.v, maxAge);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
783
|
+
const value = this.map.get(key);
|
|
784
|
+
if (value === void 0) {
|
|
785
|
+
return void 0;
|
|
786
|
+
} else {
|
|
787
|
+
this.map.delete(key);
|
|
788
|
+
this.map.set(key, value);
|
|
789
|
+
return value;
|
|
1355
790
|
}
|
|
1356
791
|
}
|
|
1357
|
-
|
|
1358
|
-
this
|
|
792
|
+
delete(key) {
|
|
793
|
+
return this.map.delete(key);
|
|
1359
794
|
}
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
del(self, node);
|
|
1367
|
-
if (!self[ALLOW_STALE])
|
|
1368
|
-
return void 0;
|
|
1369
|
-
} else {
|
|
1370
|
-
if (doUse) {
|
|
1371
|
-
if (self[UPDATE_AGE_ON_GET])
|
|
1372
|
-
node.value.now = Date.now();
|
|
1373
|
-
self[LRU_LIST].unshiftNode(node);
|
|
795
|
+
set(key, value) {
|
|
796
|
+
const deleted = this.delete(key);
|
|
797
|
+
if (!deleted && value !== void 0) {
|
|
798
|
+
if (this.map.size >= this.max) {
|
|
799
|
+
const firstKey = this.map.keys().next().value;
|
|
800
|
+
this.delete(firstKey);
|
|
1374
801
|
}
|
|
802
|
+
this.map.set(key, value);
|
|
1375
803
|
}
|
|
1376
|
-
return
|
|
1377
|
-
}
|
|
1378
|
-
};
|
|
1379
|
-
var isStale = (self, hit) => {
|
|
1380
|
-
if (!hit || !hit.maxAge && !self[MAX_AGE])
|
|
1381
|
-
return false;
|
|
1382
|
-
const diff = Date.now() - hit.now;
|
|
1383
|
-
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
|
|
1384
|
-
};
|
|
1385
|
-
var trim = (self) => {
|
|
1386
|
-
if (self[LENGTH] > self[MAX]) {
|
|
1387
|
-
for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
|
|
1388
|
-
const prev = walker.prev;
|
|
1389
|
-
del(self, walker);
|
|
1390
|
-
walker = prev;
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
var del = (self, node) => {
|
|
1395
|
-
if (node) {
|
|
1396
|
-
const hit = node.value;
|
|
1397
|
-
if (self[DISPOSE])
|
|
1398
|
-
self[DISPOSE](hit.key, hit.value);
|
|
1399
|
-
self[LENGTH] -= hit.length;
|
|
1400
|
-
self[CACHE].delete(hit.key);
|
|
1401
|
-
self[LRU_LIST].removeNode(node);
|
|
1402
|
-
}
|
|
1403
|
-
};
|
|
1404
|
-
var Entry = class {
|
|
1405
|
-
constructor(key, value, length, now, maxAge) {
|
|
1406
|
-
this.key = key;
|
|
1407
|
-
this.value = value;
|
|
1408
|
-
this.length = length;
|
|
1409
|
-
this.now = now;
|
|
1410
|
-
this.maxAge = maxAge || 0;
|
|
804
|
+
return this;
|
|
1411
805
|
}
|
|
1412
806
|
};
|
|
1413
|
-
var forEachStep = (self, fn, node, thisp) => {
|
|
1414
|
-
let hit = node.value;
|
|
1415
|
-
if (isStale(self, hit)) {
|
|
1416
|
-
del(self, node);
|
|
1417
|
-
if (!self[ALLOW_STALE])
|
|
1418
|
-
hit = void 0;
|
|
1419
|
-
}
|
|
1420
|
-
if (hit)
|
|
1421
|
-
fn.call(thisp, hit.value, hit.key, self);
|
|
1422
|
-
};
|
|
1423
807
|
module.exports = LRUCache;
|
|
1424
808
|
}
|
|
1425
809
|
});
|
|
@@ -1549,8 +933,8 @@ var require_range = __commonJS({
|
|
|
1549
933
|
}
|
|
1550
934
|
};
|
|
1551
935
|
module.exports = Range;
|
|
1552
|
-
var LRU =
|
|
1553
|
-
var cache = new LRU(
|
|
936
|
+
var LRU = require_lrucache();
|
|
937
|
+
var cache = new LRU();
|
|
1554
938
|
var parseOptions = require_parse_options();
|
|
1555
939
|
var Comparator = require_comparator();
|
|
1556
940
|
var debug = require_debug();
|
|
@@ -1728,7 +1112,7 @@ var require_range = __commonJS({
|
|
|
1728
1112
|
debug("replaceGTE0", comp, options);
|
|
1729
1113
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1730
1114
|
};
|
|
1731
|
-
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr
|
|
1115
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1732
1116
|
if (isX(fM)) {
|
|
1733
1117
|
from = "";
|
|
1734
1118
|
} else if (isX(fm)) {
|
|
@@ -2208,19 +1592,18 @@ var require_subset = __commonJS({
|
|
|
2208
1592
|
sub = new Range(sub, options);
|
|
2209
1593
|
dom = new Range(dom, options);
|
|
2210
1594
|
let sawNonNull = false;
|
|
2211
|
-
OUTER:
|
|
2212
|
-
for (const
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
continue OUTER;
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
if (sawNonNull) {
|
|
2221
|
-
return false;
|
|
1595
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1596
|
+
for (const simpleDom of dom.set) {
|
|
1597
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1598
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1599
|
+
if (isSub) {
|
|
1600
|
+
continue OUTER;
|
|
2222
1601
|
}
|
|
2223
1602
|
}
|
|
1603
|
+
if (sawNonNull) {
|
|
1604
|
+
return false;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
2224
1607
|
return true;
|
|
2225
1608
|
};
|
|
2226
1609
|
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|