@digipair/skill-sse 0.104.0 → 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
|
@@ -25127,14 +25127,14 @@ function indent(str, spaces) {
|
|
|
25127
25127
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
25128
25128
|
// match is required
|
|
25129
25129
|
if (!match) {
|
|
25130
|
-
return
|
|
25130
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
|
|
25131
25131
|
v: nextMatch1
|
|
25132
25132
|
};
|
|
25133
25133
|
}
|
|
25134
25134
|
var token = match.token, offset = match.offset;
|
|
25135
25135
|
i1 += offset;
|
|
25136
25136
|
if (token === " ") {
|
|
25137
|
-
return
|
|
25137
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
|
25138
25138
|
}
|
|
25139
25139
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
|
25140
25140
|
token
|
|
@@ -25153,7 +25153,7 @@ function indent(str, spaces) {
|
|
|
25153
25153
|
if (contextKeys.some(function(el) {
|
|
25154
25154
|
return el.startsWith(name);
|
|
25155
25155
|
})) {
|
|
25156
|
-
return
|
|
25156
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
|
25157
25157
|
}
|
|
25158
25158
|
if (dateTimeIdentifiers.some(function(el) {
|
|
25159
25159
|
return el === name;
|
|
@@ -25172,9 +25172,9 @@ function indent(str, spaces) {
|
|
|
25172
25172
|
if (dateTimeIdentifiers.some(function(el) {
|
|
25173
25173
|
return el.startsWith(name);
|
|
25174
25174
|
})) {
|
|
25175
|
-
return
|
|
25175
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
|
25176
25176
|
}
|
|
25177
|
-
return
|
|
25177
|
+
return tokens = tokens1, nextMatch = next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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~",
|
|
26042
26042
|
tokenizers: [
|
|
26043
26043
|
propertyIdentifiers,
|
|
26044
26044
|
identifiers,
|
|
@@ -26554,6 +26554,9 @@ function parseParameterNames(fn) {
|
|
|
26554
26554
|
function notImplemented(thing) {
|
|
26555
26555
|
return new Error("not implemented: ".concat(thing));
|
|
26556
26556
|
}
|
|
26557
|
+
function isNotImplemented(err) {
|
|
26558
|
+
return /^not implemented/.test(err.message);
|
|
26559
|
+
}
|
|
26557
26560
|
/**
|
|
26558
26561
|
* Returns a name from context or undefined if it does not exist.
|
|
26559
26562
|
*
|
|
@@ -26674,6 +26677,9 @@ var builtins = {
|
|
|
26674
26677
|
d = from;
|
|
26675
26678
|
}
|
|
26676
26679
|
if (year) {
|
|
26680
|
+
if (!isNumber(month) || !isNumber(day)) {
|
|
26681
|
+
return null;
|
|
26682
|
+
}
|
|
26677
26683
|
d = date().setZone("utc").set({
|
|
26678
26684
|
year: year,
|
|
26679
26685
|
month: month,
|
|
@@ -26728,7 +26734,7 @@ var builtins = {
|
|
|
26728
26734
|
from = hour;
|
|
26729
26735
|
hour = null;
|
|
26730
26736
|
}
|
|
26731
|
-
if (isString(from)) {
|
|
26737
|
+
if (isString(from) && from) {
|
|
26732
26738
|
t = date(null, from);
|
|
26733
26739
|
}
|
|
26734
26740
|
if (isDateTime(from)) {
|
|
@@ -26739,6 +26745,9 @@ var builtins = {
|
|
|
26739
26745
|
});
|
|
26740
26746
|
}
|
|
26741
26747
|
if (isNumber(hour)) {
|
|
26748
|
+
if (!isNumber(minute) || !isNumber(second)) {
|
|
26749
|
+
return null;
|
|
26750
|
+
}
|
|
26742
26751
|
// TODO: support offset = days and time duration
|
|
26743
26752
|
t = date().set({
|
|
26744
26753
|
hour: hour,
|
|
@@ -26848,7 +26857,8 @@ var builtins = {
|
|
|
26848
26857
|
"string"
|
|
26849
26858
|
]),
|
|
26850
26859
|
"replace": fn(function(input, pattern, replacement, flags) {
|
|
26851
|
-
|
|
26860
|
+
var regexp = createRegexp(pattern, flags || "", "g");
|
|
26861
|
+
return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
|
|
26852
26862
|
}, [
|
|
26853
26863
|
"string",
|
|
26854
26864
|
"string",
|
|
@@ -26861,9 +26871,9 @@ var builtins = {
|
|
|
26861
26871
|
"string",
|
|
26862
26872
|
"string"
|
|
26863
26873
|
]),
|
|
26864
|
-
// eslint-disable-next-line
|
|
26865
26874
|
"matches": fn(function(input, pattern, flags) {
|
|
26866
|
-
|
|
26875
|
+
var regexp = createRegexp(pattern, flags || "", "");
|
|
26876
|
+
return regexp && regexp.test(input);
|
|
26867
26877
|
}, [
|
|
26868
26878
|
"string",
|
|
26869
26879
|
"string",
|
|
@@ -26882,7 +26892,8 @@ var builtins = {
|
|
|
26882
26892
|
"string"
|
|
26883
26893
|
]),
|
|
26884
26894
|
"split": fn(function(string, delimiter) {
|
|
26885
|
-
|
|
26895
|
+
var regexp = createRegexp(delimiter, "", "");
|
|
26896
|
+
return regexp && string.split(regexp);
|
|
26886
26897
|
}, [
|
|
26887
26898
|
"string",
|
|
26888
26899
|
"string"
|
|
@@ -27798,6 +27809,35 @@ function mode(array) {
|
|
|
27798
27809
|
function ifValid(o) {
|
|
27799
27810
|
return o.isValid ? o : null;
|
|
27800
27811
|
}
|
|
27812
|
+
/**
|
|
27813
|
+
* Concatenates flags for a regular expression.
|
|
27814
|
+
*
|
|
27815
|
+
* Ensures that default flags are included without duplication, even if
|
|
27816
|
+
* user-specified flags overlap with the defaults.
|
|
27817
|
+
*/ function buildFlags(flags, defaultFlags) {
|
|
27818
|
+
var unsupportedFlags = flags.replace(/[smix]/g, "");
|
|
27819
|
+
if (unsupportedFlags) {
|
|
27820
|
+
throw new Error("illegal flags: " + unsupportedFlags);
|
|
27821
|
+
}
|
|
27822
|
+
// we don't implement the <x> flag
|
|
27823
|
+
if (/x/.test(flags)) {
|
|
27824
|
+
throw notImplemented("matches <x> flag");
|
|
27825
|
+
}
|
|
27826
|
+
return flags + defaultFlags;
|
|
27827
|
+
}
|
|
27828
|
+
/**
|
|
27829
|
+
* Creates a regular expression from a given pattern
|
|
27830
|
+
*/ function createRegexp(pattern, flags) {
|
|
27831
|
+
var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
27832
|
+
try {
|
|
27833
|
+
return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
|
|
27834
|
+
} catch (_err) {
|
|
27835
|
+
if (isNotImplemented(_err)) {
|
|
27836
|
+
throw _err;
|
|
27837
|
+
}
|
|
27838
|
+
}
|
|
27839
|
+
return null;
|
|
27840
|
+
}
|
|
27801
27841
|
function parseExpression(expression) {
|
|
27802
27842
|
var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
|
|
27803
27843
|
return parser.configure({
|
|
@@ -28252,27 +28292,59 @@ function evalNode(node, input, args) {
|
|
|
28252
28292
|
};
|
|
28253
28293
|
case "Type":
|
|
28254
28294
|
return args[0];
|
|
28295
|
+
// (x in [ [1,2], [3,4] ]), (y in x)
|
|
28255
28296
|
case "InExpressions":
|
|
28256
28297
|
return function(context) {
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28298
|
+
// we build up evaluation contexts from left to right,
|
|
28299
|
+
// ending up with the cartesian product over all available contexts
|
|
28300
|
+
//
|
|
28301
|
+
// previous context is provided to later context providers
|
|
28302
|
+
// producing <null> as a context during evaluation causes the
|
|
28303
|
+
// whole result to turn <null>
|
|
28304
|
+
var isValidContexts = function(contexts) {
|
|
28305
|
+
if (contexts === null || contexts.some(function(arr) {
|
|
28306
|
+
return getType(arr) === "nil";
|
|
28307
|
+
})) {
|
|
28308
|
+
return false;
|
|
28309
|
+
}
|
|
28310
|
+
return true;
|
|
28311
|
+
};
|
|
28312
|
+
var join = function(aContexts, bContextProducer) {
|
|
28313
|
+
var _instance;
|
|
28314
|
+
return (_instance = []).concat.apply(_instance, _to_consumable_array(aContexts.map(function(aContext) {
|
|
28315
|
+
var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
|
|
28316
|
+
if (!isValidContexts(bContexts)) {
|
|
28317
|
+
return null;
|
|
28318
|
+
}
|
|
28319
|
+
return bContexts.map(function(bContext) {
|
|
28320
|
+
return Object.assign(Object.assign({}, aContext), bContext);
|
|
28321
|
+
});
|
|
28322
|
+
})));
|
|
28323
|
+
};
|
|
28324
|
+
var cartesian = function(aContexts, bContextProducer) {
|
|
28325
|
+
for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
28326
|
+
otherContextProducers[_key - 2] = arguments[_key];
|
|
28327
|
+
}
|
|
28328
|
+
if (!isValidContexts(aContexts)) {
|
|
28329
|
+
return null;
|
|
28330
|
+
}
|
|
28331
|
+
if (!bContextProducer) {
|
|
28332
|
+
return aContexts;
|
|
28271
28333
|
}
|
|
28272
|
-
return
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
|
|
28334
|
+
return cartesian.apply(void 0, [
|
|
28335
|
+
join(aContexts, bContextProducer)
|
|
28336
|
+
].concat(_to_consumable_array(otherContextProducers)));
|
|
28337
|
+
};
|
|
28338
|
+
var cartesianProduct = function(contextProducers) {
|
|
28339
|
+
var _contextProducers = _to_array(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
|
|
28340
|
+
var aContexts = aContextProducer(context);
|
|
28341
|
+
return cartesian.apply(void 0, [
|
|
28342
|
+
aContexts
|
|
28343
|
+
].concat(_to_consumable_array(otherContextProducers)));
|
|
28344
|
+
};
|
|
28345
|
+
var product = cartesianProduct(args);
|
|
28346
|
+
return product && product.map(function(p) {
|
|
28347
|
+
return Object.assign(Object.assign({}, context), p);
|
|
28276
28348
|
});
|
|
28277
28349
|
};
|
|
28278
28350
|
// Name kw<"in"> Expr
|
|
@@ -28902,31 +28974,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
|
|
|
28902
28974
|
includes: includes
|
|
28903
28975
|
});
|
|
28904
28976
|
}
|
|
28905
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28906
|
-
function cartesianProduct(arrays) {
|
|
28907
|
-
var _instance;
|
|
28908
|
-
if (arrays.some(function(arr) {
|
|
28909
|
-
return getType(arr) === "nil";
|
|
28910
|
-
})) {
|
|
28911
|
-
return null;
|
|
28912
|
-
}
|
|
28913
|
-
var f = function(a, b) {
|
|
28914
|
-
return (_instance = []).concat.apply(_instance, _to_consumable_array(a.map(function(d) {
|
|
28915
|
-
return b.map(function(e) {
|
|
28916
|
-
return [].concat(d, e);
|
|
28917
|
-
});
|
|
28918
|
-
})));
|
|
28919
|
-
};
|
|
28920
|
-
var cartesian = function(a, b) {
|
|
28921
|
-
for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
28922
|
-
c[_key - 2] = arguments[_key];
|
|
28923
|
-
}
|
|
28924
|
-
return b ? cartesian.apply(void 0, [
|
|
28925
|
-
f(a, b)
|
|
28926
|
-
].concat(_to_consumable_array(c))) : a || [];
|
|
28927
|
-
};
|
|
28928
|
-
return cartesian.apply(void 0, _to_consumable_array(arrays));
|
|
28929
|
-
}
|
|
28930
28977
|
function coalecenseTypes(a, b) {
|
|
28931
28978
|
if (!b) {
|
|
28932
28979
|
return a.type;
|
|
@@ -28988,15 +29035,24 @@ function parseString(str) {
|
|
|
28988
29035
|
if (str.endsWith('"')) {
|
|
28989
29036
|
str = str.slice(0, -1);
|
|
28990
29037
|
}
|
|
28991
|
-
return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
29038
|
+
return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
28992
29039
|
for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
28993
29040
|
groups[_key - 1] = arguments[_key];
|
|
28994
29041
|
}
|
|
28995
|
-
var _groups = _sliced_to_array(groups,
|
|
29042
|
+
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];
|
|
28996
29043
|
if (quotes) {
|
|
28997
29044
|
return '"';
|
|
28998
29045
|
}
|
|
28999
|
-
if (
|
|
29046
|
+
if (newline) {
|
|
29047
|
+
return "\n";
|
|
29048
|
+
}
|
|
29049
|
+
if (carriageReturn) {
|
|
29050
|
+
return "\r";
|
|
29051
|
+
}
|
|
29052
|
+
if (tab) {
|
|
29053
|
+
return " ";
|
|
29054
|
+
}
|
|
29055
|
+
if (backslash) {
|
|
29000
29056
|
return "\\";
|
|
29001
29057
|
}
|
|
29002
29058
|
var escapePattern = /\\u([a-fA-F0-9]+)/ig;
|