@digipair/skill-web 0.103.2 → 0.105.2
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/index.esm.js +113 -57
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -23903,14 +23903,14 @@ function indent(str, spaces) {
|
|
|
23903
23903
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23904
23904
|
// match is required
|
|
23905
23905
|
if (!match) {
|
|
23906
|
-
return
|
|
23906
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
|
|
23907
23907
|
v: nextMatch1
|
|
23908
23908
|
};
|
|
23909
23909
|
}
|
|
23910
23910
|
var token = match.token, offset = match.offset;
|
|
23911
23911
|
i1 += offset;
|
|
23912
23912
|
if (token === " ") {
|
|
23913
|
-
return
|
|
23913
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23914
23914
|
}
|
|
23915
23915
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
|
23916
23916
|
token
|
|
@@ -23929,7 +23929,7 @@ function indent(str, spaces) {
|
|
|
23929
23929
|
if (contextKeys.some(function(el) {
|
|
23930
23930
|
return el.startsWith(name);
|
|
23931
23931
|
})) {
|
|
23932
|
-
return
|
|
23932
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23933
23933
|
}
|
|
23934
23934
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23935
23935
|
return el === name;
|
|
@@ -23948,9 +23948,9 @@ function indent(str, spaces) {
|
|
|
23948
23948
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23949
23949
|
return el.startsWith(name);
|
|
23950
23950
|
})) {
|
|
23951
|
-
return
|
|
23951
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23952
23952
|
}
|
|
23953
|
-
return
|
|
23953
|
+
return i = i1, nextMatch = nextMatch1,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q!['w~+YO$]~~+_O$s~R+fP!]QsP!_!`+iP+nOsPR+uP!YQsP!_!`+i~+}O$l~~,SO!i~~,XO!g~~,[WOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u<%lO,X~,wRO;'S,X;'S;=`-Q;=`O,X~-TXOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u;=`<%l,X<%lO,X~-uO$Z~~-xP;=`<%l,X~.QO#S~~.VO#R~",
|
|
24818
24818
|
tokenizers: [
|
|
24819
24819
|
propertyIdentifiers,
|
|
24820
24820
|
identifiers,
|
|
@@ -25330,6 +25330,9 @@ function parseParameterNames(fn) {
|
|
|
25330
25330
|
function notImplemented(thing) {
|
|
25331
25331
|
return new Error("not implemented: ".concat(thing));
|
|
25332
25332
|
}
|
|
25333
|
+
function isNotImplemented(err) {
|
|
25334
|
+
return /^not implemented/.test(err.message);
|
|
25335
|
+
}
|
|
25333
25336
|
/**
|
|
25334
25337
|
* Returns a name from context or undefined if it does not exist.
|
|
25335
25338
|
*
|
|
@@ -25450,6 +25453,9 @@ var builtins = {
|
|
|
25450
25453
|
d = from;
|
|
25451
25454
|
}
|
|
25452
25455
|
if (year) {
|
|
25456
|
+
if (!isNumber(month) || !isNumber(day)) {
|
|
25457
|
+
return null;
|
|
25458
|
+
}
|
|
25453
25459
|
d = date().setZone("utc").set({
|
|
25454
25460
|
year: year,
|
|
25455
25461
|
month: month,
|
|
@@ -25504,7 +25510,7 @@ var builtins = {
|
|
|
25504
25510
|
from = hour;
|
|
25505
25511
|
hour = null;
|
|
25506
25512
|
}
|
|
25507
|
-
if (isString(from)) {
|
|
25513
|
+
if (isString(from) && from) {
|
|
25508
25514
|
t = date(null, from);
|
|
25509
25515
|
}
|
|
25510
25516
|
if (isDateTime(from)) {
|
|
@@ -25515,6 +25521,9 @@ var builtins = {
|
|
|
25515
25521
|
});
|
|
25516
25522
|
}
|
|
25517
25523
|
if (isNumber(hour)) {
|
|
25524
|
+
if (!isNumber(minute) || !isNumber(second)) {
|
|
25525
|
+
return null;
|
|
25526
|
+
}
|
|
25518
25527
|
// TODO: support offset = days and time duration
|
|
25519
25528
|
t = date().set({
|
|
25520
25529
|
hour: hour,
|
|
@@ -25624,7 +25633,8 @@ var builtins = {
|
|
|
25624
25633
|
"string"
|
|
25625
25634
|
]),
|
|
25626
25635
|
"replace": fn(function(input, pattern, replacement, flags) {
|
|
25627
|
-
|
|
25636
|
+
var regexp = createRegexp(pattern, flags || "", "g");
|
|
25637
|
+
return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
|
|
25628
25638
|
}, [
|
|
25629
25639
|
"string",
|
|
25630
25640
|
"string",
|
|
@@ -25637,9 +25647,9 @@ var builtins = {
|
|
|
25637
25647
|
"string",
|
|
25638
25648
|
"string"
|
|
25639
25649
|
]),
|
|
25640
|
-
// eslint-disable-next-line
|
|
25641
25650
|
"matches": fn(function(input, pattern, flags) {
|
|
25642
|
-
|
|
25651
|
+
var regexp = createRegexp(pattern, flags || "", "");
|
|
25652
|
+
return regexp && regexp.test(input);
|
|
25643
25653
|
}, [
|
|
25644
25654
|
"string",
|
|
25645
25655
|
"string",
|
|
@@ -25658,7 +25668,8 @@ var builtins = {
|
|
|
25658
25668
|
"string"
|
|
25659
25669
|
]),
|
|
25660
25670
|
"split": fn(function(string, delimiter) {
|
|
25661
|
-
|
|
25671
|
+
var regexp = createRegexp(delimiter, "", "");
|
|
25672
|
+
return regexp && string.split(regexp);
|
|
25662
25673
|
}, [
|
|
25663
25674
|
"string",
|
|
25664
25675
|
"string"
|
|
@@ -26574,6 +26585,35 @@ function mode(array) {
|
|
|
26574
26585
|
function ifValid(o) {
|
|
26575
26586
|
return o.isValid ? o : null;
|
|
26576
26587
|
}
|
|
26588
|
+
/**
|
|
26589
|
+
* Concatenates flags for a regular expression.
|
|
26590
|
+
*
|
|
26591
|
+
* Ensures that default flags are included without duplication, even if
|
|
26592
|
+
* user-specified flags overlap with the defaults.
|
|
26593
|
+
*/ function buildFlags(flags, defaultFlags) {
|
|
26594
|
+
var unsupportedFlags = flags.replace(/[smix]/g, "");
|
|
26595
|
+
if (unsupportedFlags) {
|
|
26596
|
+
throw new Error("illegal flags: " + unsupportedFlags);
|
|
26597
|
+
}
|
|
26598
|
+
// we don't implement the <x> flag
|
|
26599
|
+
if (/x/.test(flags)) {
|
|
26600
|
+
throw notImplemented("matches <x> flag");
|
|
26601
|
+
}
|
|
26602
|
+
return flags + defaultFlags;
|
|
26603
|
+
}
|
|
26604
|
+
/**
|
|
26605
|
+
* Creates a regular expression from a given pattern
|
|
26606
|
+
*/ function createRegexp(pattern, flags) {
|
|
26607
|
+
var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
26608
|
+
try {
|
|
26609
|
+
return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
|
|
26610
|
+
} catch (_err) {
|
|
26611
|
+
if (isNotImplemented(_err)) {
|
|
26612
|
+
throw _err;
|
|
26613
|
+
}
|
|
26614
|
+
}
|
|
26615
|
+
return null;
|
|
26616
|
+
}
|
|
26577
26617
|
function parseExpression(expression) {
|
|
26578
26618
|
var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
|
|
26579
26619
|
return parser.configure({
|
|
@@ -27028,27 +27068,59 @@ function evalNode(node, input, args) {
|
|
|
27028
27068
|
};
|
|
27029
27069
|
case "Type":
|
|
27030
27070
|
return args[0];
|
|
27071
|
+
// (x in [ [1,2], [3,4] ]), (y in x)
|
|
27031
27072
|
case "InExpressions":
|
|
27032
27073
|
return function(context) {
|
|
27033
|
-
|
|
27034
|
-
|
|
27035
|
-
|
|
27036
|
-
|
|
27037
|
-
|
|
27038
|
-
|
|
27039
|
-
|
|
27040
|
-
|
|
27041
|
-
|
|
27042
|
-
|
|
27043
|
-
|
|
27044
|
-
|
|
27045
|
-
|
|
27046
|
-
|
|
27074
|
+
// we build up evaluation contexts from left to right,
|
|
27075
|
+
// ending up with the cartesian product over all available contexts
|
|
27076
|
+
//
|
|
27077
|
+
// previous context is provided to later context providers
|
|
27078
|
+
// producing <null> as a context during evaluation causes the
|
|
27079
|
+
// whole result to turn <null>
|
|
27080
|
+
var isValidContexts = function(contexts) {
|
|
27081
|
+
if (contexts === null || contexts.some(function(arr) {
|
|
27082
|
+
return getType(arr) === "nil";
|
|
27083
|
+
})) {
|
|
27084
|
+
return false;
|
|
27085
|
+
}
|
|
27086
|
+
return true;
|
|
27087
|
+
};
|
|
27088
|
+
var join = function(aContexts, bContextProducer) {
|
|
27089
|
+
var _instance;
|
|
27090
|
+
return (_instance = []).concat.apply(_instance, _to_consumable_array(aContexts.map(function(aContext) {
|
|
27091
|
+
var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
|
|
27092
|
+
if (!isValidContexts(bContexts)) {
|
|
27093
|
+
return null;
|
|
27094
|
+
}
|
|
27095
|
+
return bContexts.map(function(bContext) {
|
|
27096
|
+
return Object.assign(Object.assign({}, aContext), bContext);
|
|
27097
|
+
});
|
|
27098
|
+
})));
|
|
27099
|
+
};
|
|
27100
|
+
var cartesian = function(aContexts, bContextProducer) {
|
|
27101
|
+
for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
27102
|
+
otherContextProducers[_key - 2] = arguments[_key];
|
|
27103
|
+
}
|
|
27104
|
+
if (!isValidContexts(aContexts)) {
|
|
27105
|
+
return null;
|
|
27106
|
+
}
|
|
27107
|
+
if (!bContextProducer) {
|
|
27108
|
+
return aContexts;
|
|
27047
27109
|
}
|
|
27048
|
-
return
|
|
27049
|
-
|
|
27050
|
-
|
|
27051
|
-
|
|
27110
|
+
return cartesian.apply(void 0, [
|
|
27111
|
+
join(aContexts, bContextProducer)
|
|
27112
|
+
].concat(_to_consumable_array(otherContextProducers)));
|
|
27113
|
+
};
|
|
27114
|
+
var cartesianProduct = function(contextProducers) {
|
|
27115
|
+
var _contextProducers = _to_array(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
|
|
27116
|
+
var aContexts = aContextProducer(context);
|
|
27117
|
+
return cartesian.apply(void 0, [
|
|
27118
|
+
aContexts
|
|
27119
|
+
].concat(_to_consumable_array(otherContextProducers)));
|
|
27120
|
+
};
|
|
27121
|
+
var product = cartesianProduct(args);
|
|
27122
|
+
return product && product.map(function(p) {
|
|
27123
|
+
return Object.assign(Object.assign({}, context), p);
|
|
27052
27124
|
});
|
|
27053
27125
|
};
|
|
27054
27126
|
// Name kw<"in"> Expr
|
|
@@ -27678,31 +27750,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
|
|
|
27678
27750
|
includes: includes
|
|
27679
27751
|
});
|
|
27680
27752
|
}
|
|
27681
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27682
|
-
function cartesianProduct(arrays) {
|
|
27683
|
-
var _instance;
|
|
27684
|
-
if (arrays.some(function(arr) {
|
|
27685
|
-
return getType(arr) === "nil";
|
|
27686
|
-
})) {
|
|
27687
|
-
return null;
|
|
27688
|
-
}
|
|
27689
|
-
var f = function(a, b) {
|
|
27690
|
-
return (_instance = []).concat.apply(_instance, _to_consumable_array(a.map(function(d) {
|
|
27691
|
-
return b.map(function(e) {
|
|
27692
|
-
return [].concat(d, e);
|
|
27693
|
-
});
|
|
27694
|
-
})));
|
|
27695
|
-
};
|
|
27696
|
-
var cartesian = function(a, b) {
|
|
27697
|
-
for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
27698
|
-
c[_key - 2] = arguments[_key];
|
|
27699
|
-
}
|
|
27700
|
-
return b ? cartesian.apply(void 0, [
|
|
27701
|
-
f(a, b)
|
|
27702
|
-
].concat(_to_consumable_array(c))) : a || [];
|
|
27703
|
-
};
|
|
27704
|
-
return cartesian.apply(void 0, _to_consumable_array(arrays));
|
|
27705
|
-
}
|
|
27706
27753
|
function coalecenseTypes(a, b) {
|
|
27707
27754
|
if (!b) {
|
|
27708
27755
|
return a.type;
|
|
@@ -27764,15 +27811,24 @@ function parseString(str) {
|
|
|
27764
27811
|
if (str.endsWith('"')) {
|
|
27765
27812
|
str = str.slice(0, -1);
|
|
27766
27813
|
}
|
|
27767
|
-
return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
27814
|
+
return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
27768
27815
|
for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
27769
27816
|
groups[_key - 1] = arguments[_key];
|
|
27770
27817
|
}
|
|
27771
|
-
var _groups = _sliced_to_array(groups,
|
|
27818
|
+
var _groups = _sliced_to_array(groups, 7), quotes = _groups[0], backslash = _groups[1], newline = _groups[2], carriageReturn = _groups[3], tab = _groups[4], codePoint = _groups[5], charCodes = _groups[6];
|
|
27772
27819
|
if (quotes) {
|
|
27773
27820
|
return '"';
|
|
27774
27821
|
}
|
|
27775
|
-
if (
|
|
27822
|
+
if (newline) {
|
|
27823
|
+
return "\n";
|
|
27824
|
+
}
|
|
27825
|
+
if (carriageReturn) {
|
|
27826
|
+
return "\r";
|
|
27827
|
+
}
|
|
27828
|
+
if (tab) {
|
|
27829
|
+
return " ";
|
|
27830
|
+
}
|
|
27831
|
+
if (backslash) {
|
|
27776
27832
|
return "\\";
|
|
27777
27833
|
}
|
|
27778
27834
|
var escapePattern = /\\u([a-fA-F0-9]+)/ig;
|