@dpuse/dpuse-development 0.3.500 → 0.3.505
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/dpuse-development.es.js +459 -439
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/types/eslint.config.d.ts +2 -0
- package/eslint.config.ts +72 -4
- package/package.json +22 -21
- package/tsconfig.json +1 -1
- package/vitest.config.ts +2 -2
|
@@ -577,7 +577,7 @@ var Ee = w([
|
|
|
577
577
|
Position: () => ut,
|
|
578
578
|
SourceLocation: () => dt,
|
|
579
579
|
TokContext: () => z,
|
|
580
|
-
Token: () =>
|
|
580
|
+
Token: () => Un,
|
|
581
581
|
TokenType: () => E,
|
|
582
582
|
defaultOptions: () => pt,
|
|
583
583
|
getLineInfo: () => ft,
|
|
@@ -588,12 +588,12 @@ var Ee = w([
|
|
|
588
588
|
lineBreak: () => M,
|
|
589
589
|
lineBreakG: () => Ze,
|
|
590
590
|
nonASCIIwhitespace: () => et,
|
|
591
|
-
parse: () =>
|
|
592
|
-
parseExpressionAt: () =>
|
|
591
|
+
parse: () => Jn,
|
|
592
|
+
parseExpressionAt: () => Yn,
|
|
593
593
|
tokContexts: () => B,
|
|
594
594
|
tokTypes: () => j,
|
|
595
|
-
tokenizer: () =>
|
|
596
|
-
version: () =>
|
|
595
|
+
tokenizer: () => Xn,
|
|
596
|
+
version: () => qn
|
|
597
597
|
}), Re = [
|
|
598
598
|
509,
|
|
599
599
|
0,
|
|
@@ -1756,6 +1756,7 @@ function ft(e, t) {
|
|
|
1756
1756
|
var pt = {
|
|
1757
1757
|
ecmaVersion: null,
|
|
1758
1758
|
sourceType: "script",
|
|
1759
|
+
strict: !1,
|
|
1759
1760
|
onInsertedSemicolon: null,
|
|
1760
1761
|
onTrailingComma: null,
|
|
1761
1762
|
allowReserved: null,
|
|
@@ -1806,7 +1807,7 @@ var At = 0, jt = 1, Mt = 2, Nt = 3, Pt = 4, Ft = 5, P = function(e, t, n) {
|
|
|
1806
1807
|
var r = "";
|
|
1807
1808
|
e.allowReserved !== !0 && (r = He[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = st(r);
|
|
1808
1809
|
var i = (r ? r + " " : "") + He.strict;
|
|
1809
|
-
this.reservedWordsStrict = st(i), this.reservedWordsStrictBind = st(i + " " + He.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(M).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = j.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? vt : _t), this.regexpState = null, this.privateNameStack = [];
|
|
1810
|
+
this.reservedWordsStrict = st(i), this.reservedWordsStrictBind = st(i + " " + He.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(M).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = j.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? vt : _t), this.regexpState = null, this.privateNameStack = [];
|
|
1810
1811
|
}, F = {
|
|
1811
1812
|
inFunction: { configurable: !0 },
|
|
1812
1813
|
inGenerator: { configurable: !0 },
|
|
@@ -1821,8 +1822,10 @@ var At = 0, jt = 1, Mt = 2, Nt = 3, Pt = 4, Ft = 5, P = function(e, t, n) {
|
|
|
1821
1822
|
inClassStaticBlock: { configurable: !0 }
|
|
1822
1823
|
};
|
|
1823
1824
|
P.prototype.parse = function() {
|
|
1824
|
-
var e = this.options.program || this.startNode();
|
|
1825
|
-
return this.nextToken(), this.
|
|
1825
|
+
var e = this, t = this.options.program || this.startNode();
|
|
1826
|
+
return this.nextToken(), this.catchStackOverflow(function() {
|
|
1827
|
+
return e.parseTopLevel(t);
|
|
1828
|
+
});
|
|
1826
1829
|
}, F.inFunction.get = function() {
|
|
1827
1830
|
return (this.currentVarScope().flags & vt) > 0;
|
|
1828
1831
|
}, F.inGenerator.get = function() {
|
|
@@ -1887,6 +1890,13 @@ I.strictDirective = function(e) {
|
|
|
1887
1890
|
return this.type === j.name && this.value === e && !this.containsEsc;
|
|
1888
1891
|
}, I.eatContextual = function(e) {
|
|
1889
1892
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1893
|
+
}, I.catchStackOverflow = function(e) {
|
|
1894
|
+
try {
|
|
1895
|
+
return e();
|
|
1896
|
+
} catch (e) {
|
|
1897
|
+
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
1898
|
+
else throw e;
|
|
1899
|
+
}
|
|
1890
1900
|
}, I.expectContextual = function(e) {
|
|
1891
1901
|
this.eatContextual(e) || this.unexpected();
|
|
1892
1902
|
}, I.canInsertSemicolon = function() {
|
|
@@ -1977,7 +1987,13 @@ L.isLet = function(e) {
|
|
|
1977
1987
|
while (Ye(s = this.fullCharCodeAt(r)));
|
|
1978
1988
|
if (s === 92) return !0;
|
|
1979
1989
|
var l = this.input.slice(c, r);
|
|
1980
|
-
|
|
1990
|
+
if (Ge.test(l)) return !1;
|
|
1991
|
+
if (t && !e && l === "of") {
|
|
1992
|
+
N.lastIndex = r;
|
|
1993
|
+
var u = N.exec(this.input);
|
|
1994
|
+
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1995
|
+
}
|
|
1996
|
+
return !0;
|
|
1981
1997
|
}, L.isAwaitUsing = function(e) {
|
|
1982
1998
|
return this.isUsingKeyword(!0, e);
|
|
1983
1999
|
}, L.isUsing = function(e) {
|
|
@@ -2014,7 +2030,7 @@ L.isLet = function(e) {
|
|
|
2014
2030
|
default:
|
|
2015
2031
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
2016
2032
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
2017
|
-
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
2033
|
+
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
2018
2034
|
var u = this.value, d = this.parseExpression();
|
|
2019
2035
|
return r === j.name && d.type === "Identifier" && this.eat(j.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
2020
2036
|
}
|
|
@@ -2047,7 +2063,7 @@ L.isLet = function(e) {
|
|
|
2047
2063
|
var l = this.containsEsc, u = new Lt(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
2048
2064
|
return this.type === j._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === j._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
2049
2065
|
}, L.parseForAfterInit = function(e, t, n) {
|
|
2050
|
-
return (this.type === j._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.
|
|
2066
|
+
return (this.type === j._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === j._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
2051
2067
|
}, L.parseFunctionStatement = function(e, t, n) {
|
|
2052
2068
|
return this.next(), this.parseFunction(e, Vt | (n ? 0 : Ht), !1, t);
|
|
2053
2069
|
}, L.parseIfStatement = function(e) {
|
|
@@ -2522,13 +2538,16 @@ V.checkPropClash = function(e, t, n) {
|
|
|
2522
2538
|
}, o[a] = !0;
|
|
2523
2539
|
}
|
|
2524
2540
|
}, V.parseExpression = function(e, t) {
|
|
2525
|
-
var n = this
|
|
2526
|
-
|
|
2527
|
-
var a =
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2541
|
+
var n = this;
|
|
2542
|
+
return this.catchStackOverflow(function() {
|
|
2543
|
+
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
2544
|
+
if (n.type === j.comma) {
|
|
2545
|
+
var o = n.startNodeAt(r, i);
|
|
2546
|
+
for (o.expressions = [a]; n.eat(j.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
2547
|
+
return n.finishNode(o, "SequenceExpression");
|
|
2548
|
+
}
|
|
2549
|
+
return a;
|
|
2550
|
+
});
|
|
2532
2551
|
}, V.parseMaybeAssign = function(e, t, n) {
|
|
2533
2552
|
if (this.isContextual("yield")) {
|
|
2534
2553
|
if (this.inGenerator) return this.parseYield(e);
|
|
@@ -2547,7 +2566,7 @@ V.checkPropClash = function(e, t, n) {
|
|
|
2547
2566
|
}, V.parseMaybeConditional = function(e, t) {
|
|
2548
2567
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
2549
2568
|
if (this.checkExpressionErrors(t)) return i;
|
|
2550
|
-
if (this.eat(j.question)) {
|
|
2569
|
+
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(j.question)) {
|
|
2551
2570
|
var a = this.startNodeAt(n, r);
|
|
2552
2571
|
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(j.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
2553
2572
|
}
|
|
@@ -2738,7 +2757,7 @@ V.parseNew = function() {
|
|
|
2738
2757
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2739
2758
|
}
|
|
2740
2759
|
var r = this.start, i = this.startLoc;
|
|
2741
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), this.eat(j.parenL) ? e.arguments = this.parseExprList(j.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = Yt, this.finishNode(e, "NewExpression");
|
|
2760
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(j.parenL) ? e.arguments = this.parseExprList(j.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = Yt, this.finishNode(e, "NewExpression");
|
|
2742
2761
|
}, V.parseTemplateElement = function(e) {
|
|
2743
2762
|
var t = e.isTagged, n = this.startNode();
|
|
2744
2763
|
return this.type === j.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
@@ -2969,15 +2988,15 @@ Cn.prototype.separatedFrom = function(e) {
|
|
|
2969
2988
|
}, Cn.prototype.sibling = function() {
|
|
2970
2989
|
return new Cn(this.parent, this.base);
|
|
2971
2990
|
};
|
|
2972
|
-
var
|
|
2991
|
+
var U = function(e) {
|
|
2973
2992
|
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = vn[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2974
2993
|
};
|
|
2975
|
-
|
|
2994
|
+
U.prototype.reset = function(e, t, n) {
|
|
2976
2995
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2977
2996
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2978
|
-
},
|
|
2997
|
+
}, U.prototype.raise = function(e) {
|
|
2979
2998
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2980
|
-
},
|
|
2999
|
+
}, U.prototype.at = function(e, t) {
|
|
2981
3000
|
t === void 0 && (t = !1);
|
|
2982
3001
|
var n = this.source, r = n.length;
|
|
2983
3002
|
if (e >= r) return -1;
|
|
@@ -2985,21 +3004,21 @@ wn.prototype.reset = function(e, t, n) {
|
|
|
2985
3004
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2986
3005
|
var a = n.charCodeAt(e + 1);
|
|
2987
3006
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2988
|
-
},
|
|
3007
|
+
}, U.prototype.nextIndex = function(e, t) {
|
|
2989
3008
|
t === void 0 && (t = !1);
|
|
2990
3009
|
var n = this.source, r = n.length;
|
|
2991
3010
|
if (e >= r) return r;
|
|
2992
3011
|
var i = n.charCodeAt(e), a;
|
|
2993
3012
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2994
|
-
},
|
|
3013
|
+
}, U.prototype.current = function(e) {
|
|
2995
3014
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2996
|
-
},
|
|
3015
|
+
}, U.prototype.lookahead = function(e) {
|
|
2997
3016
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2998
|
-
},
|
|
3017
|
+
}, U.prototype.advance = function(e) {
|
|
2999
3018
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
3000
|
-
},
|
|
3019
|
+
}, U.prototype.eat = function(e, t) {
|
|
3001
3020
|
return t === void 0 && (t = !1), this.current(t) === e ? (this.advance(t), !0) : !1;
|
|
3002
|
-
},
|
|
3021
|
+
}, U.prototype.eatChars = function(e, t) {
|
|
3003
3022
|
t === void 0 && (t = !1);
|
|
3004
3023
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
3005
3024
|
var a = i[r], o = this.at(n, t);
|
|
@@ -3014,12 +3033,12 @@ wn.prototype.reset = function(e, t, n) {
|
|
|
3014
3033
|
}
|
|
3015
3034
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
3016
3035
|
};
|
|
3017
|
-
function
|
|
3036
|
+
function wn(e) {
|
|
3018
3037
|
for (var t in e) return !0;
|
|
3019
3038
|
return !1;
|
|
3020
3039
|
}
|
|
3021
3040
|
H.validateRegExpPattern = function(e) {
|
|
3022
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
3041
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && wn(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
3023
3042
|
}, H.regexp_pattern = function(e) {
|
|
3024
3043
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
3025
3044
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
@@ -3103,10 +3122,10 @@ H.validateRegExpPattern = function(e) {
|
|
|
3103
3122
|
}
|
|
3104
3123
|
return !1;
|
|
3105
3124
|
}, H.regexp_eatModifiers = function(e) {
|
|
3106
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
3125
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && Tn(n);) t += ct(n), e.advance();
|
|
3107
3126
|
return t;
|
|
3108
3127
|
};
|
|
3109
|
-
function
|
|
3128
|
+
function Tn(e) {
|
|
3110
3129
|
return e === 105 || e === 109 || e === 115;
|
|
3111
3130
|
}
|
|
3112
3131
|
H.regexp_eatExtendedAtom = function(e) {
|
|
@@ -3115,13 +3134,13 @@ H.regexp_eatExtendedAtom = function(e) {
|
|
|
3115
3134
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
3116
3135
|
}, H.regexp_eatSyntaxCharacter = function(e) {
|
|
3117
3136
|
var t = e.current();
|
|
3118
|
-
return
|
|
3137
|
+
return En(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
3119
3138
|
};
|
|
3120
|
-
function
|
|
3139
|
+
function En(e) {
|
|
3121
3140
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
3122
3141
|
}
|
|
3123
3142
|
H.regexp_eatPatternCharacters = function(e) {
|
|
3124
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
3143
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !En(n);) e.advance();
|
|
3125
3144
|
return e.pos !== t;
|
|
3126
3145
|
}, H.regexp_eatExtendedPatternCharacter = function(e) {
|
|
3127
3146
|
var t = e.current();
|
|
@@ -3148,16 +3167,16 @@ H.regexp_eatPatternCharacters = function(e) {
|
|
|
3148
3167
|
return !1;
|
|
3149
3168
|
}, H.regexp_eatRegExpIdentifierStart = function(e) {
|
|
3150
3169
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
3151
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
3170
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Dn(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
3152
3171
|
};
|
|
3153
|
-
function
|
|
3172
|
+
function Dn(e) {
|
|
3154
3173
|
return T(e, !0) || e === 36 || e === 95;
|
|
3155
3174
|
}
|
|
3156
3175
|
H.regexp_eatRegExpIdentifierPart = function(e) {
|
|
3157
3176
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
3158
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
3177
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), On(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
3159
3178
|
};
|
|
3160
|
-
function
|
|
3179
|
+
function On(e) {
|
|
3161
3180
|
return Ye(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
3162
3181
|
}
|
|
3163
3182
|
H.regexp_eatAtomEscape = function(e) {
|
|
@@ -3187,15 +3206,15 @@ H.regexp_eatAtomEscape = function(e) {
|
|
|
3187
3206
|
}
|
|
3188
3207
|
return !1;
|
|
3189
3208
|
}, H.regexp_eatZero = function(e) {
|
|
3190
|
-
return e.current() === 48 && !
|
|
3209
|
+
return e.current() === 48 && !zn(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
3191
3210
|
}, H.regexp_eatControlEscape = function(e) {
|
|
3192
3211
|
var t = e.current();
|
|
3193
3212
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 ? (e.lastIntValue = 13, e.advance(), !0) : !1;
|
|
3194
3213
|
}, H.regexp_eatControlLetter = function(e) {
|
|
3195
3214
|
var t = e.current();
|
|
3196
|
-
return
|
|
3215
|
+
return kn(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
3197
3216
|
};
|
|
3198
|
-
function
|
|
3217
|
+
function kn(e) {
|
|
3199
3218
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
3200
3219
|
}
|
|
3201
3220
|
H.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
@@ -3214,12 +3233,12 @@ H.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
3214
3233
|
}
|
|
3215
3234
|
return !0;
|
|
3216
3235
|
}
|
|
3217
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
3236
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && An(e.lastIntValue)) return !0;
|
|
3218
3237
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
3219
3238
|
}
|
|
3220
3239
|
return !1;
|
|
3221
3240
|
};
|
|
3222
|
-
function
|
|
3241
|
+
function An(e) {
|
|
3223
3242
|
return e >= 0 && e <= 1114111;
|
|
3224
3243
|
}
|
|
3225
3244
|
H.regexp_eatIdentityEscape = function(e) {
|
|
@@ -3237,20 +3256,20 @@ H.regexp_eatIdentityEscape = function(e) {
|
|
|
3237
3256
|
}
|
|
3238
3257
|
return !1;
|
|
3239
3258
|
};
|
|
3240
|
-
var
|
|
3259
|
+
var jn = 0, Mn = 1, W = 2;
|
|
3241
3260
|
H.regexp_eatCharacterClassEscape = function(e) {
|
|
3242
3261
|
var t = e.current();
|
|
3243
|
-
if (
|
|
3262
|
+
if (Nn(t)) return e.lastIntValue = -1, e.advance(), Mn;
|
|
3244
3263
|
var n = !1;
|
|
3245
3264
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
3246
3265
|
e.lastIntValue = -1, e.advance();
|
|
3247
3266
|
var r;
|
|
3248
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
3267
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === W && e.raise("Invalid property name"), r;
|
|
3249
3268
|
e.raise("Invalid property name");
|
|
3250
3269
|
}
|
|
3251
|
-
return
|
|
3270
|
+
return jn;
|
|
3252
3271
|
};
|
|
3253
|
-
function
|
|
3272
|
+
function Nn(e) {
|
|
3254
3273
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
3255
3274
|
}
|
|
3256
3275
|
H.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
@@ -3259,46 +3278,46 @@ H.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
3259
3278
|
var n = e.lastStringValue;
|
|
3260
3279
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
3261
3280
|
var r = e.lastStringValue;
|
|
3262
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
3281
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), Mn;
|
|
3263
3282
|
}
|
|
3264
3283
|
}
|
|
3265
3284
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
3266
3285
|
var i = e.lastStringValue;
|
|
3267
3286
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
3268
3287
|
}
|
|
3269
|
-
return
|
|
3288
|
+
return jn;
|
|
3270
3289
|
}, H.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
3271
3290
|
it(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
3272
3291
|
}, H.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
3273
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
3274
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
3292
|
+
if (e.unicodeProperties.binary.test(t)) return Mn;
|
|
3293
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return W;
|
|
3275
3294
|
e.raise("Invalid property name");
|
|
3276
3295
|
}, H.regexp_eatUnicodePropertyName = function(e) {
|
|
3277
3296
|
var t = 0;
|
|
3278
|
-
for (e.lastStringValue = "";
|
|
3297
|
+
for (e.lastStringValue = ""; Pn(t = e.current());) e.lastStringValue += ct(t), e.advance();
|
|
3279
3298
|
return e.lastStringValue !== "";
|
|
3280
3299
|
};
|
|
3281
|
-
function
|
|
3282
|
-
return
|
|
3300
|
+
function Pn(e) {
|
|
3301
|
+
return kn(e) || e === 95;
|
|
3283
3302
|
}
|
|
3284
3303
|
H.regexp_eatUnicodePropertyValue = function(e) {
|
|
3285
3304
|
var t = 0;
|
|
3286
|
-
for (e.lastStringValue = "";
|
|
3305
|
+
for (e.lastStringValue = ""; Fn(t = e.current());) e.lastStringValue += ct(t), e.advance();
|
|
3287
3306
|
return e.lastStringValue !== "";
|
|
3288
3307
|
};
|
|
3289
|
-
function
|
|
3290
|
-
return
|
|
3308
|
+
function Fn(e) {
|
|
3309
|
+
return Pn(e) || zn(e);
|
|
3291
3310
|
}
|
|
3292
3311
|
H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
3293
3312
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
3294
3313
|
}, H.regexp_eatCharacterClass = function(e) {
|
|
3295
3314
|
if (e.eat(91)) {
|
|
3296
3315
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
3297
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
3316
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === W && e.raise("Negated character class may contain strings"), !0;
|
|
3298
3317
|
}
|
|
3299
3318
|
return !1;
|
|
3300
3319
|
}, H.regexp_classContents = function(e) {
|
|
3301
|
-
return e.current() === 93 ?
|
|
3320
|
+
return e.current() === 93 ? Mn : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), Mn);
|
|
3302
3321
|
}, H.regexp_nonEmptyClassRanges = function(e) {
|
|
3303
3322
|
for (; this.regexp_eatClassAtom(e);) {
|
|
3304
3323
|
var t = e.lastIntValue;
|
|
@@ -3313,7 +3332,7 @@ H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3313
3332
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
3314
3333
|
if (e.switchU) {
|
|
3315
3334
|
var n = e.current();
|
|
3316
|
-
(n === 99 ||
|
|
3335
|
+
(n === 99 || Hn(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
3317
3336
|
}
|
|
3318
3337
|
e.pos = t;
|
|
3319
3338
|
}
|
|
@@ -3329,12 +3348,12 @@ H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3329
3348
|
}
|
|
3330
3349
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
3331
3350
|
}, H.regexp_classSetExpression = function(e) {
|
|
3332
|
-
var t =
|
|
3351
|
+
var t = Mn, n;
|
|
3333
3352
|
if (!this.regexp_eatClassSetRange(e)) if (n = this.regexp_eatClassSetOperand(e)) {
|
|
3334
|
-
n ===
|
|
3353
|
+
n === W && (t = W);
|
|
3335
3354
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
3336
3355
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
3337
|
-
n !==
|
|
3356
|
+
n !== W && (t = Mn);
|
|
3338
3357
|
continue;
|
|
3339
3358
|
}
|
|
3340
3359
|
e.raise("Invalid character in character class");
|
|
@@ -3345,7 +3364,7 @@ H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3345
3364
|
} else e.raise("Invalid character in character class");
|
|
3346
3365
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
3347
3366
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
3348
|
-
n ===
|
|
3367
|
+
n === W && (t = W);
|
|
3349
3368
|
}
|
|
3350
3369
|
}, H.regexp_eatClassSetRange = function(e) {
|
|
3351
3370
|
var t = e.pos;
|
|
@@ -3359,12 +3378,12 @@ H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3359
3378
|
}
|
|
3360
3379
|
return !1;
|
|
3361
3380
|
}, H.regexp_eatClassSetOperand = function(e) {
|
|
3362
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
3381
|
+
return this.regexp_eatClassSetCharacter(e) ? Mn : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
3363
3382
|
}, H.regexp_eatNestedClass = function(e) {
|
|
3364
3383
|
var t = e.pos;
|
|
3365
3384
|
if (e.eat(91)) {
|
|
3366
3385
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
3367
|
-
if (e.eat(93)) return n && r ===
|
|
3386
|
+
if (e.eat(93)) return n && r === W && e.raise("Negated character class may contain strings"), r;
|
|
3368
3387
|
e.pos = t;
|
|
3369
3388
|
}
|
|
3370
3389
|
if (e.eat(92)) {
|
|
@@ -3384,33 +3403,33 @@ H.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
3384
3403
|
}
|
|
3385
3404
|
return null;
|
|
3386
3405
|
}, H.regexp_classStringDisjunctionContents = function(e) {
|
|
3387
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
3406
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === W && (t = W);
|
|
3388
3407
|
return t;
|
|
3389
3408
|
}, H.regexp_classString = function(e) {
|
|
3390
3409
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
3391
|
-
return t === 1 ?
|
|
3410
|
+
return t === 1 ? Mn : W;
|
|
3392
3411
|
}, H.regexp_eatClassSetCharacter = function(e) {
|
|
3393
3412
|
var t = e.pos;
|
|
3394
3413
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
3395
3414
|
var n = e.current();
|
|
3396
|
-
return n < 0 || n === e.lookahead() &&
|
|
3415
|
+
return n < 0 || n === e.lookahead() && In(n) || Ln(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
3397
3416
|
};
|
|
3398
|
-
function
|
|
3417
|
+
function In(e) {
|
|
3399
3418
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
3400
3419
|
}
|
|
3401
|
-
function
|
|
3420
|
+
function Ln(e) {
|
|
3402
3421
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
3403
3422
|
}
|
|
3404
3423
|
H.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
3405
3424
|
var t = e.current();
|
|
3406
|
-
return
|
|
3425
|
+
return Rn(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
3407
3426
|
};
|
|
3408
|
-
function
|
|
3427
|
+
function Rn(e) {
|
|
3409
3428
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
3410
3429
|
}
|
|
3411
3430
|
H.regexp_eatClassControlLetter = function(e) {
|
|
3412
3431
|
var t = e.current();
|
|
3413
|
-
return
|
|
3432
|
+
return zn(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
3414
3433
|
}, H.regexp_eatHexEscapeSequence = function(e) {
|
|
3415
3434
|
var t = e.pos;
|
|
3416
3435
|
if (e.eat(120)) {
|
|
@@ -3420,21 +3439,21 @@ H.regexp_eatClassControlLetter = function(e) {
|
|
|
3420
3439
|
return !1;
|
|
3421
3440
|
}, H.regexp_eatDecimalDigits = function(e) {
|
|
3422
3441
|
var t = e.pos, n = 0;
|
|
3423
|
-
for (e.lastIntValue = 0;
|
|
3442
|
+
for (e.lastIntValue = 0; zn(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
3424
3443
|
return e.pos !== t;
|
|
3425
3444
|
};
|
|
3426
|
-
function
|
|
3445
|
+
function zn(e) {
|
|
3427
3446
|
return e >= 48 && e <= 57;
|
|
3428
3447
|
}
|
|
3429
3448
|
H.regexp_eatHexDigits = function(e) {
|
|
3430
3449
|
var t = e.pos, n = 0;
|
|
3431
|
-
for (e.lastIntValue = 0;
|
|
3450
|
+
for (e.lastIntValue = 0; Bn(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Vn(n), e.advance();
|
|
3432
3451
|
return e.pos !== t;
|
|
3433
3452
|
};
|
|
3434
|
-
function
|
|
3453
|
+
function Bn(e) {
|
|
3435
3454
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
3436
3455
|
}
|
|
3437
|
-
function
|
|
3456
|
+
function Vn(e) {
|
|
3438
3457
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
3439
3458
|
}
|
|
3440
3459
|
H.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
@@ -3449,9 +3468,9 @@ H.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
3449
3468
|
return !1;
|
|
3450
3469
|
}, H.regexp_eatOctalDigit = function(e) {
|
|
3451
3470
|
var t = e.current();
|
|
3452
|
-
return
|
|
3471
|
+
return Hn(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
3453
3472
|
};
|
|
3454
|
-
function
|
|
3473
|
+
function Hn(e) {
|
|
3455
3474
|
return e >= 48 && e <= 55;
|
|
3456
3475
|
}
|
|
3457
3476
|
H.regexp_eatFixedHexDigits = function(e, t) {
|
|
@@ -3459,19 +3478,19 @@ H.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
3459
3478
|
e.lastIntValue = 0;
|
|
3460
3479
|
for (var r = 0; r < t; ++r) {
|
|
3461
3480
|
var i = e.current();
|
|
3462
|
-
if (!
|
|
3463
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
3481
|
+
if (!Bn(i)) return e.pos = n, !1;
|
|
3482
|
+
e.lastIntValue = 16 * e.lastIntValue + Vn(i), e.advance();
|
|
3464
3483
|
}
|
|
3465
3484
|
return !0;
|
|
3466
3485
|
};
|
|
3467
|
-
var
|
|
3486
|
+
var Un = function(e) {
|
|
3468
3487
|
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new dt(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
3469
|
-
},
|
|
3470
|
-
|
|
3471
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
3472
|
-
},
|
|
3473
|
-
return this.next(), new
|
|
3474
|
-
}, typeof Symbol < "u" && (
|
|
3488
|
+
}, G = P.prototype;
|
|
3489
|
+
G.next = function(e) {
|
|
3490
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Un(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
3491
|
+
}, G.getToken = function() {
|
|
3492
|
+
return this.next(), new Un(this);
|
|
3493
|
+
}, typeof Symbol < "u" && (G[Symbol.iterator] = function() {
|
|
3475
3494
|
var e = this;
|
|
3476
3495
|
return { next: function() {
|
|
3477
3496
|
var t = e.getToken();
|
|
@@ -3480,28 +3499,28 @@ W.next = function(e) {
|
|
|
3480
3499
|
value: t
|
|
3481
3500
|
};
|
|
3482
3501
|
} };
|
|
3483
|
-
}),
|
|
3502
|
+
}), G.nextToken = function() {
|
|
3484
3503
|
var e = this.curContext();
|
|
3485
3504
|
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(j.eof);
|
|
3486
3505
|
if (e.override) return e.override(this);
|
|
3487
3506
|
this.readToken(this.fullCharCodeAtPos());
|
|
3488
|
-
},
|
|
3507
|
+
}, G.readToken = function(e) {
|
|
3489
3508
|
return T(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
3490
|
-
},
|
|
3509
|
+
}, G.fullCharCodeAt = function(e) {
|
|
3491
3510
|
var t = this.input.charCodeAt(e);
|
|
3492
3511
|
if (t <= 55295 || t >= 56320) return t;
|
|
3493
3512
|
var n = this.input.charCodeAt(e + 1);
|
|
3494
3513
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
3495
|
-
},
|
|
3514
|
+
}, G.fullCharCodeAtPos = function() {
|
|
3496
3515
|
return this.fullCharCodeAt(this.pos);
|
|
3497
|
-
},
|
|
3516
|
+
}, G.skipBlockComment = function() {
|
|
3498
3517
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
3499
3518
|
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = $e(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
3500
3519
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
3501
|
-
},
|
|
3520
|
+
}, G.skipLineComment = function(e) {
|
|
3502
3521
|
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !Qe(r);) r = this.input.charCodeAt(++this.pos);
|
|
3503
3522
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
3504
|
-
},
|
|
3523
|
+
}, G.skipSpace = function() {
|
|
3505
3524
|
loop: for (; this.pos < this.input.length;) {
|
|
3506
3525
|
var e = this.input.charCodeAt(this.pos);
|
|
3507
3526
|
switch (e) {
|
|
@@ -3530,36 +3549,36 @@ W.next = function(e) {
|
|
|
3530
3549
|
else break loop;
|
|
3531
3550
|
}
|
|
3532
3551
|
}
|
|
3533
|
-
},
|
|
3552
|
+
}, G.finishToken = function(e, t) {
|
|
3534
3553
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
3535
3554
|
var n = this.type;
|
|
3536
3555
|
this.type = e, this.value = t, this.updateContext(n);
|
|
3537
|
-
},
|
|
3556
|
+
}, G.readToken_dot = function() {
|
|
3538
3557
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3539
3558
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
3540
3559
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
3541
3560
|
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(j.ellipsis)) : (++this.pos, this.finishToken(j.dot));
|
|
3542
|
-
},
|
|
3561
|
+
}, G.readToken_slash = function() {
|
|
3543
3562
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3544
3563
|
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(j.assign, 2) : this.finishOp(j.slash, 1);
|
|
3545
|
-
},
|
|
3564
|
+
}, G.readToken_mult_modulo_exp = function(e) {
|
|
3546
3565
|
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? j.star : j.modulo;
|
|
3547
3566
|
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = j.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(j.assign, n + 1) : this.finishOp(r, n);
|
|
3548
|
-
},
|
|
3567
|
+
}, G.readToken_pipe_amp = function(e) {
|
|
3549
3568
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3550
3569
|
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(j.assign, 3) : this.finishOp(e === 124 ? j.logicalOR : j.logicalAND, 2) : t === 61 ? this.finishOp(j.assign, 2) : this.finishOp(e === 124 ? j.bitwiseOR : j.bitwiseAND, 1);
|
|
3551
|
-
},
|
|
3570
|
+
}, G.readToken_caret = function() {
|
|
3552
3571
|
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(j.assign, 2) : this.finishOp(j.bitwiseXOR, 1);
|
|
3553
|
-
},
|
|
3572
|
+
}, G.readToken_plus_min = function(e) {
|
|
3554
3573
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3555
3574
|
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || M.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(j.incDec, 2) : t === 61 ? this.finishOp(j.assign, 2) : this.finishOp(j.plusMin, 1);
|
|
3556
|
-
},
|
|
3575
|
+
}, G.readToken_lt_gt = function(e) {
|
|
3557
3576
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
3558
3577
|
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(j.assign, n + 1) : this.finishOp(j.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(j.relational, n));
|
|
3559
|
-
},
|
|
3578
|
+
}, G.readToken_eq_excl = function(e) {
|
|
3560
3579
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3561
3580
|
return t === 61 ? this.finishOp(j.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(j.arrow)) : this.finishOp(e === 61 ? j.eq : j.prefix, 1);
|
|
3562
|
-
},
|
|
3581
|
+
}, G.readToken_question = function() {
|
|
3563
3582
|
var e = this.options.ecmaVersion;
|
|
3564
3583
|
if (e >= 11) {
|
|
3565
3584
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
@@ -3570,11 +3589,11 @@ W.next = function(e) {
|
|
|
3570
3589
|
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(j.assign, 3) : this.finishOp(j.coalesce, 2);
|
|
3571
3590
|
}
|
|
3572
3591
|
return this.finishOp(j.question, 1);
|
|
3573
|
-
},
|
|
3592
|
+
}, G.readToken_numberSign = function() {
|
|
3574
3593
|
var e = this.options.ecmaVersion, t = 35;
|
|
3575
3594
|
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), T(t, !0) || t === 92)) return this.finishToken(j.privateId, this.readWord1());
|
|
3576
3595
|
this.raise(this.pos, "Unexpected character '" + ct(t) + "'");
|
|
3577
|
-
},
|
|
3596
|
+
}, G.getTokenFromCode = function(e) {
|
|
3578
3597
|
switch (e) {
|
|
3579
3598
|
case 46: return this.readToken_dot();
|
|
3580
3599
|
case 40: return ++this.pos, this.finishToken(j.parenL);
|
|
@@ -3624,10 +3643,10 @@ W.next = function(e) {
|
|
|
3624
3643
|
case 35: return this.readToken_numberSign();
|
|
3625
3644
|
}
|
|
3626
3645
|
this.raise(this.pos, "Unexpected character '" + ct(e) + "'");
|
|
3627
|
-
},
|
|
3646
|
+
}, G.finishOp = function(e, t) {
|
|
3628
3647
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3629
3648
|
return this.pos += t, this.finishToken(e, n);
|
|
3630
|
-
},
|
|
3649
|
+
}, G.readRegexp = function() {
|
|
3631
3650
|
for (var e, t, n = this.pos;;) {
|
|
3632
3651
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3633
3652
|
var r = this.input.charAt(this.pos);
|
|
@@ -3644,7 +3663,7 @@ W.next = function(e) {
|
|
|
3644
3663
|
++this.pos;
|
|
3645
3664
|
var a = this.pos, o = this.readWord1();
|
|
3646
3665
|
this.containsEsc && this.unexpected(a);
|
|
3647
|
-
var s = this.regexpState ||= new
|
|
3666
|
+
var s = this.regexpState ||= new U(this);
|
|
3648
3667
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3649
3668
|
var c = null;
|
|
3650
3669
|
try {
|
|
@@ -3655,7 +3674,7 @@ W.next = function(e) {
|
|
|
3655
3674
|
flags: o,
|
|
3656
3675
|
value: c
|
|
3657
3676
|
});
|
|
3658
|
-
},
|
|
3677
|
+
}, G.readInt = function(e, t, n) {
|
|
3659
3678
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3660
3679
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3661
3680
|
if (r && u === 95) {
|
|
@@ -3667,31 +3686,31 @@ W.next = function(e) {
|
|
|
3667
3686
|
}
|
|
3668
3687
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3669
3688
|
};
|
|
3670
|
-
function
|
|
3689
|
+
function Wn(e, t) {
|
|
3671
3690
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3672
3691
|
}
|
|
3673
|
-
function
|
|
3692
|
+
function Gn(e) {
|
|
3674
3693
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3675
3694
|
}
|
|
3676
|
-
|
|
3695
|
+
G.readRadixNumber = function(e) {
|
|
3677
3696
|
var t = this.pos;
|
|
3678
3697
|
this.pos += 2;
|
|
3679
3698
|
var n = this.readInt(e);
|
|
3680
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
3681
|
-
},
|
|
3699
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Gn(this.input.slice(t, this.pos)), ++this.pos) : T(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(j.num, n);
|
|
3700
|
+
}, G.readNumber = function(e) {
|
|
3682
3701
|
var t = this.pos;
|
|
3683
3702
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3684
3703
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
3685
3704
|
n && this.strict && this.raise(t, "Invalid number");
|
|
3686
3705
|
var r = this.input.charCodeAt(this.pos);
|
|
3687
3706
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3688
|
-
var i =
|
|
3707
|
+
var i = Gn(this.input.slice(t, this.pos));
|
|
3689
3708
|
return ++this.pos, T(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(j.num, i);
|
|
3690
3709
|
}
|
|
3691
3710
|
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), T(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3692
|
-
var a =
|
|
3711
|
+
var a = Wn(this.input.slice(t, this.pos), n);
|
|
3693
3712
|
return this.finishToken(j.num, a);
|
|
3694
|
-
},
|
|
3713
|
+
}, G.readCodePoint = function() {
|
|
3695
3714
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3696
3715
|
if (e === 123) {
|
|
3697
3716
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -3699,7 +3718,7 @@ W.readRadixNumber = function(e) {
|
|
|
3699
3718
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3700
3719
|
} else t = this.readHexChar(4);
|
|
3701
3720
|
return t;
|
|
3702
|
-
},
|
|
3721
|
+
}, G.readString = function(e) {
|
|
3703
3722
|
for (var t = "", n = ++this.pos;;) {
|
|
3704
3723
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3705
3724
|
var r = this.input.charCodeAt(this.pos);
|
|
@@ -3708,20 +3727,20 @@ W.readRadixNumber = function(e) {
|
|
|
3708
3727
|
}
|
|
3709
3728
|
return t += this.input.slice(n, this.pos++), this.finishToken(j.string, t);
|
|
3710
3729
|
};
|
|
3711
|
-
var
|
|
3712
|
-
|
|
3730
|
+
var Kn = {};
|
|
3731
|
+
G.tryReadTemplateToken = function() {
|
|
3713
3732
|
this.inTemplateElement = !0;
|
|
3714
3733
|
try {
|
|
3715
3734
|
this.readTmplToken();
|
|
3716
3735
|
} catch (e) {
|
|
3717
|
-
if (e ===
|
|
3736
|
+
if (e === Kn) this.readInvalidTemplateToken();
|
|
3718
3737
|
else throw e;
|
|
3719
3738
|
}
|
|
3720
3739
|
this.inTemplateElement = !1;
|
|
3721
|
-
},
|
|
3722
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3740
|
+
}, G.invalidStringToken = function(e, t) {
|
|
3741
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Kn;
|
|
3723
3742
|
this.raise(e, t);
|
|
3724
|
-
},
|
|
3743
|
+
}, G.readTmplToken = function() {
|
|
3725
3744
|
for (var e = "", t = this.pos;;) {
|
|
3726
3745
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3727
3746
|
var n = this.input.charCodeAt(this.pos);
|
|
@@ -3740,7 +3759,7 @@ W.tryReadTemplateToken = function() {
|
|
|
3740
3759
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3741
3760
|
} else ++this.pos;
|
|
3742
3761
|
}
|
|
3743
|
-
},
|
|
3762
|
+
}, G.readInvalidTemplateToken = function() {
|
|
3744
3763
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3745
3764
|
case "\\":
|
|
3746
3765
|
++this.pos;
|
|
@@ -3755,7 +3774,7 @@ W.tryReadTemplateToken = function() {
|
|
|
3755
3774
|
break;
|
|
3756
3775
|
}
|
|
3757
3776
|
this.raise(this.start, "Unterminated template");
|
|
3758
|
-
},
|
|
3777
|
+
}, G.readEscapedChar = function(e) {
|
|
3759
3778
|
var t = this.input.charCodeAt(++this.pos);
|
|
3760
3779
|
switch (++this.pos, t) {
|
|
3761
3780
|
case 110: return "\n";
|
|
@@ -3780,10 +3799,10 @@ W.tryReadTemplateToken = function() {
|
|
|
3780
3799
|
}
|
|
3781
3800
|
return Qe(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3782
3801
|
}
|
|
3783
|
-
},
|
|
3802
|
+
}, G.readHexChar = function(e) {
|
|
3784
3803
|
var t = this.pos, n = this.readInt(16, e);
|
|
3785
3804
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3786
|
-
},
|
|
3805
|
+
}, G.readWord1 = function() {
|
|
3787
3806
|
this.containsEsc = !1;
|
|
3788
3807
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3789
3808
|
var i = this.fullCharCodeAtPos();
|
|
@@ -3798,14 +3817,14 @@ W.tryReadTemplateToken = function() {
|
|
|
3798
3817
|
t = !1;
|
|
3799
3818
|
}
|
|
3800
3819
|
return e + this.input.slice(n, this.pos);
|
|
3801
|
-
},
|
|
3820
|
+
}, G.readWord = function() {
|
|
3802
3821
|
var e = this.readWord1(), t = j.name;
|
|
3803
3822
|
return this.keywords.test(e) && (t = Xe[e]), this.finishToken(t, e);
|
|
3804
3823
|
};
|
|
3805
|
-
var
|
|
3824
|
+
var qn = "8.17.0";
|
|
3806
3825
|
P.acorn = {
|
|
3807
3826
|
Parser: P,
|
|
3808
|
-
version:
|
|
3827
|
+
version: qn,
|
|
3809
3828
|
defaultOptions: pt,
|
|
3810
3829
|
Position: ut,
|
|
3811
3830
|
SourceLocation: dt,
|
|
@@ -3818,24 +3837,24 @@ P.acorn = {
|
|
|
3818
3837
|
tokContexts: B,
|
|
3819
3838
|
isIdentifierChar: Ye,
|
|
3820
3839
|
isIdentifierStart: T,
|
|
3821
|
-
Token:
|
|
3840
|
+
Token: Un,
|
|
3822
3841
|
isNewLine: Qe,
|
|
3823
3842
|
lineBreak: M,
|
|
3824
3843
|
lineBreakG: Ze,
|
|
3825
3844
|
nonASCIIwhitespace: et
|
|
3826
3845
|
};
|
|
3827
|
-
function
|
|
3846
|
+
function Jn(e, t) {
|
|
3828
3847
|
return P.parse(e, t);
|
|
3829
3848
|
}
|
|
3830
|
-
function
|
|
3849
|
+
function Yn(e, t, n) {
|
|
3831
3850
|
return P.parseExpressionAt(e, t, n);
|
|
3832
3851
|
}
|
|
3833
|
-
function
|
|
3852
|
+
function Xn(e, t) {
|
|
3834
3853
|
return P.tokenizer(e, t);
|
|
3835
3854
|
}
|
|
3836
3855
|
//#endregion
|
|
3837
3856
|
//#region node_modules/acorn-typescript/lib/index.mjs
|
|
3838
|
-
function
|
|
3857
|
+
function Zn(e, t) {
|
|
3839
3858
|
for (var n = 0; n < t.length; n++) {
|
|
3840
3859
|
var r = t[n];
|
|
3841
3860
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (i = function(e, t) {
|
|
@@ -3851,36 +3870,36 @@ function Qn(e, t) {
|
|
|
3851
3870
|
}
|
|
3852
3871
|
var i;
|
|
3853
3872
|
}
|
|
3854
|
-
function
|
|
3855
|
-
return
|
|
3873
|
+
function Qn() {
|
|
3874
|
+
return Qn = Object.assign ? Object.assign.bind() : function(e) {
|
|
3856
3875
|
for (var t = 1; t < arguments.length; t++) {
|
|
3857
3876
|
var n = arguments[t];
|
|
3858
3877
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
3859
3878
|
}
|
|
3860
3879
|
return e;
|
|
3861
|
-
},
|
|
3880
|
+
}, Qn.apply(this, arguments);
|
|
3862
3881
|
}
|
|
3863
|
-
function
|
|
3864
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e,
|
|
3882
|
+
function $n(e, t) {
|
|
3883
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, er(e, t);
|
|
3865
3884
|
}
|
|
3866
|
-
function
|
|
3867
|
-
return
|
|
3885
|
+
function er(e, t) {
|
|
3886
|
+
return er = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
3868
3887
|
return e.__proto__ = t, e;
|
|
3869
|
-
},
|
|
3888
|
+
}, er(e, t);
|
|
3870
3889
|
}
|
|
3871
|
-
function
|
|
3890
|
+
function tr(e, t) {
|
|
3872
3891
|
(t == null || t > e.length) && (t = e.length);
|
|
3873
3892
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
3874
3893
|
return r;
|
|
3875
3894
|
}
|
|
3876
|
-
function
|
|
3895
|
+
function nr(e, t) {
|
|
3877
3896
|
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
3878
3897
|
if (n) return (n = n.call(e)).next.bind(n);
|
|
3879
3898
|
if (Array.isArray(e) || (n = function(e, t) {
|
|
3880
3899
|
if (e) {
|
|
3881
|
-
if (typeof e == "string") return
|
|
3900
|
+
if (typeof e == "string") return tr(e, t);
|
|
3882
3901
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
3883
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
3902
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? tr(e, t) : void 0;
|
|
3884
3903
|
}
|
|
3885
3904
|
}(e)) || t && e && typeof e.length == "number") {
|
|
3886
3905
|
n && (e = n);
|
|
@@ -3894,28 +3913,28 @@ function rr(e, t) {
|
|
|
3894
3913
|
}
|
|
3895
3914
|
throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3896
3915
|
}
|
|
3897
|
-
var
|
|
3898
|
-
function
|
|
3916
|
+
var K = !0;
|
|
3917
|
+
function q(e, t) {
|
|
3899
3918
|
return t === void 0 && (t = {}), new E("name", t);
|
|
3900
3919
|
}
|
|
3901
|
-
var
|
|
3902
|
-
function
|
|
3903
|
-
var t =
|
|
3920
|
+
var rr = /* @__PURE__ */ new WeakMap();
|
|
3921
|
+
function ir(e) {
|
|
3922
|
+
var t = rr.get(e.Parser.acorn || e);
|
|
3904
3923
|
if (!t) {
|
|
3905
3924
|
var n = {
|
|
3906
|
-
assert:
|
|
3907
|
-
asserts:
|
|
3908
|
-
global:
|
|
3909
|
-
keyof:
|
|
3910
|
-
readonly:
|
|
3911
|
-
unique:
|
|
3912
|
-
abstract:
|
|
3913
|
-
declare:
|
|
3914
|
-
enum:
|
|
3915
|
-
module:
|
|
3916
|
-
namespace:
|
|
3917
|
-
interface:
|
|
3918
|
-
type:
|
|
3925
|
+
assert: q(0, { startsExpr: K }),
|
|
3926
|
+
asserts: q(0, { startsExpr: K }),
|
|
3927
|
+
global: q(0, { startsExpr: K }),
|
|
3928
|
+
keyof: q(0, { startsExpr: K }),
|
|
3929
|
+
readonly: q(0, { startsExpr: K }),
|
|
3930
|
+
unique: q(0, { startsExpr: K }),
|
|
3931
|
+
abstract: q(0, { startsExpr: K }),
|
|
3932
|
+
declare: q(0, { startsExpr: K }),
|
|
3933
|
+
enum: q(0, { startsExpr: K }),
|
|
3934
|
+
module: q(0, { startsExpr: K }),
|
|
3935
|
+
namespace: q(0, { startsExpr: K }),
|
|
3936
|
+
interface: q(0, { startsExpr: K }),
|
|
3937
|
+
type: q(0, { startsExpr: K })
|
|
3919
3938
|
}, r = {
|
|
3920
3939
|
at: new E("@"),
|
|
3921
3940
|
jsxName: new E("jsxName"),
|
|
@@ -3933,8 +3952,8 @@ function ar(e) {
|
|
|
3933
3952
|
var t = this.context.pop();
|
|
3934
3953
|
t === i.tc_oTag && e === j.slash || t === i.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === i.tc_expr) : this.exprAllowed = !0;
|
|
3935
3954
|
}, t = {
|
|
3936
|
-
tokTypes:
|
|
3937
|
-
tokContexts:
|
|
3955
|
+
tokTypes: Qn({}, n, r),
|
|
3956
|
+
tokContexts: Qn({}, i),
|
|
3938
3957
|
keywordsRegExp: a,
|
|
3939
3958
|
tokenIsLiteralPropertyName: function(e) {
|
|
3940
3959
|
return [
|
|
@@ -3974,18 +3993,18 @@ function ar(e) {
|
|
|
3974
3993
|
}
|
|
3975
3994
|
return t;
|
|
3976
3995
|
}
|
|
3977
|
-
var
|
|
3996
|
+
var ar = 1024, or = RegExp("(?=(" + (/* @__PURE__ */ RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*", "y")).source + "))\\1(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)", "y"), sr = function() {
|
|
3978
3997
|
this.shorthandAssign = void 0, this.trailingComma = void 0, this.parenthesizedAssign = void 0, this.parenthesizedBind = void 0, this.doubleProto = void 0, this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3979
3998
|
};
|
|
3980
|
-
function
|
|
3999
|
+
function cr(e, t) {
|
|
3981
4000
|
var n = t.key.name, r = e[n], i = "true";
|
|
3982
4001
|
return t.type !== "MethodDefinition" || t.kind !== "get" && t.kind !== "set" || (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : !!r || (e[n] = i, !1);
|
|
3983
4002
|
}
|
|
3984
|
-
function
|
|
4003
|
+
function lr(e, t) {
|
|
3985
4004
|
var n = e.key;
|
|
3986
4005
|
return !e.computed && (n.type === "Identifier" && n.name === t || n.type === "Literal" && n.value === t);
|
|
3987
4006
|
}
|
|
3988
|
-
var
|
|
4007
|
+
var J = {
|
|
3989
4008
|
AbstractMethodHasImplementation: function(e) {
|
|
3990
4009
|
return "Method '" + e.methodName + "' cannot have an implementation because it is marked abstract.";
|
|
3991
4010
|
},
|
|
@@ -4086,7 +4105,7 @@ var q = {
|
|
|
4086
4105
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + e.type + ".";
|
|
4087
4106
|
},
|
|
4088
4107
|
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations."
|
|
4089
|
-
},
|
|
4108
|
+
}, ur = {
|
|
4090
4109
|
quot: "\"",
|
|
4091
4110
|
amp: "&",
|
|
4092
4111
|
apos: "'",
|
|
@@ -4340,38 +4359,38 @@ var q = {
|
|
|
4340
4359
|
clubs: "♣",
|
|
4341
4360
|
hearts: "♥",
|
|
4342
4361
|
diams: "♦"
|
|
4343
|
-
},
|
|
4344
|
-
function
|
|
4345
|
-
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ?
|
|
4362
|
+
}, dr = /^[\da-fA-F]+$/, fr = /^\d+$/;
|
|
4363
|
+
function pr(e) {
|
|
4364
|
+
return e && (e.type === "JSXIdentifier" ? e.name : e.type === "JSXNamespacedName" ? e.namespace.name + ":" + e.name.name : e.type === "JSXMemberExpression" ? pr(e.object) + "." + pr(e.property) : void 0);
|
|
4346
4365
|
}
|
|
4347
|
-
var
|
|
4348
|
-
function
|
|
4366
|
+
var mr = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
4367
|
+
function hr(e) {
|
|
4349
4368
|
if (!e) throw Error("Assert fail");
|
|
4350
4369
|
}
|
|
4351
|
-
function
|
|
4370
|
+
function gr(e) {
|
|
4352
4371
|
return e === "accessor";
|
|
4353
4372
|
}
|
|
4354
|
-
function
|
|
4373
|
+
function _r(e) {
|
|
4355
4374
|
return e === "in" || e === "out";
|
|
4356
4375
|
}
|
|
4357
|
-
function
|
|
4376
|
+
function vr(e, t) {
|
|
4358
4377
|
return 2 | (e ? 4 : 0) | (t ? 8 : 0);
|
|
4359
4378
|
}
|
|
4360
|
-
function
|
|
4379
|
+
function yr(e) {
|
|
4361
4380
|
if (e.type !== "MemberExpression") return !1;
|
|
4362
4381
|
var t = e.property;
|
|
4363
|
-
return (!e.computed || !(t.type !== "TemplateLiteral" || t.expressions.length > 0)) &&
|
|
4382
|
+
return (!e.computed || !(t.type !== "TemplateLiteral" || t.expressions.length > 0)) && br(e.object);
|
|
4364
4383
|
}
|
|
4365
|
-
function
|
|
4366
|
-
return e.type === "Identifier" || e.type === "MemberExpression" && !e.computed &&
|
|
4384
|
+
function br(e) {
|
|
4385
|
+
return e.type === "Identifier" || e.type === "MemberExpression" && !e.computed && br(e.object);
|
|
4367
4386
|
}
|
|
4368
|
-
function
|
|
4387
|
+
function xr(e) {
|
|
4369
4388
|
return e === "private" || e === "public" || e === "protected";
|
|
4370
4389
|
}
|
|
4371
|
-
function
|
|
4390
|
+
function Sr(e) {
|
|
4372
4391
|
var t = e || {}, n = t.dts, r = n !== void 0 && n, i = t.allowSatisfies, a = i !== void 0 && i;
|
|
4373
4392
|
return function(t) {
|
|
4374
|
-
var n = t.acorn || Le, i =
|
|
4393
|
+
var n = t.acorn || Le, i = ir(n), o = n.tokTypes, s = n.keywordTypes, c = n.isIdentifierStart, l = n.lineBreak, u = n.isNewLine, d = n.tokContexts, f = n.isIdentifierChar, p = i.tokTypes, m = i.tokContexts, h = i.keywordsRegExp, g = i.tokenIsLiteralPropertyName, ee = i.tokenIsTemplate, _ = i.tokenIsTSDeclarationStart, v = i.tokenIsIdentifier, te = i.tokenIsKeywordOrIdentifier, ne = i.tokenIsTSTypeOperator;
|
|
4375
4394
|
function re(e, t, n) {
|
|
4376
4395
|
n === void 0 && (n = e.length);
|
|
4377
4396
|
for (var r = t; r < n; r++) {
|
|
@@ -4386,7 +4405,7 @@ function Cr(e) {
|
|
|
4386
4405
|
function t() {
|
|
4387
4406
|
return e.apply(this, arguments) || this;
|
|
4388
4407
|
}
|
|
4389
|
-
|
|
4408
|
+
$n(t, e);
|
|
4390
4409
|
var n = t.prototype;
|
|
4391
4410
|
return n.takeDecorators = function(e) {
|
|
4392
4411
|
var t = this.decoratorStack[this.decoratorStack.length - 1];
|
|
@@ -4429,7 +4448,7 @@ function Cr(e) {
|
|
|
4429
4448
|
function t() {
|
|
4430
4449
|
return e.apply(this, arguments) || this;
|
|
4431
4450
|
}
|
|
4432
|
-
|
|
4451
|
+
$n(t, e);
|
|
4433
4452
|
var n = t.prototype;
|
|
4434
4453
|
return n.jsx_readToken = function() {
|
|
4435
4454
|
for (var e = "", t = this.pos;;) {
|
|
@@ -4462,7 +4481,7 @@ function Cr(e) {
|
|
|
4462
4481
|
r !== "&" && this.raise(this.pos, "Entity must start with an ampersand");
|
|
4463
4482
|
for (var i = ++this.pos; this.pos < this.input.length && n++ < 10;) {
|
|
4464
4483
|
if ((r = this.input[this.pos++]) === ";") {
|
|
4465
|
-
t[0] === "#" ? t[1] === "x" ? (t = t.substr(2),
|
|
4484
|
+
t[0] === "#" ? t[1] === "x" ? (t = t.substr(2), dr.test(t) && (e = String.fromCharCode(parseInt(t, 16)))) : (t = t.substr(1), fr.test(t) && (e = String.fromCharCode(parseInt(t, 10)))) : e = ur[t];
|
|
4466
4485
|
break;
|
|
4467
4486
|
}
|
|
4468
4487
|
t += r;
|
|
@@ -4536,7 +4555,7 @@ function Cr(e) {
|
|
|
4536
4555
|
break;
|
|
4537
4556
|
default: this.unexpected();
|
|
4538
4557
|
}
|
|
4539
|
-
|
|
4558
|
+
pr(s.name) !== pr(o.name) && this.raise(s.start, "Expected corresponding JSX closing tag for <" + pr(o.name) + ">");
|
|
4540
4559
|
}
|
|
4541
4560
|
var c = o.name ? "Element" : "Fragment";
|
|
4542
4561
|
return n["opening" + c] = o, n["closing" + c] = s, n.children = r, this.type === i.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(n, "JSX" + c);
|
|
@@ -4554,7 +4573,7 @@ function Cr(e) {
|
|
|
4554
4573
|
function t() {
|
|
4555
4574
|
return e.apply(this, arguments) || this;
|
|
4556
4575
|
}
|
|
4557
|
-
|
|
4576
|
+
$n(t, e);
|
|
4558
4577
|
var n = t.prototype;
|
|
4559
4578
|
return n.parseMaybeImportAttributes = function(e) {
|
|
4560
4579
|
if (this.type === i._with || this.type === r.assert) {
|
|
@@ -4585,10 +4604,10 @@ function Cr(e) {
|
|
|
4585
4604
|
}(i), {
|
|
4586
4605
|
allowedModifiers: ["const"],
|
|
4587
4606
|
disallowedModifiers: ["in", "out"],
|
|
4588
|
-
errorTemplate:
|
|
4607
|
+
errorTemplate: J.InvalidModifierOnTypeParameterPositions
|
|
4589
4608
|
}), i;
|
|
4590
4609
|
}
|
|
4591
|
-
|
|
4610
|
+
$n(t, e);
|
|
4592
4611
|
var ie, y, ae, b = t.prototype;
|
|
4593
4612
|
return b.getTokenFromCodeInType = function(t) {
|
|
4594
4613
|
return t === 62 || t === 60 ? this.finishOp(o.relational, 1) : e.prototype.getTokenFromCode.call(this, t);
|
|
@@ -4656,14 +4675,14 @@ function Cr(e) {
|
|
|
4656
4675
|
return this.nextTokenStartSince(this.pos);
|
|
4657
4676
|
}, b.tsHasSomeModifiers = function(e, t) {
|
|
4658
4677
|
return t.some(function(t) {
|
|
4659
|
-
return
|
|
4678
|
+
return xr(t) ? e.accessibility === t : !!e[t];
|
|
4660
4679
|
});
|
|
4661
4680
|
}, b.tsIsStartOfStaticBlocks = function() {
|
|
4662
4681
|
return this.isContextual("static") && this.lookaheadCharCode() === 123;
|
|
4663
4682
|
}, b.tsCheckForInvalidTypeCasts = function(e) {
|
|
4664
4683
|
var t = this;
|
|
4665
4684
|
e.forEach(function(e) {
|
|
4666
|
-
e?.type === "TSTypeCastExpression" && t.raise(e.typeAnnotation.start,
|
|
4685
|
+
e?.type === "TSTypeCastExpression" && t.raise(e.typeAnnotation.start, J.UnexpectedTypeAnnotation);
|
|
4667
4686
|
});
|
|
4668
4687
|
}, b.atPossibleAsyncArrow = function(e) {
|
|
4669
4688
|
return e.type === "Identifier" && e.name === "async" && this.lastTokEndLoc.column === e.end && !this.canInsertSemicolon() && e.end - e.start == 5 && e.start === this.potentialArrowAt;
|
|
@@ -4704,7 +4723,7 @@ function Cr(e) {
|
|
|
4704
4723
|
}, b.isAbstractConstructorSignature = function() {
|
|
4705
4724
|
return this.ts_isContextual(p.abstract) && this.lookahead().type === o._new;
|
|
4706
4725
|
}, b.nextTokenStartSince = function(e) {
|
|
4707
|
-
return
|
|
4726
|
+
return mr.lastIndex = e, mr.test(this.input) ? mr.lastIndex : e;
|
|
4708
4727
|
}, b.lookaheadCharCode = function() {
|
|
4709
4728
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
4710
4729
|
}, b.compareLookaheadState = function(e, t) {
|
|
@@ -4788,7 +4807,7 @@ function Cr(e) {
|
|
|
4788
4807
|
}, b.isLineTerminator = function() {
|
|
4789
4808
|
return this.eat(o.semi) || e.prototype.canInsertSemicolon.call(this);
|
|
4790
4809
|
}, b.hasFollowingLineBreak = function() {
|
|
4791
|
-
return
|
|
4810
|
+
return or.lastIndex = this.end, or.test(this.input);
|
|
4792
4811
|
}, b.addExtra = function(e, t, n, r) {
|
|
4793
4812
|
if (r === void 0 && (r = !0), e) {
|
|
4794
4813
|
var i = e.extra = e.extra || {};
|
|
@@ -4880,7 +4899,7 @@ function Cr(e) {
|
|
|
4880
4899
|
}
|
|
4881
4900
|
return this.next(), e.prototype.exitScope.call(this), this.finishNode(t, "TSModuleBlock");
|
|
4882
4901
|
}, b.tsParseAmbientExternalModuleDeclaration = function(t) {
|
|
4883
|
-
return this.ts_isContextual(p.global) ? (t.global = !0, t.id = this.parseIdent()) : this.match(o.string) ? t.id = this.parseLiteral(this.value) : this.unexpected(), this.match(o.braceL) ? (e.prototype.enterScope.call(this,
|
|
4902
|
+
return this.ts_isContextual(p.global) ? (t.global = !0, t.id = this.parseIdent()) : this.match(o.string) ? t.id = this.parseLiteral(this.value) : this.unexpected(), this.match(o.braceL) ? (e.prototype.enterScope.call(this, ar), t.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this)) : e.prototype.semicolon.call(this), this.finishNode(t, "TSModuleDeclaration");
|
|
4884
4903
|
}, b.tsTryParseDeclare = function(e) {
|
|
4885
4904
|
var t = this;
|
|
4886
4905
|
if (!this.isLineTerminator()) {
|
|
@@ -4981,7 +5000,7 @@ function Cr(e) {
|
|
|
4981
5000
|
}, b.tsParseBindingListForSignature = function() {
|
|
4982
5001
|
var t = this;
|
|
4983
5002
|
return e.prototype.parseBindingList.call(this, o.parenR, !0, !0).map(function(e) {
|
|
4984
|
-
return e.type !== "Identifier" && e.type !== "RestElement" && e.type !== "ObjectPattern" && e.type !== "ArrayPattern" && t.raise(e.start,
|
|
5003
|
+
return e.type !== "Identifier" && e.type !== "RestElement" && e.type !== "ObjectPattern" && e.type !== "ArrayPattern" && t.raise(e.start, J.UnsupportedSignatureParameterKind(e.type)), e;
|
|
4985
5004
|
});
|
|
4986
5005
|
}, b.tsParseTypePredicateAsserts = function() {
|
|
4987
5006
|
if (this.type !== p.asserts) return !1;
|
|
@@ -5027,7 +5046,7 @@ function Cr(e) {
|
|
|
5027
5046
|
if (this.lookahead().type !== o._const) return null;
|
|
5028
5047
|
this.next();
|
|
5029
5048
|
var e = this.tsParseTypeReference();
|
|
5030
|
-
return e.typeParameters && this.raise(e.typeName.start,
|
|
5049
|
+
return e.typeParameters && this.raise(e.typeName.start, J.CannotFindName({ name: "const" })), e;
|
|
5031
5050
|
}, b.tsParseFunctionOrConstructorType = function(e, t) {
|
|
5032
5051
|
var n = this, r = this.startNode();
|
|
5033
5052
|
return e === "TSConstructorType" && (r.abstract = !!t, t && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
@@ -5043,7 +5062,7 @@ function Cr(e) {
|
|
|
5043
5062
|
switch (e.typeAnnotation.type) {
|
|
5044
5063
|
case "TSTupleType":
|
|
5045
5064
|
case "TSArrayType": return;
|
|
5046
|
-
default: this.raise(e.start,
|
|
5065
|
+
default: this.raise(e.start, J.UnexpectedReadonly);
|
|
5047
5066
|
}
|
|
5048
5067
|
}, b.tsParseTypeOperator = function() {
|
|
5049
5068
|
var e = this.startNode(), t = this.value;
|
|
@@ -5076,7 +5095,7 @@ function Cr(e) {
|
|
|
5076
5095
|
}(), this.finishNode(t, "TSLiteralType");
|
|
5077
5096
|
}, b.tsParseImportType = function() {
|
|
5078
5097
|
var e = this.startNode();
|
|
5079
|
-
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start,
|
|
5098
|
+
return this.expect(o._import), this.expect(o.parenL), this.match(o.string) || this.raise(this.start, J.UnsupportedImportTypeArgument), e.argument = this.parseExprAtom(), this.expect(o.parenR), this.eat(o.dot) && (e.qualifier = this.tsParseEntityName()), this.tsMatchLeftRelational() && (e.typeParameters = this.tsParseTypeArguments()), this.finishNode(e, "TSImportType");
|
|
5080
5099
|
}, b.tsParseTypeQuery = function() {
|
|
5081
5100
|
var e = this.startNode();
|
|
5082
5101
|
return this.expect(o._typeof), e.exprName = this.match(o._import) ? this.tsParseImportType() : this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.tsMatchLeftRelational() && (e.typeParameters = this.tsParseTypeArguments()), this.finishNode(e, "TSTypeQuery");
|
|
@@ -5093,7 +5112,7 @@ function Cr(e) {
|
|
|
5093
5112
|
var e = this.startLoc, t = this.start, n = this.eat(o.ellipsis), r = this.tsParseType(), i = this.eat(o.question);
|
|
5094
5113
|
if (this.eat(o.colon)) {
|
|
5095
5114
|
var a = this.startNodeAtNode(r);
|
|
5096
|
-
a.optional = i, r.type !== "TSTypeReference" || r.typeParameters || r.typeName.type !== "Identifier" ? (this.raise(r.start,
|
|
5115
|
+
a.optional = i, r.type !== "TSTypeReference" || r.typeParameters || r.typeName.type !== "Identifier" ? (this.raise(r.start, J.InvalidTupleMemberLabel), a.label = r) : a.label = r.typeName, a.elementType = this.tsParseType(), r = this.finishNode(a, "TSNamedTupleMember");
|
|
5097
5116
|
} else if (i) {
|
|
5098
5117
|
var s = this.startNodeAtNode(r);
|
|
5099
5118
|
s.typeAnnotation = r, r = this.finishNode(s, "TSOptionalType");
|
|
@@ -5109,11 +5128,11 @@ function Cr(e) {
|
|
|
5109
5128
|
var n = !1, r = null;
|
|
5110
5129
|
return t.elementTypes.forEach(function(t) {
|
|
5111
5130
|
var i = t.type;
|
|
5112
|
-
!n || i === "TSRestType" || i === "TSOptionalType" || i === "TSNamedTupleMember" && t.optional || e.raise(t.start,
|
|
5131
|
+
!n || i === "TSRestType" || i === "TSOptionalType" || i === "TSNamedTupleMember" && t.optional || e.raise(t.start, J.OptionalTypeBeforeRequired), n ||= i === "TSNamedTupleMember" && t.optional || i === "TSOptionalType";
|
|
5113
5132
|
var a = i;
|
|
5114
5133
|
i === "TSRestType" && (a = (t = t.typeAnnotation).type);
|
|
5115
5134
|
var o = a === "TSNamedTupleMember";
|
|
5116
|
-
r ??= o, r !== o && e.raise(t.start,
|
|
5135
|
+
r ??= o, r !== o && e.raise(t.start, J.MixedLabeledAndUnlabeledElements);
|
|
5117
5136
|
}), this.finishNode(t, "TSTupleType");
|
|
5118
5137
|
}, b.tsParseTemplateLiteralType = function() {
|
|
5119
5138
|
var e = this.startNode();
|
|
@@ -5196,7 +5215,7 @@ function Cr(e) {
|
|
|
5196
5215
|
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(o._new) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
5197
5216
|
}, b.tsParseType = function() {
|
|
5198
5217
|
var e = this;
|
|
5199
|
-
|
|
5218
|
+
hr(this.inType);
|
|
5200
5219
|
var t = this.tsParseNonConditionalType();
|
|
5201
5220
|
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(o._extends)) return t;
|
|
5202
5221
|
var n = this.startNodeAtNode(t);
|
|
@@ -5230,7 +5249,7 @@ function Cr(e) {
|
|
|
5230
5249
|
modified: e,
|
|
5231
5250
|
allowedModifiers: [],
|
|
5232
5251
|
disallowedModifiers: ["in", "out"],
|
|
5233
|
-
errorTemplate:
|
|
5252
|
+
errorTemplate: J.InvalidModifierOnTypeParameterPositions
|
|
5234
5253
|
});
|
|
5235
5254
|
}, b.tsParseTypeParameter = function(e) {
|
|
5236
5255
|
e === void 0 && (e = this.tsParseNoneModifiers.bind(this));
|
|
@@ -5240,7 +5259,7 @@ function Cr(e) {
|
|
|
5240
5259
|
var t = this.startNode();
|
|
5241
5260
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
5242
5261
|
var n = { value: -1 };
|
|
5243
|
-
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(this.start,
|
|
5262
|
+
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(this.start, J.EmptyTypeParameters), n.value !== -1 && this.addExtra(t, "trailingComma", n.value), this.finishNode(t, "TSTypeParameterDeclaration");
|
|
5244
5263
|
}, b.tsTryParseTypeParameters = function(e) {
|
|
5245
5264
|
if (this.tsMatchLeftRelational()) return this.tsParseTypeParameters(e);
|
|
5246
5265
|
}, b.tsTryParse = function(e) {
|
|
@@ -5264,14 +5283,14 @@ function Cr(e) {
|
|
|
5264
5283
|
t[a] = n[a];
|
|
5265
5284
|
}
|
|
5266
5285
|
}, b.tsParseModifiers = function(e) {
|
|
5267
|
-
for (var t = this, n = e.modified, r = e.allowedModifiers, i = e.disallowedModifiers, a = e.stopOnStartOfClassStaticBlock, o = e.errorTemplate, s = o === void 0 ?
|
|
5268
|
-
r === i && n[a] && t.raise(e.column,
|
|
5286
|
+
for (var t = this, n = e.modified, r = e.allowedModifiers, i = e.disallowedModifiers, a = e.stopOnStartOfClassStaticBlock, o = e.errorTemplate, s = o === void 0 ? J.InvalidModifierOnTypeMember : o, c = {}, l = function(e, r, i, a) {
|
|
5287
|
+
r === i && n[a] && t.raise(e.column, J.InvalidModifiersOrder({ orderedModifiers: [i, a] }));
|
|
5269
5288
|
}, u = function(e, r, i, a) {
|
|
5270
|
-
(n[i] && r === a || n[a] && r === i) && t.raise(e.column,
|
|
5289
|
+
(n[i] && r === a || n[a] && r === i) && t.raise(e.column, J.IncompatibleModifiers({ modifiers: [i, a] }));
|
|
5271
5290
|
};;) {
|
|
5272
5291
|
var d = this.startLoc, f = this.tsParseModifier(r.concat(i ?? []), a);
|
|
5273
5292
|
if (!f) break;
|
|
5274
|
-
|
|
5293
|
+
xr(f) ? n.accessibility ? this.raise(this.start, J.DuplicateAccessibilityModifier()) : (l(d, f, f, "override"), l(d, f, f, "static"), l(d, f, f, "readonly"), l(d, f, f, "accessor"), c.accessibility = f, n.accessibility = f) : _r(f) ? n[f] ? this.raise(this.start, J.DuplicateModifier({ modifier: f })) : (l(d, f, "in", "out"), c[f] = f, n[f] = !0) : gr(f) ? n[f] ? this.raise(this.start, J.DuplicateModifier({ modifier: f })) : (u(d, f, "accessor", "readonly"), u(d, f, "accessor", "static"), u(d, f, "accessor", "override"), c[f] = f, n[f] = !0) : Object.hasOwnProperty.call(n, f) ? this.raise(this.start, J.DuplicateModifier({ modifier: f })) : (l(d, f, "static", "readonly"), l(d, f, "static", "override"), l(d, f, "override", "readonly"), l(d, f, "abstract", "override"), u(d, f, "declare", "override"), u(d, f, "static", "abstract"), c[f] = f, n[f] = !0), i != null && i.includes(f) && this.raise(this.start, s);
|
|
5275
5294
|
}
|
|
5276
5295
|
return c;
|
|
5277
5296
|
}, b.tsParseInOutModifiers = function(e) {
|
|
@@ -5287,7 +5306,7 @@ function Cr(e) {
|
|
|
5287
5306
|
"abstract",
|
|
5288
5307
|
"override"
|
|
5289
5308
|
],
|
|
5290
|
-
errorTemplate:
|
|
5309
|
+
errorTemplate: J.InvalidModifierOnTypeParameter
|
|
5291
5310
|
});
|
|
5292
5311
|
}, b.tsParseTypeArguments = function() {
|
|
5293
5312
|
var e = this, t = this.startNode();
|
|
@@ -5295,13 +5314,13 @@ function Cr(e) {
|
|
|
5295
5314
|
return e.tsInNoContext(function() {
|
|
5296
5315
|
return e.expect(o.relational), e.tsParseDelimitedList("TypeParametersOrArguments", e.tsParseType.bind(e));
|
|
5297
5316
|
});
|
|
5298
|
-
}), t.params.length === 0 && this.raise(this.start,
|
|
5317
|
+
}), t.params.length === 0 && this.raise(this.start, J.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(t, "TSTypeParameterInstantiation");
|
|
5299
5318
|
}, b.tsParseHeritageClause = function(e) {
|
|
5300
5319
|
var t = this, n = this.start, r = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
5301
5320
|
var e = t.startNode();
|
|
5302
5321
|
return e.expression = t.tsParseEntityName(), t.tsMatchLeftRelational() && (e.typeParameters = t.tsParseTypeArguments()), t.finishNode(e, "TSExpressionWithTypeArguments");
|
|
5303
5322
|
});
|
|
5304
|
-
return r.length || this.raise(n,
|
|
5323
|
+
return r.length || this.raise(n, J.EmptyHeritageClauseType({ token: e })), r;
|
|
5305
5324
|
}, b.tsParseTypeMemberSemicolon = function() {
|
|
5306
5325
|
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
5307
5326
|
}, b.tsTryParseAndCatch = function(e) {
|
|
@@ -5315,18 +5334,18 @@ function Cr(e) {
|
|
|
5315
5334
|
this.eat(o.question) && (e.optional = !0);
|
|
5316
5335
|
var n = e;
|
|
5317
5336
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
5318
|
-
t && this.raise(e.start,
|
|
5337
|
+
t && this.raise(e.start, J.ReadonlyForMethodSignature);
|
|
5319
5338
|
var r = n;
|
|
5320
|
-
r.kind && this.tsMatchLeftRelational() && this.raise(this.start,
|
|
5339
|
+
r.kind && this.tsMatchLeftRelational() && this.raise(this.start, J.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, r), this.tsParseTypeMemberSemicolon();
|
|
5321
5340
|
var i = "parameters", a = "typeAnnotation";
|
|
5322
|
-
if (r.kind === "get") r[i].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(r[i][0]) && this.raise(this.start,
|
|
5341
|
+
if (r.kind === "get") r[i].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(r[i][0]) && this.raise(this.start, J.AccesorCannotDeclareThisParameter));
|
|
5323
5342
|
else if (r.kind === "set") {
|
|
5324
5343
|
if (r[i].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
5325
5344
|
else {
|
|
5326
5345
|
var s = r[i][0];
|
|
5327
|
-
this.isThisParam(s) && this.raise(this.start,
|
|
5346
|
+
this.isThisParam(s) && this.raise(this.start, J.AccesorCannotDeclareThisParameter), s.type === "Identifier" && s.optional && this.raise(this.start, J.SetAccesorCannotHaveOptionalParameter), s.type === "RestElement" && this.raise(this.start, J.SetAccesorCannotHaveRestParameter);
|
|
5328
5347
|
}
|
|
5329
|
-
r[a] && this.raise(r[a].start,
|
|
5348
|
+
r[a] && this.raise(r[a].start, J.SetAccesorCannotHaveReturnType);
|
|
5330
5349
|
} else r.kind = "method";
|
|
5331
5350
|
return this.finishNode(r, "TSMethodSignature");
|
|
5332
5351
|
}
|
|
@@ -5363,7 +5382,7 @@ function Cr(e) {
|
|
|
5363
5382
|
return this.expect(o.braceR), e;
|
|
5364
5383
|
}, b.tsParseInterfaceDeclaration = function(e, t) {
|
|
5365
5384
|
if (t === void 0 && (t = {}), this.hasFollowingLineBreak()) return null;
|
|
5366
|
-
this.expectContextual("interface"), t.declare && (e.declare = !0), v(this.type) ? (e.id = this.parseIdent(), this.checkLValSimple(e.id, 7)) : (e.id = null, this.raise(this.start,
|
|
5385
|
+
this.expectContextual("interface"), t.declare && (e.declare = !0), v(this.type) ? (e.id = this.parseIdent(), this.checkLValSimple(e.id, 7)) : (e.id = null, this.raise(this.start, J.MissingInterfaceName)), e.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (e.extends = this.tsParseHeritageClause("extends"));
|
|
5367
5386
|
var n = this.startNode();
|
|
5368
5387
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), e.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(e, "TSInterfaceDeclaration");
|
|
5369
5388
|
}, b.tsParseAbstractDeclaration = function(e) {
|
|
@@ -5381,7 +5400,7 @@ function Cr(e) {
|
|
|
5381
5400
|
break;
|
|
5382
5401
|
case "global":
|
|
5383
5402
|
if (this.match(o.braceL)) {
|
|
5384
|
-
e.prototype.enterScope.call(this,
|
|
5403
|
+
e.prototype.enterScope.call(this, ar);
|
|
5385
5404
|
var i = t;
|
|
5386
5405
|
return i.global = !0, i.id = n, i.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this), this.finishNode(i, "TSModuleDeclaration");
|
|
5387
5406
|
}
|
|
@@ -5420,7 +5439,7 @@ function Cr(e) {
|
|
|
5420
5439
|
if (n === void 0 && (n = !1), t.id = this.parseIdent(), n || this.checkLValSimple(t.id, 8), this.eat(o.dot)) {
|
|
5421
5440
|
var r = this.startNode();
|
|
5422
5441
|
this.tsParseModuleOrNamespaceDeclaration(r, !0), t.body = r;
|
|
5423
|
-
} else e.prototype.enterScope.call(this,
|
|
5442
|
+
} else e.prototype.enterScope.call(this, ar), t.body = this.tsParseModuleBlock(), e.prototype.exitScope.call(this);
|
|
5424
5443
|
return this.finishNode(t, "TSModuleDeclaration");
|
|
5425
5444
|
}, b.checkLValSimple = function(t, n, r) {
|
|
5426
5445
|
return n === void 0 && (n = 0), e.prototype.checkLValSimple.call(this, t, n, r);
|
|
@@ -5454,7 +5473,7 @@ function Cr(e) {
|
|
|
5454
5473
|
}, b.tsParseImportEqualsDeclaration = function(t, n) {
|
|
5455
5474
|
t.isExport = n || !1, t.id = this.parseIdent(), this.checkLValSimple(t.id, 2), e.prototype.expect.call(this, o.eq);
|
|
5456
5475
|
var r = this.tsParseModuleReference();
|
|
5457
|
-
return t.importKind === "type" && r.type !== "TSExternalModuleReference" && this.raise(r.start,
|
|
5476
|
+
return t.importKind === "type" && r.type !== "TSExternalModuleReference" && this.raise(r.start, J.ImportAliasHasImportType), t.moduleReference = r, e.prototype.semicolon.call(this), this.finishNode(t, "TSImportEqualsDeclaration");
|
|
5458
5477
|
}, b.isExportDefaultSpecifier = function() {
|
|
5459
5478
|
if (this.tsIsDeclarationStart()) return !1;
|
|
5460
5479
|
var e = this.type;
|
|
@@ -5481,13 +5500,13 @@ function Cr(e) {
|
|
|
5481
5500
|
}, b.parseFunction = function(e, t, n, r, i) {
|
|
5482
5501
|
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === o.star && 2 & t && this.unexpected(), e.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), 1 & t && (e.id = 4 & t && this.type !== o.name ? null : this.parseIdent());
|
|
5483
5502
|
var a = this.yieldPos, s = this.awaitPos, c = this.awaitIdentPos, l = this.maybeInArrowParameters;
|
|
5484
|
-
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
5503
|
+
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(vr(e.async, e.generator)), 1 & t || (e.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(e);
|
|
5485
5504
|
var u = 1 & t;
|
|
5486
5505
|
return this.parseFunctionBody(e, n, !1, i, { isFunctionDeclaration: u }), this.yieldPos = a, this.awaitPos = s, this.awaitIdentPos = c, 1 & t && e.id && !(2 & t) && this.checkLValSimple(e.id, e.body ? this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = l, this.finishNode(e, u ? "FunctionDeclaration" : "FunctionExpression");
|
|
5487
5506
|
}, b.parseFunctionBody = function(t, n, r, i, a) {
|
|
5488
5507
|
n === void 0 && (n = !1), r === void 0 && (r = !1), i === void 0 && (i = !1), this.match(o.colon) && (t.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
5489
5508
|
var s = a != null && a.isFunctionDeclaration ? "TSDeclareFunction" : a != null && a.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
5490
|
-
return s && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(t, s) : s === "TSDeclareFunction" && this.isAmbientContext && (this.raise(t.start,
|
|
5509
|
+
return s && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(t, s) : s === "TSDeclareFunction" && this.isAmbientContext && (this.raise(t.start, J.DeclareFunctionHasImplementation), t.declare) ? (e.prototype.parseFunctionBody.call(this, t, n, r, !1), this.finishNode(t, s)) : (e.prototype.parseFunctionBody.call(this, t, n, r, i), t);
|
|
5491
5510
|
}, b.parseNew = function() {
|
|
5492
5511
|
var e;
|
|
5493
5512
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
@@ -5528,7 +5547,7 @@ function Cr(e) {
|
|
|
5528
5547
|
return this.importOrExportOuterKind = "value", r;
|
|
5529
5548
|
}
|
|
5530
5549
|
}
|
|
5531
|
-
return this.next(), this.type === o.string ? (e.specifiers = [], e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(e), this.semicolon(), this.finishNode(e, "ImportDeclaration"), this.importOrExportOuterKind = "value", e.importKind === "type" && e.specifiers.length > 1 && e.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(e.start,
|
|
5550
|
+
return this.next(), this.type === o.string ? (e.specifiers = [], e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(e), this.semicolon(), this.finishNode(e, "ImportDeclaration"), this.importOrExportOuterKind = "value", e.importKind === "type" && e.specifiers.length > 1 && e.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(e.start, J.TypeImportCannotSpecifyDefaultAndNamed), e;
|
|
5532
5551
|
}, b.parseExportDefaultDeclaration = function() {
|
|
5533
5552
|
if (this.isAbstractClass()) {
|
|
5534
5553
|
var t = this.startNode();
|
|
@@ -5568,7 +5587,7 @@ function Cr(e) {
|
|
|
5568
5587
|
else {
|
|
5569
5588
|
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== o.string && this.unexpected(), e.source = this.parseExprAtom(), this.parseMaybeImportAttributes(e);
|
|
5570
5589
|
else {
|
|
5571
|
-
for (var s, c =
|
|
5590
|
+
for (var s, c = nr(e.specifiers); !(s = c()).done;) {
|
|
5572
5591
|
var l = s.value;
|
|
5573
5592
|
this.checkUnreserved(l.local), this.checkLocalExport(l.local), l.local.type === "Literal" && this.raise(l.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
5574
5593
|
}
|
|
@@ -5581,7 +5600,7 @@ function Cr(e) {
|
|
|
5581
5600
|
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), e[t] = !0);
|
|
5582
5601
|
}, b.parseMaybeDefault = function(t, n, r) {
|
|
5583
5602
|
var i = e.prototype.parseMaybeDefault.call(this, t, n, r);
|
|
5584
|
-
return i.type === "AssignmentPattern" && i.typeAnnotation && i.right.start < i.typeAnnotation.start && this.raise(i.typeAnnotation.start,
|
|
5603
|
+
return i.type === "AssignmentPattern" && i.typeAnnotation && i.right.start < i.typeAnnotation.start && this.raise(i.typeAnnotation.start, J.TypeAnnotationAfterAssign), i;
|
|
5585
5604
|
}, b.typeCastToParameter = function(e) {
|
|
5586
5605
|
return e.expression.typeAnnotation = e.typeAnnotation, this.resetEndLocation(e.expression, e.typeAnnotation.end), e.expression;
|
|
5587
5606
|
}, b.toAssignableList = function(t, n) {
|
|
@@ -5630,9 +5649,9 @@ function Cr(e) {
|
|
|
5630
5649
|
this.next(), e.prototype.parseVar.call(this, t, !1, n, r || i), this.semicolon();
|
|
5631
5650
|
var a = this.finishNode(t, "VariableDeclaration");
|
|
5632
5651
|
if (!i) return a;
|
|
5633
|
-
for (var o, s =
|
|
5652
|
+
for (var o, s = nr(a.declarations); !(o = s()).done;) {
|
|
5634
5653
|
var c = o.value, l = c.init;
|
|
5635
|
-
l && (n !== "const" || c.id.typeAnnotation ? this.raise(l.start,
|
|
5654
|
+
l && (n !== "const" || c.id.typeAnnotation ? this.raise(l.start, J.InitializerNotAllowedInAmbientContext) : l.type !== "StringLiteral" && l.type !== "BooleanLiteral" && l.type !== "NumericLiteral" && l.type !== "BigIntLiteral" && (l.type !== "TemplateLiteral" || l.expressions.length > 0) && !yr(l) && this.raise(l.start, J.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
5636
5655
|
}
|
|
5637
5656
|
return a;
|
|
5638
5657
|
}, b.parseStatement = function(t, n, r) {
|
|
@@ -5653,7 +5672,7 @@ function Cr(e) {
|
|
|
5653
5672
|
"private"
|
|
5654
5673
|
]);
|
|
5655
5674
|
}, b.parsePostMemberNameModifiers = function(e) {
|
|
5656
|
-
this.eat(o.question) && (e.optional = !0), e.readonly && this.match(o.parenL) && this.raise(e.start,
|
|
5675
|
+
this.eat(o.question) && (e.optional = !0), e.readonly && this.match(o.parenL) && this.raise(e.start, J.ClassMethodHasReadonly), e.declare && this.match(o.parenL) && this.raise(e.start, J.ClassMethodHasDeclare);
|
|
5657
5676
|
}, b.parseExpressionStatement = function(t, n) {
|
|
5658
5677
|
return (n.type === "Identifier" ? this.tsParseExpressionStatement(t, n) : void 0) || e.prototype.parseExpressionStatement.call(this, t, n);
|
|
5659
5678
|
}, b.shouldParseExportStatement = function() {
|
|
@@ -5685,7 +5704,7 @@ function Cr(e) {
|
|
|
5685
5704
|
return t.parseExportDeclaration(e);
|
|
5686
5705
|
});
|
|
5687
5706
|
var n = this.start, r = this.startLoc, i = this.eatContextual("declare");
|
|
5688
|
-
!i || !this.ts_isContextual(p.declare) && this.shouldParseExportStatement() || this.raise(this.start,
|
|
5707
|
+
!i || !this.ts_isContextual(p.declare) && this.shouldParseExportStatement() || this.raise(this.start, J.ExpectedAmbientAfterExportDeclare);
|
|
5689
5708
|
var a = v(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
5690
5709
|
return a ? ((a.type === "TSInterfaceDeclaration" || a.type === "TSTypeAliasDeclaration" || i) && (e.exportKind = "type"), i && (this.resetStartLocation(a, n, r), a.declare = !0), a) : null;
|
|
5691
5710
|
}, b.parseClassId = function(t, n) {
|
|
@@ -5699,19 +5718,19 @@ function Cr(e) {
|
|
|
5699
5718
|
var t = this.tsTryParseTypeAnnotation();
|
|
5700
5719
|
t && (e.typeAnnotation = t);
|
|
5701
5720
|
}, b.parseClassField = function(t) {
|
|
5702
|
-
if (t.key.type === "PrivateIdentifier") t.abstract && this.raise(t.start,
|
|
5703
|
-
else if (this.parseClassPropertyAnnotation(t), this.isAmbientContext && (!t.readonly || t.typeAnnotation) && this.match(o.eq) && this.raise(this.start,
|
|
5721
|
+
if (t.key.type === "PrivateIdentifier") t.abstract && this.raise(t.start, J.PrivateElementHasAbstract), t.accessibility && this.raise(t.start, J.PrivateElementHasAccessibility({ modifier: t.accessibility })), this.parseClassPropertyAnnotation(t);
|
|
5722
|
+
else if (this.parseClassPropertyAnnotation(t), this.isAmbientContext && (!t.readonly || t.typeAnnotation) && this.match(o.eq) && this.raise(this.start, J.DeclareClassFieldHasInitializer), t.abstract && this.match(o.eq)) {
|
|
5704
5723
|
var n = t.key;
|
|
5705
|
-
this.raise(this.start,
|
|
5724
|
+
this.raise(this.start, J.AbstractPropertyHasInitializer({ propertyName: n.type !== "Identifier" || t.computed ? "[" + this.input.slice(n.start, n.end) + "]" : n.name }));
|
|
5706
5725
|
}
|
|
5707
5726
|
return e.prototype.parseClassField.call(this, t);
|
|
5708
5727
|
}, b.parseClassMethod = function(e, t, n, r) {
|
|
5709
5728
|
var i = e.kind === "constructor", a = e.key.type === "PrivateIdentifier", o = this.tsTryParseTypeParameters();
|
|
5710
|
-
a ? (o && (e.typeParameters = o), e.accessibility && this.raise(e.start,
|
|
5729
|
+
a ? (o && (e.typeParameters = o), e.accessibility && this.raise(e.start, J.PrivateMethodsHasAccessibility({ modifier: e.accessibility }))) : o && i && this.raise(o.start, J.ConstructorHasTypeParameters);
|
|
5711
5730
|
var s = e.declare, c = e.kind;
|
|
5712
|
-
!(s !== void 0 && s) || c !== "get" && c !== "set" || this.raise(e.start,
|
|
5731
|
+
!(s !== void 0 && s) || c !== "get" && c !== "set" || this.raise(e.start, J.DeclareAccessor({ kind: c })), o && (e.typeParameters = o);
|
|
5713
5732
|
var l = e.key;
|
|
5714
|
-
e.kind === "constructor" ? (t && this.raise(l.start, "Constructor can't be a generator"), n && this.raise(l.start, "Constructor can't be an async method")) : e.static &&
|
|
5733
|
+
e.kind === "constructor" ? (t && this.raise(l.start, "Constructor can't be a generator"), n && this.raise(l.start, "Constructor can't be an async method")) : e.static && lr(e, "prototype") && this.raise(l.start, "Classes may not have a static property named prototype");
|
|
5715
5734
|
var u = e.value = this.parseMethod(t, n, r, !0, e);
|
|
5716
5735
|
return e.kind === "get" && u.params.length !== 0 && this.raiseRecoverable(u.start, "getter should have no params"), e.kind === "set" && u.params.length !== 1 && this.raiseRecoverable(u.start, "setter should have exactly one param"), e.kind === "set" && u.params[0].type === "RestElement" && this.raiseRecoverable(u.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
5717
5736
|
}, b.isClassMethod = function() {
|
|
@@ -5735,23 +5754,23 @@ function Cr(e) {
|
|
|
5735
5754
|
allowedModifiers: d,
|
|
5736
5755
|
disallowedModifiers: ["in", "out"],
|
|
5737
5756
|
stopOnStartOfClassStaticBlock: !0,
|
|
5738
|
-
errorTemplate:
|
|
5757
|
+
errorTemplate: J.InvalidModifierOnTypeParameterPositions
|
|
5739
5758
|
}).static;
|
|
5740
5759
|
var f = function() {
|
|
5741
5760
|
if (!n.tsIsStartOfStaticBlocks()) {
|
|
5742
5761
|
var f = n.tsTryParseIndexSignature(a);
|
|
5743
|
-
if (f) return a.abstract && n.raise(a.start,
|
|
5744
|
-
if (!n.inAbstractClass && a.abstract && n.raise(a.start,
|
|
5762
|
+
if (f) return a.abstract && n.raise(a.start, J.IndexSignatureHasAbstract), a.accessibility && n.raise(a.start, J.IndexSignatureHasAccessibility({ modifier: a.accessibility })), a.declare && n.raise(a.start, J.IndexSignatureHasDeclare), a.override && n.raise(a.start, J.IndexSignatureHasOverride), f;
|
|
5763
|
+
if (!n.inAbstractClass && a.abstract && n.raise(a.start, J.NonAbstractClassHasAbstractMethod), a.override && t && n.raise(a.start, J.OverrideNotInSubClass), a.static = r, r && (n.isClassElementNameStart() || n.type === o.star || (s = "static")), !s && i >= 8 && n.eatContextual("async") && (!n.isClassElementNameStart() && n.type !== o.star || n.canInsertSemicolon() ? s = "async" : l = !0), !s && (i >= 9 || !l) && n.eat(o.star) && (c = !0), !s && !l && !c) {
|
|
5745
5764
|
var p = n.value;
|
|
5746
5765
|
(n.eatContextual("get") || n.eatContextual("set")) && (n.isClassElementNameStart() ? u = p : s = p);
|
|
5747
5766
|
}
|
|
5748
5767
|
if (s ? (a.computed = !1, a.key = n.startNodeAt(n.lastTokStart, n.lastTokStartLoc), a.key.name = s, n.finishNode(a.key, "Identifier")) : n.parseClassElementName(a), n.parsePostMemberNameModifiers(a), n.isClassMethod() || i < 13 || n.type === o.parenL || u !== "method" || c || l) {
|
|
5749
|
-
var m = !a.static &&
|
|
5768
|
+
var m = !a.static && lr(a, "constructor"), h = m && t;
|
|
5750
5769
|
m && u !== "method" && n.raise(a.key.start, "Constructor can't have get/set modifier"), a.kind = m ? "constructor" : u, n.parseClassMethod(a, c, l, h);
|
|
5751
5770
|
} else n.parseClassField(a);
|
|
5752
5771
|
return a;
|
|
5753
5772
|
}
|
|
5754
|
-
if (n.next(), n.next(), n.tsHasSomeModifiers(a, d) && n.raise(n.start,
|
|
5773
|
+
if (n.next(), n.next(), n.tsHasSomeModifiers(a, d) && n.raise(n.start, J.StaticBlockCannotHaveModifier), i >= 13) return e.prototype.parseClassStaticBlock.call(n, a), a;
|
|
5755
5774
|
};
|
|
5756
5775
|
return a.declare ? this.tsInAmbientContext(f) : f(), a;
|
|
5757
5776
|
}, b.isClassElementNameStart = function() {
|
|
@@ -5768,7 +5787,7 @@ function Cr(e) {
|
|
|
5768
5787
|
}, b.parseArrowExpression = function(e, t, n, r) {
|
|
5769
5788
|
this.match(o.colon) && (e.returnType = this.tsParseTypeAnnotation());
|
|
5770
5789
|
var i = this.yieldPos, a = this.awaitPos, s = this.awaitIdentPos;
|
|
5771
|
-
this.enterScope(16 |
|
|
5790
|
+
this.enterScope(16 | vr(n, !1)), this.initFunction(e);
|
|
5772
5791
|
var c = this.maybeInArrowParameters;
|
|
5773
5792
|
return this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, e.params = this.toAssignableList(t, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = s, this.maybeInArrowParameters = c, this.finishNode(e, "ArrowFunctionExpression");
|
|
5774
5793
|
}, b.parseMaybeAssignOrigin = function(e, t, n) {
|
|
@@ -5777,7 +5796,7 @@ function Cr(e) {
|
|
|
5777
5796
|
this.exprAllowed = !1;
|
|
5778
5797
|
}
|
|
5779
5798
|
var r = !1, i = -1, a = -1, s = -1;
|
|
5780
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, s = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
5799
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, s = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new sr(), r = !0);
|
|
5781
5800
|
var c = this.start, l = this.startLoc;
|
|
5782
5801
|
(this.type === o.parenL || v(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
5783
5802
|
var u = this.parseMaybeConditional(e, t);
|
|
@@ -5804,7 +5823,7 @@ function Cr(e) {
|
|
|
5804
5823
|
return (a.type !== "ArrowFunctionExpression" || (i = a.extra) != null && i.parenthesized) && r(), f?.params.length !== 0 && p.resetStartLocationFromNode(a, f), a.typeParameters = f, a;
|
|
5805
5824
|
}, l);
|
|
5806
5825
|
if (!g.error && !g.aborted) return f && this.reportReservedArrowTypeParam(f), g.node;
|
|
5807
|
-
if (!u && (
|
|
5826
|
+
if (!u && (hr(!0), !(d = this.tryParse(function() {
|
|
5808
5827
|
return p.parseMaybeAssignOrigin(e, t, n);
|
|
5809
5828
|
}, l)).error)) return d.node;
|
|
5810
5829
|
if ((a = u) != null && a.node) return this.setLookaheadState(u.failState), u.node;
|
|
@@ -5825,20 +5844,20 @@ function Cr(e) {
|
|
|
5825
5844
|
"override",
|
|
5826
5845
|
"readonly"
|
|
5827
5846
|
]
|
|
5828
|
-
}), n = s.accessibility, o = s.override, a = s.readonly, !1 === e && (n || a || o) && this.raise(i.start,
|
|
5847
|
+
}), n = s.accessibility, o = s.override, a = s.readonly, !1 === e && (n || a || o) && this.raise(i.start, J.UnexpectedParameterModifier);
|
|
5829
5848
|
}
|
|
5830
5849
|
var c = this.parseMaybeDefault(r, i);
|
|
5831
5850
|
this.parseBindingListItem(c);
|
|
5832
5851
|
var l = this.parseMaybeDefault(c.start, c.loc, c);
|
|
5833
5852
|
if (t.length && (l.decorators = t), n || a || o) {
|
|
5834
5853
|
var u = this.startNodeAt(r, i);
|
|
5835
|
-
return n && (u.accessibility = n), a && (u.readonly = a), o && (u.override = o), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(u.start,
|
|
5854
|
+
return n && (u.accessibility = n), a && (u.readonly = a), o && (u.override = o), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(u.start, J.UnsupportedParameterPropertyKind), u.parameter = l, this.finishNode(u, "TSParameterProperty");
|
|
5836
5855
|
}
|
|
5837
5856
|
return l;
|
|
5838
5857
|
}, b.checkLValInnerPattern = function(t, n, r) {
|
|
5839
5858
|
n === void 0 && (n = 0), t.type === "TSParameterProperty" ? this.checkLValInnerPattern(t.parameter, n, r) : e.prototype.checkLValInnerPattern.call(this, t, n, r);
|
|
5840
5859
|
}, b.parseBindingListItem = function(e) {
|
|
5841
|
-
this.eat(o.question) && (e.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(e.start,
|
|
5860
|
+
this.eat(o.question) && (e.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(e.start, J.PatternIsOptional), e.optional = !0);
|
|
5842
5861
|
var t = this.tsTryParseTypeAnnotation();
|
|
5843
5862
|
return t && (e.typeAnnotation = t), this.resetEndLocation(e), e;
|
|
5844
5863
|
}, b.isAssignable = function(e, t) {
|
|
@@ -5869,12 +5888,12 @@ function Cr(e) {
|
|
|
5869
5888
|
default: return !1;
|
|
5870
5889
|
}
|
|
5871
5890
|
}, b.toAssignable = function(t, n, r) {
|
|
5872
|
-
switch (n === void 0 && (n = !1), r === void 0 && (r = new
|
|
5891
|
+
switch (n === void 0 && (n = !1), r === void 0 && (r = new sr()), t.type) {
|
|
5873
5892
|
case "ParenthesizedExpression": return this.toAssignableParenthesizedExpression(t, n, r);
|
|
5874
5893
|
case "TSAsExpression":
|
|
5875
5894
|
case "TSSatisfiesExpression":
|
|
5876
5895
|
case "TSNonNullExpression":
|
|
5877
|
-
case "TSTypeAssertion": return n || this.raise(t.start,
|
|
5896
|
+
case "TSTypeAssertion": return n || this.raise(t.start, J.UnexpectedTypeCastInParameter), this.toAssignable(t.expression, n, r);
|
|
5878
5897
|
case "MemberExpression": break;
|
|
5879
5898
|
case "AssignmentExpression": return n || t.left.type !== "TSTypeCastExpression" || (t.left = this.typeCastToParameter(t.left)), e.prototype.toAssignable.call(this, t, n, r);
|
|
5880
5899
|
case "TSTypeCastExpression": return this.typeCastToParameter(t);
|
|
@@ -5926,7 +5945,7 @@ function Cr(e) {
|
|
|
5926
5945
|
if (this.options.ecmaVersion >= 6) {
|
|
5927
5946
|
var s = this.maybeInArrowParameters;
|
|
5928
5947
|
this.maybeInArrowParameters = !0, this.next();
|
|
5929
|
-
var c, l = this.start, u = this.startLoc, d = [], f = !0, p = !1, m = new
|
|
5948
|
+
var c, l = this.start, u = this.startLoc, d = [], f = !0, p = !1, m = new sr(), h = this.yieldPos, g = this.awaitPos;
|
|
5930
5949
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== o.parenR;) {
|
|
5931
5950
|
if (f ? f = !1 : this.expect(o.comma), a && this.afterTrailingComma(o.parenR, !0)) {
|
|
5932
5951
|
p = !0;
|
|
@@ -5995,7 +6014,7 @@ function Cr(e) {
|
|
|
5995
6014
|
return u.typeParameters = a, u;
|
|
5996
6015
|
}
|
|
5997
6016
|
if (!r && c.eat(o.parenL)) {
|
|
5998
|
-
var p = new
|
|
6017
|
+
var p = new sr(), m = c.startNodeAt(t, n);
|
|
5999
6018
|
return m.callee = e, m.arguments = c.parseExprList(o.parenR, c.options.ecmaVersion >= 8, !1, p), c.tsCheckForInvalidTypeCasts(m.arguments), m.typeParameters = a, l && (m.optional = d), c.checkExpressionErrors(p, !0), e = c.finishNode(m, "CallExpression");
|
|
6000
6019
|
}
|
|
6001
6020
|
var h = c.type;
|
|
@@ -6004,7 +6023,7 @@ function Cr(e) {
|
|
|
6004
6023
|
return _.expression = e, _.typeParameters = a, c.finishNode(_, "TSInstantiationExpression");
|
|
6005
6024
|
}
|
|
6006
6025
|
});
|
|
6007
|
-
if (f && this.unexpected(f), p) return p.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start,
|
|
6026
|
+
if (f && this.unexpected(f), p) return p.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, J.InvalidPropertyAccessAfterInstantiationExpression), e = p;
|
|
6008
6027
|
}
|
|
6009
6028
|
var m = this.options.ecmaVersion >= 11, h = m && this.eat(o.questionDot);
|
|
6010
6029
|
r && h && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
@@ -6015,7 +6034,7 @@ function Cr(e) {
|
|
|
6015
6034
|
} else if (!r && this.eat(o.parenL)) {
|
|
6016
6035
|
var v = this.maybeInArrowParameters;
|
|
6017
6036
|
this.maybeInArrowParameters = !0;
|
|
6018
|
-
var te = new
|
|
6037
|
+
var te = new sr(), ne = this.yieldPos, re = this.awaitPos, ie = this.awaitIdentPos;
|
|
6019
6038
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
6020
6039
|
var y = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, te);
|
|
6021
6040
|
if (i && !h && this.shouldParseAsyncArrow()) this.checkPatternErrors(te, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = ne, this.awaitPos = re, this.awaitIdentPos = ie, e = this.parseSubscriptAsyncArrow(t, n, y, s);
|
|
@@ -6061,7 +6080,7 @@ function Cr(e) {
|
|
|
6061
6080
|
for (this.expect(o.braceL); this.type !== o.braceR;) if (this.match(p.at)) c.push(this.parseDecorator());
|
|
6062
6081
|
else {
|
|
6063
6082
|
var l = this.parseClassElement(e.superClass !== null);
|
|
6064
|
-
c.length && (l.decorators = c, this.resetStartLocationFromNode(l, c[0]), c = []), l && (a.body.push(l), l.type === "MethodDefinition" && l.kind === "constructor" && l.value.type === "FunctionExpression" ? (s && this.raiseRecoverable(l.start, "Duplicate constructor in the same class"), s = !0, l.decorators && l.decorators.length > 0 && this.raise(l.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : l.key && l.key.type === "PrivateIdentifier" &&
|
|
6083
|
+
c.length && (l.decorators = c, this.resetStartLocationFromNode(l, c[0]), c = []), l && (a.body.push(l), l.type === "MethodDefinition" && l.kind === "constructor" && l.value.type === "FunctionExpression" ? (s && this.raiseRecoverable(l.start, "Duplicate constructor in the same class"), s = !0, l.decorators && l.decorators.length > 0 && this.raise(l.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : l.key && l.key.type === "PrivateIdentifier" && cr(i, l) && this.raiseRecoverable(l.key.start, "Identifier '#" + l.key.name + "' has already been declared"));
|
|
6065
6084
|
}
|
|
6066
6085
|
return this.strict = r, this.next(), c.length && this.raise(this.start, "Decorators must be attached to a class element."), e.body = this.finishNode(a, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
6067
6086
|
} finally {
|
|
@@ -6072,9 +6091,9 @@ function Cr(e) {
|
|
|
6072
6091
|
return e && (t.typeParameters = e), t;
|
|
6073
6092
|
}, b.parseMethod = function(e, t, n, r, i) {
|
|
6074
6093
|
var a = this.startNode(), s = this.yieldPos, c = this.awaitPos, l = this.awaitIdentPos;
|
|
6075
|
-
if (this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = e), this.options.ecmaVersion >= 8 && (a.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 |
|
|
6094
|
+
if (this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = e), this.options.ecmaVersion >= 8 && (a.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | vr(t, a.generator) | (n ? 128 : 0)), this.expect(o.parenL), a.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1, { isClassMethod: r }), this.yieldPos = s, this.awaitPos = c, this.awaitIdentPos = l, i && i.abstract && a.body) {
|
|
6076
6095
|
var u = i.key;
|
|
6077
|
-
this.raise(i.start,
|
|
6096
|
+
this.raise(i.start, J.AbstractMethodHasImplementation({ methodName: u.type !== "Identifier" || i.computed ? "[" + this.input.slice(u.start, u.end) + "]" : u.name }));
|
|
6078
6097
|
}
|
|
6079
6098
|
return this.finishNode(a, "FunctionExpression");
|
|
6080
6099
|
}, t.parse = function(e, t) {
|
|
@@ -6111,7 +6130,7 @@ function Cr(e) {
|
|
|
6111
6130
|
te(this.type) ? (c = !0, s = d, i = n ? this.parseIdent() : this.parseModuleExportName(), l = !1) : (i = f, l = !1);
|
|
6112
6131
|
} else te(this.type) ? (l = !1, i = n ? this.parseIdent() : this.parseModuleExportName()) : (c = !0, s = d);
|
|
6113
6132
|
} else te(this.type) && (c = !0, n ? (s = e.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(s)) : s = this.parseModuleExportName());
|
|
6114
|
-
c && r && this.raise(u, n ?
|
|
6133
|
+
c && r && this.raise(u, n ? J.TypeModifierIsUsedInTypeImports : J.TypeModifierIsUsedInTypeExports), t[a] = s, t[o] = i, t[n ? "importKind" : "exportKind"] = c ? "type" : "value", l && this.eatContextual("as") && (t[o] = n ? this.parseIdent() : this.parseModuleExportName()), t[o] || (t[o] = this.copyNode(t[a])), n && this.checkLValSimple(t[o], 2);
|
|
6115
6134
|
}, b.raiseCommonCheck = function(t, n, r) {
|
|
6116
6135
|
return n === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : e.prototype.raise.call(this, t, n) : r ? e.prototype.raiseRecoverable.call(this, t, n) : e.prototype.raise.call(this, t, n);
|
|
6117
6136
|
}, b.raiseRecoverable = function(e, t) {
|
|
@@ -6138,11 +6157,11 @@ function Cr(e) {
|
|
|
6138
6157
|
for (r.attributes = []; this.type !== o.slash && this.type !== p.jsxTagEnd;) r.attributes.push(this.jsx_parseAttribute());
|
|
6139
6158
|
return r.selfClosing = this.eat(o.slash), this.expect(p.jsxTagEnd), this.finishNode(r, i ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
6140
6159
|
}, b.enterScope = function(t) {
|
|
6141
|
-
t ===
|
|
6160
|
+
t === ar && this.importsStack.push([]), e.prototype.enterScope.call(this, t);
|
|
6142
6161
|
var n = e.prototype.currentScope.call(this);
|
|
6143
6162
|
n.types = [], n.enums = [], n.constEnums = [], n.classes = [], n.exportOnlyBindings = [];
|
|
6144
6163
|
}, b.exitScope = function() {
|
|
6145
|
-
e.prototype.currentScope.call(this).flags ===
|
|
6164
|
+
e.prototype.currentScope.call(this).flags === ar && this.importsStack.pop(), e.prototype.exitScope.call(this);
|
|
6146
6165
|
}, b.hasImport = function(e, t) {
|
|
6147
6166
|
var n = this.importsStack.length;
|
|
6148
6167
|
if (this.importsStack[n - 1].indexOf(e) > -1) return !0;
|
|
@@ -6180,13 +6199,13 @@ function Cr(e) {
|
|
|
6180
6199
|
get: function() {
|
|
6181
6200
|
return i;
|
|
6182
6201
|
}
|
|
6183
|
-
}]) &&
|
|
6202
|
+
}]) && Zn(ie.prototype, y), ae && Zn(ie, ae), Object.defineProperty(ie, "prototype", { writable: !1 }), t;
|
|
6184
6203
|
}(t);
|
|
6185
6204
|
};
|
|
6186
6205
|
}
|
|
6187
6206
|
//#endregion
|
|
6188
6207
|
//#region src/utilities/index.ts
|
|
6189
|
-
var
|
|
6208
|
+
var Cr = [
|
|
6190
6209
|
{
|
|
6191
6210
|
idPrefix: "dpuse-app",
|
|
6192
6211
|
typeId: "app",
|
|
@@ -6253,8 +6272,8 @@ var wr = [
|
|
|
6253
6272
|
isPublished: !0,
|
|
6254
6273
|
uploadGroupName: void 0
|
|
6255
6274
|
}
|
|
6256
|
-
],
|
|
6257
|
-
async function
|
|
6275
|
+
], wr = r(i);
|
|
6276
|
+
async function Tr(e) {
|
|
6258
6277
|
let r;
|
|
6259
6278
|
try {
|
|
6260
6279
|
r = await t.readdir(e, { withFileTypes: !0 });
|
|
@@ -6274,69 +6293,69 @@ async function Er(e) {
|
|
|
6274
6293
|
}
|
|
6275
6294
|
}));
|
|
6276
6295
|
}
|
|
6277
|
-
async function
|
|
6296
|
+
async function Er(e, n) {
|
|
6278
6297
|
return t.readdir(e, n);
|
|
6279
6298
|
}
|
|
6280
|
-
async function
|
|
6299
|
+
async function Y(e, n, r = [], i) {
|
|
6281
6300
|
let a = `${n} ${r.join(" ")}`;
|
|
6282
|
-
e !== void 0 &&
|
|
6283
|
-
let { stdout: o, stderr: s } = await
|
|
6301
|
+
e !== void 0 && $(`${e} - exec(${a})`);
|
|
6302
|
+
let { stdout: o, stderr: s } = await wr(a);
|
|
6284
6303
|
i === void 0 ? o.trim() && console.log(o.trim()) : await t.writeFile(i, o.trim(), "utf8"), s.trim() && console.error(s.trim());
|
|
6285
6304
|
}
|
|
6286
|
-
async function
|
|
6287
|
-
return
|
|
6305
|
+
async function X(e, t, n = [], r = !1, i = !1) {
|
|
6306
|
+
return $(`${e} - spawn(${t} ${n.join(" ")})`), new Promise((e, o) => {
|
|
6288
6307
|
a(t, n, {
|
|
6289
6308
|
shell: i,
|
|
6290
6309
|
stdio: "inherit"
|
|
6291
6310
|
}).on("close", (n) => {
|
|
6292
|
-
n === 0 || r ? e() : o(/* @__PURE__ */ Error(`${t} exited with code ${n}`));
|
|
6311
|
+
n === 0 || r ? e() : o(/* @__PURE__ */ Error(`${t} exited with code ${String(n ?? "unknown")}`));
|
|
6293
6312
|
});
|
|
6294
6313
|
});
|
|
6295
6314
|
}
|
|
6296
|
-
async function
|
|
6315
|
+
async function Z(e) {
|
|
6297
6316
|
return JSON.parse(await t.readFile(e, "utf8"));
|
|
6298
6317
|
}
|
|
6299
|
-
async function
|
|
6318
|
+
async function Dr(e) {
|
|
6300
6319
|
return await t.readFile(e, "utf8");
|
|
6301
6320
|
}
|
|
6302
|
-
async function
|
|
6321
|
+
async function Or(e) {
|
|
6303
6322
|
try {
|
|
6304
6323
|
await t.unlink(e);
|
|
6305
6324
|
} catch (e) {
|
|
6306
6325
|
if (e.code !== "ENOENT") throw e;
|
|
6307
6326
|
}
|
|
6308
6327
|
}
|
|
6309
|
-
async function
|
|
6328
|
+
async function kr(e, n) {
|
|
6310
6329
|
await t.writeFile(e, JSON.stringify(n, void 0, 4), "utf8");
|
|
6311
6330
|
}
|
|
6312
|
-
async function
|
|
6331
|
+
async function Ar(e, n) {
|
|
6313
6332
|
await t.writeFile(e, n, "utf8");
|
|
6314
6333
|
}
|
|
6315
|
-
function
|
|
6334
|
+
function Q(e) {
|
|
6316
6335
|
let t = "─".repeat(Math.max(e.length + 60, 60));
|
|
6317
6336
|
console.info(`\n[36m${t}`), console.info(`▶️ ${e}`), console.info(`${t}[0m`);
|
|
6318
6337
|
}
|
|
6319
|
-
function
|
|
6338
|
+
function jr(e) {
|
|
6320
6339
|
console.info(`\n✅ ${e}\n`);
|
|
6321
6340
|
}
|
|
6322
|
-
function
|
|
6341
|
+
function $(e) {
|
|
6323
6342
|
console.info(`\n${e}\n`);
|
|
6324
6343
|
}
|
|
6325
|
-
function
|
|
6326
|
-
let t =
|
|
6344
|
+
function Mr(e) {
|
|
6345
|
+
let t = Cr.find((t) => e.startsWith(t.idPrefix));
|
|
6327
6346
|
if (!t) throw Error(`Failed to locate module type configuration for identifier '${e}'.`);
|
|
6328
6347
|
return t;
|
|
6329
6348
|
}
|
|
6330
|
-
async function
|
|
6349
|
+
async function Nr(e) {
|
|
6331
6350
|
return await t.stat(e);
|
|
6332
6351
|
}
|
|
6333
|
-
function
|
|
6334
|
-
let t = P.extend(
|
|
6352
|
+
function Pr(e) {
|
|
6353
|
+
let t = P.extend(Sr()).parse(e, {
|
|
6335
6354
|
ecmaVersion: "latest",
|
|
6336
6355
|
sourceType: "module",
|
|
6337
6356
|
locations: !0
|
|
6338
6357
|
}), n = [];
|
|
6339
|
-
return
|
|
6358
|
+
return Fr(t, (e) => {
|
|
6340
6359
|
if (e.type !== "MethodDefinition") return;
|
|
6341
6360
|
let t = e, r = t.key;
|
|
6342
6361
|
if (r.type !== "Identifier") return;
|
|
@@ -6344,7 +6363,7 @@ function Fr(e) {
|
|
|
6344
6363
|
i && i !== "constructor" && t.accessibility !== "private" && n.push(i);
|
|
6345
6364
|
}), n;
|
|
6346
6365
|
}
|
|
6347
|
-
function
|
|
6366
|
+
function Fr(e, t) {
|
|
6348
6367
|
t(e);
|
|
6349
6368
|
for (let [n, r] of Object.entries(e)) {
|
|
6350
6369
|
if ([
|
|
@@ -6357,37 +6376,37 @@ function Ir(e, t) {
|
|
|
6357
6376
|
let e = r;
|
|
6358
6377
|
if (Array.isArray(e)) for (let n of e) {
|
|
6359
6378
|
let e = n;
|
|
6360
|
-
e && typeof e.type == "string" &&
|
|
6379
|
+
e && typeof e.type == "string" && Fr(e, t);
|
|
6361
6380
|
}
|
|
6362
|
-
else e && typeof e == "object" && typeof e.type == "string" &&
|
|
6381
|
+
else e && typeof e == "object" && typeof e.type == "string" && Fr(e, t);
|
|
6363
6382
|
}
|
|
6364
6383
|
}
|
|
6365
|
-
function
|
|
6384
|
+
function Ir(e, t, n, r) {
|
|
6366
6385
|
let i = e.indexOf(n), a = e.indexOf(r);
|
|
6367
6386
|
if (i === -1 || a === -1) throw Error(`Markers ${n}-${r} not found in content.`);
|
|
6368
6387
|
return `${e.slice(0, Math.max(0, i + n.length))}\n${t}\n${e.slice(Math.max(0, a))}`;
|
|
6369
6388
|
}
|
|
6370
6389
|
//#endregion
|
|
6371
6390
|
//#region src/utilities/cloudflare.ts
|
|
6372
|
-
async function
|
|
6373
|
-
let e = await
|
|
6391
|
+
async function Lr() {
|
|
6392
|
+
let e = await Z("config.json"), t = {
|
|
6374
6393
|
body: JSON.stringify(e),
|
|
6375
6394
|
headers: { "Content-Type": "application/json" },
|
|
6376
6395
|
method: "PUT"
|
|
6377
6396
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
6378
6397
|
if (!n.ok) throw Error(await n.text());
|
|
6379
6398
|
}
|
|
6380
|
-
async function
|
|
6399
|
+
async function Rr(e, t) {
|
|
6381
6400
|
async function n(e, t, r) {
|
|
6382
6401
|
for (let i of r) {
|
|
6383
6402
|
let r = `${e}/${i}`, a = `${t}/${i}`;
|
|
6384
|
-
(await
|
|
6403
|
+
(await Nr(r)).isDirectory() ? await n(r, a, await Er(r)) : (console.info(`⚙️ Uploading '${e}/${i}'...`), await Y(void 0, `wrangler r2 object put "dpuse-sample-data-eu/${t}/${i}" --file="${e}/${i}" --jurisdiction=eu --remote`));
|
|
6385
6404
|
}
|
|
6386
6405
|
}
|
|
6387
|
-
let r = await
|
|
6406
|
+
let r = await Er(`${e}/${t}/`);
|
|
6388
6407
|
await n(`${e}/${t}`, t, r);
|
|
6389
6408
|
}
|
|
6390
|
-
async function
|
|
6409
|
+
async function zr(e) {
|
|
6391
6410
|
let t = e.id, n = {
|
|
6392
6411
|
body: JSON.stringify(e),
|
|
6393
6412
|
headers: { "Content-Type": "application/json" },
|
|
@@ -6395,27 +6414,26 @@ async function Br(e) {
|
|
|
6395
6414
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
6396
6415
|
if (!r.ok) throw Error(await r.text());
|
|
6397
6416
|
}
|
|
6398
|
-
async function
|
|
6399
|
-
let n = `v${e.version}`;
|
|
6417
|
+
async function Br(e, t) {
|
|
6418
|
+
let n = `v${e.version ?? "unknown"}`;
|
|
6400
6419
|
async function r(e, r = "") {
|
|
6401
|
-
let i = await
|
|
6420
|
+
let i = await Er(e, { withFileTypes: !0 });
|
|
6402
6421
|
for (let a of i) {
|
|
6403
|
-
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name;
|
|
6404
6422
|
if (a.isDirectory()) continue;
|
|
6405
|
-
let s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = a.name.endsWith(".css") ? "text/css" : "application/octet-stream", l = a.name.endsWith(".js") ? "application/javascript" : c;
|
|
6406
|
-
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await
|
|
6423
|
+
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = a.name.endsWith(".css") ? "text/css" : "application/octet-stream", l = a.name.endsWith(".js") ? "application/javascript" : c;
|
|
6424
|
+
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await Y(void 0, `wrangler r2 object put "${s}" --file="${i}" --content-type ${l} --jurisdiction=eu --remote`);
|
|
6407
6425
|
}
|
|
6408
6426
|
}
|
|
6409
6427
|
await r("dist");
|
|
6410
6428
|
}
|
|
6411
6429
|
//#endregion
|
|
6412
6430
|
//#region src/operations/manageProject.ts
|
|
6413
|
-
var
|
|
6431
|
+
var Vr = new Set([
|
|
6414
6432
|
"createObject",
|
|
6415
6433
|
"dropObject",
|
|
6416
6434
|
"removeRecords",
|
|
6417
6435
|
"upsertRecords"
|
|
6418
|
-
]),
|
|
6436
|
+
]), Hr = new Set([
|
|
6419
6437
|
"auditObjectContent",
|
|
6420
6438
|
"findObjectFolderPath",
|
|
6421
6439
|
"getReadableStream",
|
|
@@ -6425,142 +6443,142 @@ var Hr = new Set([
|
|
|
6425
6443
|
"retrieveChunks",
|
|
6426
6444
|
"retrieveRecords"
|
|
6427
6445
|
]);
|
|
6428
|
-
async function
|
|
6446
|
+
async function Ur() {
|
|
6429
6447
|
try {
|
|
6430
|
-
|
|
6448
|
+
Q("Build Project"), await X("1️⃣ Bundle project", "vite", ["build"]), jr("Project built.");
|
|
6431
6449
|
} catch (e) {
|
|
6432
6450
|
console.error("❌ Error building project.", e), process.exit(1);
|
|
6433
6451
|
}
|
|
6434
6452
|
}
|
|
6435
|
-
async function
|
|
6453
|
+
async function Wr() {
|
|
6436
6454
|
try {
|
|
6437
|
-
|
|
6438
|
-
let e = await
|
|
6439
|
-
await
|
|
6440
|
-
let n =
|
|
6455
|
+
Q("Release Project");
|
|
6456
|
+
let e = await Z("package.json"), t = await Z("config.json");
|
|
6457
|
+
await $r("1️⃣", e);
|
|
6458
|
+
let n = Mr(t.id);
|
|
6441
6459
|
switch (n.typeId) {
|
|
6442
6460
|
case "connector":
|
|
6443
|
-
t = await
|
|
6461
|
+
t = await Kr("2️⃣", e);
|
|
6444
6462
|
break;
|
|
6445
6463
|
case "context":
|
|
6446
|
-
t = await
|
|
6464
|
+
t = await qr("2️⃣", e);
|
|
6447
6465
|
break;
|
|
6448
6466
|
case "presenter":
|
|
6449
|
-
t = await
|
|
6467
|
+
t = await Jr("2️⃣", e);
|
|
6450
6468
|
break;
|
|
6451
|
-
default: t = await
|
|
6469
|
+
default: t = await Gr("2️⃣", e);
|
|
6452
6470
|
}
|
|
6453
|
-
if (await
|
|
6471
|
+
if (await X("3️⃣ Bundle project", "vite", ["build"]), await Y("4️⃣ Stage changes", "git", ["add", "."]), await Y("5️⃣ Commit changes", "git", [
|
|
6454
6472
|
"commit",
|
|
6455
6473
|
"-m",
|
|
6456
|
-
`"v${e.version}"`
|
|
6457
|
-
]), await
|
|
6474
|
+
`"v${e.version ?? "unknown"}"`
|
|
6475
|
+
]), await Y("6️⃣ Push changes", "git", [
|
|
6458
6476
|
"push",
|
|
6459
6477
|
"origin",
|
|
6460
6478
|
"main:main"
|
|
6461
|
-
]), n.typeId === "app")
|
|
6462
|
-
else if (n.typeId === "engine")
|
|
6463
|
-
else if (n.uploadGroupName === void 0)
|
|
6479
|
+
]), n.typeId === "app") $("7️⃣ Register module"), await Lr();
|
|
6480
|
+
else if (n.typeId === "engine") $("7️⃣ Register module"), await Br(e, `dpuse-engine-eu/${n.uploadGroupName ?? "unknown"}`), await zr(t);
|
|
6481
|
+
else if (n.uploadGroupName === void 0) $("7️⃣ Registration NOT required.");
|
|
6464
6482
|
else {
|
|
6465
|
-
|
|
6483
|
+
$("7️⃣ Register module");
|
|
6466
6484
|
let r = t.id.split("-").slice(2).join("-");
|
|
6467
|
-
await
|
|
6485
|
+
await Br(e, `dpuse-engine-eu/${n.uploadGroupName}/${r}`), await zr(t);
|
|
6468
6486
|
}
|
|
6469
6487
|
if (n.isPublished) {
|
|
6470
6488
|
let e = ".npmrc";
|
|
6471
6489
|
try {
|
|
6472
|
-
await
|
|
6490
|
+
await Ar(e, `registry=https://registry.npmjs.org/\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await X("8️⃣ Publish to npm", "npm", [
|
|
6473
6491
|
"publish",
|
|
6474
6492
|
"--access",
|
|
6475
6493
|
"public"
|
|
6476
6494
|
]);
|
|
6477
6495
|
} finally {
|
|
6478
|
-
await
|
|
6496
|
+
await Or(e);
|
|
6479
6497
|
}
|
|
6480
|
-
} else
|
|
6481
|
-
|
|
6498
|
+
} else $(`8️⃣ Publishing NOT required for package with type identifier of '${n.typeId}'.`);
|
|
6499
|
+
jr(`Project version '${e.version ?? "unknown"}' released.`);
|
|
6482
6500
|
} catch (e) {
|
|
6483
6501
|
console.error("❌ Error releasing project.", e), process.exit(1);
|
|
6484
6502
|
}
|
|
6485
6503
|
}
|
|
6504
|
+
async function Gr(e, t) {
|
|
6505
|
+
$(`${e} Build project configuration`);
|
|
6506
|
+
let n = await Z("config.json");
|
|
6507
|
+
return t.name != null && (n.id = t.name.replace("@dpuse/", "").replace("@dpuse/", "")), t.version != null && (n.version = t.version), await kr("config.json", n), n;
|
|
6508
|
+
}
|
|
6486
6509
|
async function Kr(e, t) {
|
|
6487
|
-
|
|
6488
|
-
let n = await
|
|
6489
|
-
|
|
6510
|
+
$(`${e} Build connector project configuration`);
|
|
6511
|
+
let [n, r] = await Promise.all([Z("config.json"), Dr("src/index.ts")]), i = /* @__PURE__ */ p(je, n);
|
|
6512
|
+
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
|
|
6513
|
+
let a = Pr(r);
|
|
6514
|
+
return await Xr(t, n, a, Yr(a));
|
|
6490
6515
|
}
|
|
6491
6516
|
async function qr(e, t) {
|
|
6492
|
-
|
|
6493
|
-
let [n, r] = await Promise.all([
|
|
6517
|
+
$(`${e} Build context project configuration`);
|
|
6518
|
+
let [n, r] = await Promise.all([Z("config.json"), Dr("src/index.ts")]), i = /* @__PURE__ */ p(Pe, n);
|
|
6494
6519
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
|
|
6495
|
-
|
|
6496
|
-
return await Zr(t, n, a, Xr(a));
|
|
6520
|
+
return await Xr(t, n, Pr(r));
|
|
6497
6521
|
}
|
|
6498
6522
|
async function Jr(e, t) {
|
|
6499
|
-
|
|
6500
|
-
let [n, r] = await Promise.all([
|
|
6501
|
-
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
|
|
6502
|
-
return await Zr(t, n, Fr(r));
|
|
6503
|
-
}
|
|
6504
|
-
async function Yr(e, t) {
|
|
6505
|
-
Q(`${e} Build presenter project configuration`);
|
|
6506
|
-
let [n, r] = await Promise.all([X("config.json"), Or("src/index.ts")]), i = /* @__PURE__ */ p(Ie, n);
|
|
6523
|
+
$(`${e} Build presenter project configuration`);
|
|
6524
|
+
let [n, r] = await Promise.all([Z("config.json"), Dr("src/index.ts")]), i = /* @__PURE__ */ p(Ie, n);
|
|
6507
6525
|
if (!i.success) throw console.error("❌ Configuration is invalid:"), console.table(i.issues), Error("Configuration is invalid.");
|
|
6508
|
-
return await
|
|
6526
|
+
return await Xr(t, n, Pr(r));
|
|
6509
6527
|
}
|
|
6510
|
-
function
|
|
6528
|
+
function Yr(e) {
|
|
6511
6529
|
let t = !1, n = !1;
|
|
6512
|
-
for (let r of e)
|
|
6530
|
+
for (let r of e) Hr.has(r) && (t = !0), Vr.has(r) && (n = !0);
|
|
6513
6531
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
6514
6532
|
}
|
|
6515
|
-
async function
|
|
6516
|
-
return n.length > 0 ? (console.info(`ℹ️ Implements ${n.length} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations."), r === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${r}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.operations = n, t.usageId = r ?? "unknown", await
|
|
6533
|
+
async function Xr(e, t, n, r) {
|
|
6534
|
+
return n.length > 0 ? (console.info(`ℹ️ Implements ${String(n.length)} operations:`), console.table(n)) : console.warn("⚠️ Implements no operations."), r === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${r ?? "unknown"}' usage.`), e.name != null && (t.id = e.name.replace("@dpuse/", "").replace("@dpuse/", "")), e.version != null && (t.version = e.version), t.operations = n, t.usageId = r ?? "unknown", await kr("config.json", t), t;
|
|
6517
6535
|
}
|
|
6518
|
-
async function
|
|
6536
|
+
async function Zr() {
|
|
6519
6537
|
try {
|
|
6520
|
-
|
|
6521
|
-
let e = await
|
|
6522
|
-
switch (await
|
|
6538
|
+
Q("Synchronise Project with GitHub");
|
|
6539
|
+
let e = await Z("package.json"), t = await Z("config.json");
|
|
6540
|
+
switch (await $r("1️⃣", e), Mr(t.id).typeId) {
|
|
6523
6541
|
case "connector":
|
|
6524
|
-
await
|
|
6542
|
+
await Kr("2️⃣", e);
|
|
6525
6543
|
break;
|
|
6526
6544
|
case "context":
|
|
6527
|
-
await
|
|
6545
|
+
await qr("2️⃣", e);
|
|
6528
6546
|
break;
|
|
6529
6547
|
case "presenter":
|
|
6530
|
-
await
|
|
6548
|
+
await Jr("2️⃣", e);
|
|
6531
6549
|
break;
|
|
6532
|
-
default: await
|
|
6550
|
+
default: await Gr("2️⃣", e);
|
|
6533
6551
|
}
|
|
6534
|
-
await
|
|
6552
|
+
await Y("3️⃣ Stage changes", "git", ["add", "."]), await Y("4️⃣ Commit changes", "git", [
|
|
6535
6553
|
"commit",
|
|
6536
6554
|
"-m",
|
|
6537
|
-
`"v${e.version}"`
|
|
6538
|
-
]), await
|
|
6555
|
+
`"v${e.version ?? "unknown"}"`
|
|
6556
|
+
]), await Y("5️⃣ Push changes", "git", [
|
|
6539
6557
|
"push",
|
|
6540
6558
|
"origin",
|
|
6541
6559
|
"main:main"
|
|
6542
|
-
]),
|
|
6560
|
+
]), jr(`Project version '${e.version ?? "unknown"}' synchronised with GitHub.`);
|
|
6543
6561
|
} catch (e) {
|
|
6544
6562
|
console.error("❌ Error synchronising project with GitHub.", e), process.exit(1);
|
|
6545
6563
|
}
|
|
6546
6564
|
}
|
|
6547
|
-
function
|
|
6565
|
+
function Qr() {
|
|
6548
6566
|
try {
|
|
6549
|
-
|
|
6567
|
+
Q("Test Project"), console.error("\n❌ No tests implemented.\n");
|
|
6550
6568
|
} catch (e) {
|
|
6551
6569
|
console.error("❌ Error testing project.", e), process.exit(1);
|
|
6552
6570
|
}
|
|
6553
6571
|
}
|
|
6554
|
-
async function
|
|
6555
|
-
if (
|
|
6572
|
+
async function $r(e, t, n = "./") {
|
|
6573
|
+
if ($(`${e} Bump project version`), t.version == null) t.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${t.version}'.`), await kr(`${n}package.json`, t);
|
|
6556
6574
|
else {
|
|
6557
6575
|
let e = t.version, r = t.version.split(".");
|
|
6558
|
-
t.version = `${r[0]}.${r[1]}.${Number(r[2]) + 1}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`), await
|
|
6576
|
+
t.version = `${r[0] ?? "unknown"}.${r[1] ?? "unknown"}.${String(Number(r[2]) + 1)}`, console.info(`Project version bumped from '${e}' to '${t.version}'.`), await kr(`${n}package.json`, t);
|
|
6559
6577
|
}
|
|
6560
6578
|
}
|
|
6561
6579
|
//#endregion
|
|
6562
6580
|
//#region src/operations/auditDependencies.ts
|
|
6563
|
-
var
|
|
6581
|
+
var ei = {
|
|
6564
6582
|
critical: {
|
|
6565
6583
|
color: "D32F2F",
|
|
6566
6584
|
label: "critical"
|
|
@@ -6581,16 +6599,16 @@ var ti = {
|
|
|
6581
6599
|
color: "616161",
|
|
6582
6600
|
label: "unknown"
|
|
6583
6601
|
}
|
|
6584
|
-
},
|
|
6585
|
-
async function
|
|
6602
|
+
}, ti = "<!-- OWASP_BADGES_START -->", ni = "<!-- OWASP_BADGES_END -->";
|
|
6603
|
+
async function ri() {
|
|
6586
6604
|
try {
|
|
6587
|
-
|
|
6588
|
-
let e = await
|
|
6605
|
+
Q("Audit Dependencies");
|
|
6606
|
+
let e = await Z("package.json"), t = [];
|
|
6589
6607
|
try {
|
|
6590
|
-
let e = (await
|
|
6608
|
+
let e = (await Er("dependency-check-bin")).toSorted((e, t) => e.localeCompare(t)).at(-1);
|
|
6591
6609
|
e != null && e !== "" && t.push("--owasp-bin", `dependency-check-bin/${e}/dependency-check/bin/dependency-check.sh`);
|
|
6592
6610
|
} catch {}
|
|
6593
|
-
await
|
|
6611
|
+
await X("1️⃣", "owasp-dependency-check", [
|
|
6594
6612
|
...t,
|
|
6595
6613
|
"--out",
|
|
6596
6614
|
"dependency-check-reports",
|
|
@@ -6599,15 +6617,19 @@ async function ii() {
|
|
|
6599
6617
|
"--enableRetired",
|
|
6600
6618
|
"--nodePackageSkipDevDependencies",
|
|
6601
6619
|
"--nvdApiKey",
|
|
6602
|
-
process.env.OWASP_NVD_API_KEY ?? ""
|
|
6603
|
-
|
|
6620
|
+
process.env.OWASP_NVD_API_KEY ?? "",
|
|
6621
|
+
"--ossIndexUsername",
|
|
6622
|
+
process.env.SONATYPE_USER_EMAIL ?? "",
|
|
6623
|
+
"--ossIndexPassword",
|
|
6624
|
+
process.env.SONATYPE_USER_TOKEN ?? ""
|
|
6625
|
+
]), await ii("2️⃣"), await X("3️⃣ Check using 'npm audit'", "npm", ["audit"]), jr("Dependencies audited.");
|
|
6604
6626
|
} catch (e) {
|
|
6605
6627
|
console.error("❌ Error auditing dependencies.", e), process.exit(1);
|
|
6606
6628
|
}
|
|
6607
6629
|
}
|
|
6608
|
-
async function
|
|
6609
|
-
|
|
6610
|
-
let t = await
|
|
6630
|
+
async function ii(e) {
|
|
6631
|
+
$(`${e} Insert OWASP Badge(s) into 'README.md'`);
|
|
6632
|
+
let t = await Z("dependency-check-reports/dependency-check-report.json"), n = {
|
|
6611
6633
|
critical: 0,
|
|
6612
6634
|
high: 0,
|
|
6613
6635
|
moderate: 0,
|
|
@@ -6616,53 +6638,53 @@ async function ai(e) {
|
|
|
6616
6638
|
};
|
|
6617
6639
|
for (let e of t.dependencies) if (e.vulnerabilities != null) for (let t of e.vulnerabilities) {
|
|
6618
6640
|
let e = t.severity?.toLowerCase() ?? "unknown";
|
|
6619
|
-
e
|
|
6641
|
+
Object.hasOwn(n, e) ? n[e]++ : n.unknown++;
|
|
6620
6642
|
}
|
|
6621
|
-
let r = await
|
|
6622
|
-
await
|
|
6643
|
+
let r = await ai(n);
|
|
6644
|
+
await Ar("README.md", Ir(await Dr("./README.md"), r.join(" "), ti, ni)), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
6623
6645
|
}
|
|
6624
|
-
async function
|
|
6625
|
-
let t = await
|
|
6646
|
+
async function ai(e) {
|
|
6647
|
+
let t = await Z("config.json"), n = [];
|
|
6626
6648
|
if (Object.values(e).reduce((e, t) => e + t, 0) === 0) console.info("No vulnerabilities found."), n.push(`[](https://dpuse.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
6627
6649
|
else for (let [r, i] of Object.entries(e)) {
|
|
6628
|
-
let e =
|
|
6629
|
-
if (console.warn(`⚠️ ${i} ${e.label} vulnerability(ies) found.`), i === 0) continue;
|
|
6630
|
-
let a = `https://img.shields.io/badge/OWASP-${i}%20${e.label}-${e.color}`;
|
|
6650
|
+
let e = ei[r];
|
|
6651
|
+
if (console.warn(`⚠️ ${String(i)} ${e.label} vulnerability(ies) found.`), i === 0) continue;
|
|
6652
|
+
let a = `https://img.shields.io/badge/OWASP-${String(i)}%20${e.label}-${e.color}`;
|
|
6631
6653
|
n.push(`[](https://dpuse.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
6632
6654
|
}
|
|
6633
6655
|
return n;
|
|
6634
6656
|
}
|
|
6635
6657
|
//#endregion
|
|
6636
6658
|
//#region src/operations/checkDependencies.ts
|
|
6637
|
-
async function
|
|
6659
|
+
async function oi() {
|
|
6638
6660
|
try {
|
|
6639
|
-
|
|
6661
|
+
Q("Check Dependencies"), await X("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), await X("2️⃣ Check using 'npm-check-updates'", "npm-check-updates", [
|
|
6640
6662
|
"-i",
|
|
6641
6663
|
"--dep",
|
|
6642
6664
|
"dev,prod,peer,optional"
|
|
6643
|
-
]),
|
|
6665
|
+
]), jr("Dependencies checked.");
|
|
6644
6666
|
} catch (e) {
|
|
6645
6667
|
console.error("❌ Error checking dependencies.", e), process.exit(1);
|
|
6646
6668
|
}
|
|
6647
6669
|
}
|
|
6648
6670
|
//#endregion
|
|
6649
6671
|
//#region src/operations/documentDependencies.ts
|
|
6650
|
-
var
|
|
6651
|
-
async function
|
|
6672
|
+
var si = "<!-- DEPENDENCY_LICENSES_START -->", ci = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
6673
|
+
async function li(e = [], t = !0) {
|
|
6652
6674
|
try {
|
|
6653
|
-
|
|
6675
|
+
Q("Document Dependencies");
|
|
6654
6676
|
let n = e.flatMap((e) => ["--allowed", `'${e}'`]);
|
|
6655
|
-
await
|
|
6677
|
+
await Y("1️⃣ Generate 'licenses.json' file", "license-report", [
|
|
6656
6678
|
"--config",
|
|
6657
6679
|
`'${s(new o(import.meta.resolve("@dpuse/dpuse-development/license-report-config")))}'`,
|
|
6658
6680
|
"--only=prod,peer",
|
|
6659
6681
|
"--output=json"
|
|
6660
|
-
], "licenses/licenses.json"), await
|
|
6682
|
+
], "licenses/licenses.json"), await Y("2️⃣ Check 'licenses.json' file", "license-report-check", [
|
|
6661
6683
|
"--source",
|
|
6662
6684
|
"licenses/licenses.json",
|
|
6663
6685
|
"--output=table",
|
|
6664
6686
|
...n
|
|
6665
|
-
]), t ? (await
|
|
6687
|
+
]), t ? (await Y("3️⃣ Generate 'licenseTree.json' file", "license-report-recursive", [
|
|
6666
6688
|
"--only=prod,peer",
|
|
6667
6689
|
"--output=tree",
|
|
6668
6690
|
"--recurse",
|
|
@@ -6670,15 +6692,15 @@ async function ui(e = [], t = !0) {
|
|
|
6670
6692
|
"--licensePeriod.value=n/a",
|
|
6671
6693
|
"--material.value=n/a",
|
|
6672
6694
|
"--relatedTo.value=n/a"
|
|
6673
|
-
], "licenses/licenseTree.json"), await
|
|
6695
|
+
], "licenses/licenseTree.json"), await Y("4️⃣ Check 'licenseTree.json' file", "license-report-check", [
|
|
6674
6696
|
"--source",
|
|
6675
6697
|
"licenses/licenseTree.json",
|
|
6676
6698
|
"--output=table",
|
|
6677
6699
|
...n
|
|
6678
|
-
])) : (
|
|
6700
|
+
])) : ($("3️⃣ Skip 'licenses/licenseTree.json' file generate"), $("4️⃣ Skip 'licenses/licenseTree.json' file check"));
|
|
6679
6701
|
let r = process.env.GITHUB_TOKEN;
|
|
6680
6702
|
if (r == null || r === "" || r.startsWith("op://")) throw Error("GITHUB_TOKEN is not resolved. Run the script via \"npm run document\" to use 1Password resolution.");
|
|
6681
|
-
await
|
|
6703
|
+
await Tr("licenses/downloads"), await Y("5️⃣ Download license files", "license-downloader", [
|
|
6682
6704
|
"--source",
|
|
6683
6705
|
"licenses/licenses.json",
|
|
6684
6706
|
"--licDir",
|
|
@@ -6686,16 +6708,14 @@ async function ui(e = [], t = !0) {
|
|
|
6686
6708
|
"--githubToken.tokenEnvVar",
|
|
6687
6709
|
"GITHUB_TOKEN",
|
|
6688
6710
|
"--download"
|
|
6689
|
-
]), await
|
|
6711
|
+
]), await ui("6️⃣", t), jr("Dependencies documented.");
|
|
6690
6712
|
} catch (e) {
|
|
6691
6713
|
console.error("❌ Error documenting dependencies.", e), process.exit(1);
|
|
6692
6714
|
}
|
|
6693
6715
|
}
|
|
6694
|
-
async function
|
|
6695
|
-
|
|
6696
|
-
let n = await
|
|
6697
|
-
t && (i = await X("licenses/licenseTree.json"));
|
|
6698
|
-
let a = [...(() => {
|
|
6716
|
+
async function ui(e, t) {
|
|
6717
|
+
$(`${e} Insert licenses into 'README.md'`);
|
|
6718
|
+
let n = await Z("licenses/licenses.json"), r = await Z("licenses/downloads/licenses.ext.json"), i = t ? await Z("licenses/licenseTree.json") : [], a = [...(() => {
|
|
6699
6719
|
let e = /* @__PURE__ */ new Map();
|
|
6700
6720
|
for (let t of n) e.set(t.name, { ...t });
|
|
6701
6721
|
for (let t of r) {
|
|
@@ -6715,46 +6735,46 @@ async function di(e, t) {
|
|
|
6715
6735
|
return e.values();
|
|
6716
6736
|
})()], o = "|Name|Type|Installed|Latest|Latest Released|Deps|Document|\n|:-|:-|:-:|:-:|:-|-:|:-|\n";
|
|
6717
6737
|
for (let e of a) {
|
|
6718
|
-
let t = e.installedVersion === e.remoteVersion ? e.installedVersion : `${e.installedVersion} ⚠️`, n = e.latestRemoteModified ?
|
|
6719
|
-
i = e.licenseFileLink == null || e.licenseFileLink == "" ? "⚠️ No license file" : `[${e.licenseFileLink.slice(Math.max(0, e.licenseFileLink.lastIndexOf("/") + 1))}](${e.licenseFileLink})`, o += `|${e.name}|${e.licenseType}|${t}|${e.remoteVersion}|${n}|${r}|${i}|\n`;
|
|
6738
|
+
let t = e.installedVersion === e.remoteVersion ? e.installedVersion : `${e.installedVersion} ⚠️`, n = e.latestRemoteModified ? di(e.latestRemoteModified.split("T", 1)[0]) : "n/a", r = e.dependencyCount != null && e.dependencyCount >= 0 ? e.dependencyCount : "n/a", i;
|
|
6739
|
+
i = e.licenseFileLink == null || e.licenseFileLink == "" ? "⚠️ No license file" : `[${e.licenseFileLink.slice(Math.max(0, e.licenseFileLink.lastIndexOf("/") + 1))}](${e.licenseFileLink})`, o += `|${e.name}|${e.licenseType}|${t}|${e.remoteVersion}|${n}|${String(r)}|${i}|\n`;
|
|
6720
6740
|
}
|
|
6721
|
-
let s =
|
|
6722
|
-
await
|
|
6741
|
+
let s = Ir(await Dr("./README.md"), o, si, ci);
|
|
6742
|
+
await Ar("README.md", s), console.info("OWASP audit badge(s) inserted into 'README.md'"), await Ar("README.md", s);
|
|
6723
6743
|
}
|
|
6724
|
-
function
|
|
6744
|
+
function di(e) {
|
|
6725
6745
|
if (e == null || e === "") return "n/a";
|
|
6726
|
-
let t = e.split("T")[0];
|
|
6746
|
+
let t = e.split("T", 1)[0];
|
|
6727
6747
|
if (t == null || t === "") return "n/a";
|
|
6728
6748
|
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
6729
|
-
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `1 month ago: ${t}` : i <= 6 ? `${i} months ago: ${t}` : i <= 12 ? `${i} months ago: ${t} ⚠️` : `${i} months ago: ${t}❗`;
|
|
6749
|
+
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `1 month ago: ${t}` : i <= 6 ? `${String(i)} months ago: ${t}` : i <= 12 ? `${String(i)} months ago: ${t} ⚠️` : `${String(i)} months ago: ${t}❗`;
|
|
6730
6750
|
}
|
|
6731
6751
|
//#endregion
|
|
6732
6752
|
//#region src/operations/formatCode.ts
|
|
6733
|
-
async function
|
|
6753
|
+
async function fi() {
|
|
6734
6754
|
try {
|
|
6735
|
-
|
|
6755
|
+
Q("Format Code"), await X("1️⃣ Format", "prettier", [
|
|
6736
6756
|
"--write",
|
|
6737
6757
|
"*.json",
|
|
6738
6758
|
"*.md",
|
|
6739
6759
|
"*.ts",
|
|
6740
6760
|
...["app", "src"].filter((t) => e(t)).map((e) => `${e}/**`)
|
|
6741
|
-
]),
|
|
6761
|
+
]), jr("Code formatted.");
|
|
6742
6762
|
} catch (e) {
|
|
6743
6763
|
console.error("❌ Error formatting code.", e), process.exit(1);
|
|
6744
6764
|
}
|
|
6745
6765
|
}
|
|
6746
6766
|
//#endregion
|
|
6747
6767
|
//#region src/operations/lintCode.ts
|
|
6748
|
-
async function
|
|
6768
|
+
async function pi() {
|
|
6749
6769
|
try {
|
|
6750
|
-
|
|
6770
|
+
Q("Lint Code"), await X("1️⃣ Lint", "eslint", ["."]), jr("Code linted.");
|
|
6751
6771
|
} catch (e) {
|
|
6752
6772
|
console.error("❌ Error linting code.", e), process.exit(1);
|
|
6753
6773
|
}
|
|
6754
6774
|
}
|
|
6755
6775
|
//#endregion
|
|
6756
6776
|
//#region src/operations/updateDPUseDependencies.ts
|
|
6757
|
-
var
|
|
6777
|
+
var mi = [
|
|
6758
6778
|
"1️⃣",
|
|
6759
6779
|
"2️⃣",
|
|
6760
6780
|
"3️⃣",
|
|
@@ -6765,36 +6785,36 @@ var hi = [
|
|
|
6765
6785
|
"8️⃣",
|
|
6766
6786
|
"9️⃣"
|
|
6767
6787
|
];
|
|
6768
|
-
async function
|
|
6788
|
+
async function hi(e = []) {
|
|
6769
6789
|
try {
|
|
6770
|
-
|
|
6790
|
+
Q("Update '@dpuse/dpuse' Dependencies");
|
|
6771
6791
|
for (let [t, n] of e.entries()) {
|
|
6772
|
-
let e =
|
|
6773
|
-
n === "eslint" ? await
|
|
6792
|
+
let e = mi.at(t) ?? "🔢";
|
|
6793
|
+
n === "eslint" ? await X(`${e} Update '${n}'`, "npm", ["install", "@dpuse/eslint-config-dpuse@latest"]) : (await X(`${e} Update '${n}'`, "npm", ["install", `@dpuse/dpuse-${n}@latest`]), n === "development" && await gi(Mr((await Z("config.json")).id)));
|
|
6774
6794
|
}
|
|
6775
|
-
|
|
6795
|
+
jr("'@dpuse/dpuse' dependencies updated.");
|
|
6776
6796
|
} catch (e) {
|
|
6777
6797
|
console.error("❌ Error updating '@dpuse/dpuse' dependencies.", e), process.exit(1);
|
|
6778
6798
|
}
|
|
6779
6799
|
}
|
|
6780
|
-
async function
|
|
6800
|
+
async function gi(e) {
|
|
6781
6801
|
let t = n.dirname(s(import.meta.url));
|
|
6782
|
-
await
|
|
6802
|
+
await _i(t, "../", ".editorconfig"), await _i(t, "../", ".gitattributes"), await _i(t, "../", e.isPublished ? ".gitignore_published" : ".gitignore_unpublished", ".gitignore2"), await _i(t, "../", ".markdownlint.json"), await _i(t, "../", "LICENSE"), await _i(t, "../", "tsconfig.json", "tsconfig2.json"), e.typeId === "eslint" || (await _i(t, "../", "eslint.config.ts", "eslint.config2.ts"), await _i(t, "../", "vite.config.ts", "vite.config2.ts"), await _i(t, "../", "vitest.config.ts", "vitest.config2.ts"));
|
|
6783
6803
|
}
|
|
6784
|
-
async function
|
|
6785
|
-
let a = await
|
|
6804
|
+
async function _i(e, t, r, i) {
|
|
6805
|
+
let a = await Dr(n.resolve(e, `${t}${r}`)), o = n.resolve(process.cwd(), r.split("_", 1)[0] ?? r), s = n.resolve(process.cwd(), i ?? r), c;
|
|
6786
6806
|
try {
|
|
6787
|
-
c = await
|
|
6807
|
+
c = await Dr(o);
|
|
6788
6808
|
} catch (e) {
|
|
6789
6809
|
if (e.code !== "ENOENT") throw e;
|
|
6790
6810
|
}
|
|
6791
6811
|
if (c === a) {
|
|
6792
|
-
console.info(`ℹ️ File '${r.split("_")[0] ?? r}' is already up to date.`);
|
|
6812
|
+
console.info(`ℹ️ File '${r.split("_", 1)[0] ?? r}' is already up to date.`);
|
|
6793
6813
|
return;
|
|
6794
6814
|
}
|
|
6795
|
-
await
|
|
6815
|
+
await Ar(s, a), console.info(`ℹ️ File '${i ?? r}' synchronised.`);
|
|
6796
6816
|
}
|
|
6797
6817
|
//#endregion
|
|
6798
|
-
export {
|
|
6818
|
+
export { ri as auditDependencies, Ur as buildProject, oi as checkDependencies, li as documentDependencies, fi as formatCode, pi as lintCode, Wr as releaseProject, Zr as syncProjectWithGitHub, Qr as testProject, hi as updateDPUseDependencies, Rr as uploadDirectoryToR2 };
|
|
6799
6819
|
|
|
6800
6820
|
//# sourceMappingURL=dpuse-development.es.js.map
|