@digipair/skill-web-notification 0.104.0 → 0.105.3

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.
Files changed (3) hide show
  1. package/index.cjs.js +113 -57
  2. package/index.esm.js +113 -57
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -23921,14 +23921,14 @@ function indent(str, spaces) {
23921
23921
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23922
23922
  // match is required
23923
23923
  if (!match) {
23924
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23924
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23925
23925
  v: nextMatch1
23926
23926
  };
23927
23927
  }
23928
23928
  var token = match.token, offset = match.offset;
23929
23929
  i1 += offset;
23930
23930
  if (token === " ") {
23931
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23931
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23932
23932
  }
23933
23933
  tokens1 = _to_consumable_array$1(tokens1).concat([
23934
23934
  token
@@ -23947,7 +23947,7 @@ function indent(str, spaces) {
23947
23947
  if (contextKeys.some(function(el) {
23948
23948
  return el.startsWith(name);
23949
23949
  })) {
23950
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23950
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23951
23951
  }
23952
23952
  if (dateTimeIdentifiers.some(function(el) {
23953
23953
  return el === name;
@@ -23966,9 +23966,9 @@ function indent(str, spaces) {
23966
23966
  if (dateTimeIdentifiers.some(function(el) {
23967
23967
  return el.startsWith(name);
23968
23968
  })) {
23969
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23969
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23970
23970
  }
23971
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23971
+ return nextMatch = nextMatch1, i = i1, tokens = tok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g!h(V#X#Y(V~+QP!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~",
24836
24836
  tokenizers: [
24837
24837
  propertyIdentifiers,
24838
24838
  identifiers,
@@ -25348,6 +25348,9 @@ function parseParameterNames(fn) {
25348
25348
  function notImplemented(thing) {
25349
25349
  return new Error("not implemented: ".concat(thing));
25350
25350
  }
25351
+ function isNotImplemented(err) {
25352
+ return /^not implemented/.test(err.message);
25353
+ }
25351
25354
  /**
25352
25355
  * Returns a name from context or undefined if it does not exist.
25353
25356
  *
@@ -25468,6 +25471,9 @@ var builtins = {
25468
25471
  d = from;
25469
25472
  }
25470
25473
  if (year) {
25474
+ if (!isNumber(month) || !isNumber(day)) {
25475
+ return null;
25476
+ }
25471
25477
  d = date().setZone("utc").set({
25472
25478
  year: year,
25473
25479
  month: month,
@@ -25522,7 +25528,7 @@ var builtins = {
25522
25528
  from = hour;
25523
25529
  hour = null;
25524
25530
  }
25525
- if (isString(from)) {
25531
+ if (isString(from) && from) {
25526
25532
  t = date(null, from);
25527
25533
  }
25528
25534
  if (isDateTime(from)) {
@@ -25533,6 +25539,9 @@ var builtins = {
25533
25539
  });
25534
25540
  }
25535
25541
  if (isNumber(hour)) {
25542
+ if (!isNumber(minute) || !isNumber(second)) {
25543
+ return null;
25544
+ }
25536
25545
  // TODO: support offset = days and time duration
25537
25546
  t = date().set({
25538
25547
  hour: hour,
@@ -25642,7 +25651,8 @@ var builtins = {
25642
25651
  "string"
25643
25652
  ]),
25644
25653
  "replace": fn(function(input, pattern, replacement, flags) {
25645
- return input.replace(new RegExp(pattern, "ug" + (flags || "").replace(/[x]/g, "")), replacement.replace(/\$0/g, "$$&"));
25654
+ var regexp = createRegexp(pattern, flags || "", "g");
25655
+ return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
25646
25656
  }, [
25647
25657
  "string",
25648
25658
  "string",
@@ -25655,9 +25665,9 @@ var builtins = {
25655
25665
  "string",
25656
25666
  "string"
25657
25667
  ]),
25658
- // eslint-disable-next-line
25659
25668
  "matches": fn(function(input, pattern, flags) {
25660
- throw notImplemented("matches");
25669
+ var regexp = createRegexp(pattern, flags || "", "");
25670
+ return regexp && regexp.test(input);
25661
25671
  }, [
25662
25672
  "string",
25663
25673
  "string",
@@ -25676,7 +25686,8 @@ var builtins = {
25676
25686
  "string"
25677
25687
  ]),
25678
25688
  "split": fn(function(string, delimiter) {
25679
- return string.split(new RegExp(delimiter, "u"));
25689
+ var regexp = createRegexp(delimiter, "", "");
25690
+ return regexp && string.split(regexp);
25680
25691
  }, [
25681
25692
  "string",
25682
25693
  "string"
@@ -26592,6 +26603,35 @@ function mode(array) {
26592
26603
  function ifValid(o) {
26593
26604
  return o.isValid ? o : null;
26594
26605
  }
26606
+ /**
26607
+ * Concatenates flags for a regular expression.
26608
+ *
26609
+ * Ensures that default flags are included without duplication, even if
26610
+ * user-specified flags overlap with the defaults.
26611
+ */ function buildFlags(flags, defaultFlags) {
26612
+ var unsupportedFlags = flags.replace(/[smix]/g, "");
26613
+ if (unsupportedFlags) {
26614
+ throw new Error("illegal flags: " + unsupportedFlags);
26615
+ }
26616
+ // we don't implement the <x> flag
26617
+ if (/x/.test(flags)) {
26618
+ throw notImplemented("matches <x> flag");
26619
+ }
26620
+ return flags + defaultFlags;
26621
+ }
26622
+ /**
26623
+ * Creates a regular expression from a given pattern
26624
+ */ function createRegexp(pattern, flags) {
26625
+ var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
26626
+ try {
26627
+ return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
26628
+ } catch (_err) {
26629
+ if (isNotImplemented(_err)) {
26630
+ throw _err;
26631
+ }
26632
+ }
26633
+ return null;
26634
+ }
26595
26635
  function parseExpression(expression) {
26596
26636
  var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
26597
26637
  return parser.configure({
@@ -27046,27 +27086,59 @@ function evalNode(node, input, args) {
27046
27086
  };
27047
27087
  case "Type":
27048
27088
  return args[0];
27089
+ // (x in [ [1,2], [3,4] ]), (y in x)
27049
27090
  case "InExpressions":
27050
27091
  return function(context) {
27051
- var iterationContexts = args.map(function(ctx) {
27052
- return ctx(context);
27053
- });
27054
- if (iterationContexts.some(function(ctx) {
27055
- return getType(ctx) !== "list";
27056
- })) {
27057
- return null;
27058
- }
27059
- return cartesianProduct(iterationContexts).map(function(ctx) {
27060
- var _Object;
27061
- if (!isArray(ctx)) {
27062
- ctx = [
27063
- ctx
27064
- ];
27092
+ // we build up evaluation contexts from left to right,
27093
+ // ending up with the cartesian product over all available contexts
27094
+ //
27095
+ // previous context is provided to later context providers
27096
+ // producing <null> as a context during evaluation causes the
27097
+ // whole result to turn <null>
27098
+ var isValidContexts = function(contexts) {
27099
+ if (contexts === null || contexts.some(function(arr) {
27100
+ return getType(arr) === "nil";
27101
+ })) {
27102
+ return false;
27103
+ }
27104
+ return true;
27105
+ };
27106
+ var join = function(aContexts, bContextProducer) {
27107
+ var _instance;
27108
+ return (_instance = []).concat.apply(_instance, _to_consumable_array(aContexts.map(function(aContext) {
27109
+ var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
27110
+ if (!isValidContexts(bContexts)) {
27111
+ return null;
27112
+ }
27113
+ return bContexts.map(function(bContext) {
27114
+ return Object.assign(Object.assign({}, aContext), bContext);
27115
+ });
27116
+ })));
27117
+ };
27118
+ var cartesian = function(aContexts, bContextProducer) {
27119
+ for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27120
+ otherContextProducers[_key - 2] = arguments[_key];
27121
+ }
27122
+ if (!isValidContexts(aContexts)) {
27123
+ return null;
27124
+ }
27125
+ if (!bContextProducer) {
27126
+ return aContexts;
27065
27127
  }
27066
- return (_Object = Object).assign.apply(_Object, [
27067
- {},
27068
- context
27069
- ].concat(_to_consumable_array(ctx)));
27128
+ return cartesian.apply(void 0, [
27129
+ join(aContexts, bContextProducer)
27130
+ ].concat(_to_consumable_array(otherContextProducers)));
27131
+ };
27132
+ var cartesianProduct = function(contextProducers) {
27133
+ var _contextProducers = _to_array(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
27134
+ var aContexts = aContextProducer(context);
27135
+ return cartesian.apply(void 0, [
27136
+ aContexts
27137
+ ].concat(_to_consumable_array(otherContextProducers)));
27138
+ };
27139
+ var product = cartesianProduct(args);
27140
+ return product && product.map(function(p) {
27141
+ return Object.assign(Object.assign({}, context), p);
27070
27142
  });
27071
27143
  };
27072
27144
  // Name kw<"in"> Expr
@@ -27696,31 +27768,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
27696
27768
  includes: includes
27697
27769
  });
27698
27770
  }
27699
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27700
- function cartesianProduct(arrays) {
27701
- var _instance;
27702
- if (arrays.some(function(arr) {
27703
- return getType(arr) === "nil";
27704
- })) {
27705
- return null;
27706
- }
27707
- var f = function(a, b) {
27708
- return (_instance = []).concat.apply(_instance, _to_consumable_array(a.map(function(d) {
27709
- return b.map(function(e) {
27710
- return [].concat(d, e);
27711
- });
27712
- })));
27713
- };
27714
- var cartesian = function(a, b) {
27715
- for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27716
- c[_key - 2] = arguments[_key];
27717
- }
27718
- return b ? cartesian.apply(void 0, [
27719
- f(a, b)
27720
- ].concat(_to_consumable_array(c))) : a || [];
27721
- };
27722
- return cartesian.apply(void 0, _to_consumable_array(arrays));
27723
- }
27724
27771
  function coalecenseTypes(a, b) {
27725
27772
  if (!b) {
27726
27773
  return a.type;
@@ -27782,15 +27829,24 @@ function parseString(str) {
27782
27829
  if (str.endsWith('"')) {
27783
27830
  str = str.slice(0, -1);
27784
27831
  }
27785
- return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27832
+ return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27786
27833
  for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
27787
27834
  groups[_key - 1] = arguments[_key];
27788
27835
  }
27789
- var _groups = _sliced_to_array(groups, 4), quotes = _groups[0], escape = _groups[1], codePoint = _groups[2], charCodes = _groups[3];
27836
+ 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];
27790
27837
  if (quotes) {
27791
27838
  return '"';
27792
27839
  }
27793
- if (escape) {
27840
+ if (newline) {
27841
+ return "\n";
27842
+ }
27843
+ if (carriageReturn) {
27844
+ return "\r";
27845
+ }
27846
+ if (tab) {
27847
+ return " ";
27848
+ }
27849
+ if (backslash) {
27794
27850
  return "\\";
27795
27851
  }
27796
27852
  var escapePattern = /\\u([a-fA-F0-9]+)/ig;
package/index.esm.js CHANGED
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
23899
23899
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23900
23900
  // match is required
23901
23901
  if (!match) {
23902
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23902
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23903
23903
  v: nextMatch1
23904
23904
  };
23905
23905
  }
23906
23906
  var token = match.token, offset = match.offset;
23907
23907
  i1 += offset;
23908
23908
  if (token === " ") {
23909
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23909
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23910
23910
  }
23911
23911
  tokens1 = _to_consumable_array$1(tokens1).concat([
23912
23912
  token
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
23925
23925
  if (contextKeys.some(function(el) {
23926
23926
  return el.startsWith(name);
23927
23927
  })) {
23928
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23928
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23929
23929
  }
23930
23930
  if (dateTimeIdentifiers.some(function(el) {
23931
23931
  return el === name;
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
23944
23944
  if (dateTimeIdentifiers.some(function(el) {
23945
23945
  return el.startsWith(name);
23946
23946
  })) {
23947
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23947
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23948
23948
  }
23949
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23949
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23950
23950
  v: nextMatch1
23951
23951
  };
23952
23952
  };
@@ -24810,7 +24810,7 @@ var parser = LRParser.deserialize({
24810
24810
  2
24811
24811
  ],
24812
24812
  repeatNodeCount: 14,
24813
- tokenData: ".Z~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx&fxy&kyz&pz{&u{|'S|}'X}!O'^!O!P'k!P!Q(u!Q![*p![!]+X!]!^+^!^!_+c!_!`$i!`!a+r!b!c+|!}#O,R#P#Q,W#Q#R&}#S#T,]#o#p.P#q#r.U$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#r~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i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I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#r~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#s~~$fP!_!`$i~$nOr~~$qWOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[<%lO$n~%`O$j~~%cRO;'S$n;'S;=`%l;=`O$n~%oXOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[;=`<%l$n<%lO$n~&_P;=`<%l$n~&gO#{~~&lOv~~&qOx~~&vP^~z{&y~'OO_~~'TO[~~'YO$O~R'_PZP!`!a'bQ'gO$_Q~'lQ#z~!O!P'r!Q!['w~'wO#}~~'|R$i~!Q!['w!g!h(V#X#Y(V~(YR{|(c}!O(c!Q![(i~(fP!Q![(i~(nP$i~!Q![(i~(vQ]~z{(|!P!Q*T~)PTOz(|z{)`{;'S(|;'S;=`)}<%lO(|~)cVOz(|z{)`{!P(|!P!Q)x!Q;'S(|;'S;=`)}<%lO(|~)}OQ~~*QP;=`<%l(|~*YSP~OY*TZ;'S*T;'S;=`*f<%lO*T~*iP;=`<%l*T~*qS$i~!O!P*}!Q![*l!g!h(V#X#Y(V~+QP!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~",
24814
24814
  tokenizers: [
24815
24815
  propertyIdentifiers,
24816
24816
  identifiers,
@@ -25326,6 +25326,9 @@ function parseParameterNames(fn) {
25326
25326
  function notImplemented(thing) {
25327
25327
  return new Error("not implemented: ".concat(thing));
25328
25328
  }
25329
+ function isNotImplemented(err) {
25330
+ return /^not implemented/.test(err.message);
25331
+ }
25329
25332
  /**
25330
25333
  * Returns a name from context or undefined if it does not exist.
25331
25334
  *
@@ -25446,6 +25449,9 @@ var builtins = {
25446
25449
  d = from;
25447
25450
  }
25448
25451
  if (year) {
25452
+ if (!isNumber(month) || !isNumber(day)) {
25453
+ return null;
25454
+ }
25449
25455
  d = date().setZone("utc").set({
25450
25456
  year: year,
25451
25457
  month: month,
@@ -25500,7 +25506,7 @@ var builtins = {
25500
25506
  from = hour;
25501
25507
  hour = null;
25502
25508
  }
25503
- if (isString(from)) {
25509
+ if (isString(from) && from) {
25504
25510
  t = date(null, from);
25505
25511
  }
25506
25512
  if (isDateTime(from)) {
@@ -25511,6 +25517,9 @@ var builtins = {
25511
25517
  });
25512
25518
  }
25513
25519
  if (isNumber(hour)) {
25520
+ if (!isNumber(minute) || !isNumber(second)) {
25521
+ return null;
25522
+ }
25514
25523
  // TODO: support offset = days and time duration
25515
25524
  t = date().set({
25516
25525
  hour: hour,
@@ -25620,7 +25629,8 @@ var builtins = {
25620
25629
  "string"
25621
25630
  ]),
25622
25631
  "replace": fn(function(input, pattern, replacement, flags) {
25623
- return input.replace(new RegExp(pattern, "ug" + (flags || "").replace(/[x]/g, "")), replacement.replace(/\$0/g, "$$&"));
25632
+ var regexp = createRegexp(pattern, flags || "", "g");
25633
+ return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
25624
25634
  }, [
25625
25635
  "string",
25626
25636
  "string",
@@ -25633,9 +25643,9 @@ var builtins = {
25633
25643
  "string",
25634
25644
  "string"
25635
25645
  ]),
25636
- // eslint-disable-next-line
25637
25646
  "matches": fn(function(input, pattern, flags) {
25638
- throw notImplemented("matches");
25647
+ var regexp = createRegexp(pattern, flags || "", "");
25648
+ return regexp && regexp.test(input);
25639
25649
  }, [
25640
25650
  "string",
25641
25651
  "string",
@@ -25654,7 +25664,8 @@ var builtins = {
25654
25664
  "string"
25655
25665
  ]),
25656
25666
  "split": fn(function(string, delimiter) {
25657
- return string.split(new RegExp(delimiter, "u"));
25667
+ var regexp = createRegexp(delimiter, "", "");
25668
+ return regexp && string.split(regexp);
25658
25669
  }, [
25659
25670
  "string",
25660
25671
  "string"
@@ -26570,6 +26581,35 @@ function mode(array) {
26570
26581
  function ifValid(o) {
26571
26582
  return o.isValid ? o : null;
26572
26583
  }
26584
+ /**
26585
+ * Concatenates flags for a regular expression.
26586
+ *
26587
+ * Ensures that default flags are included without duplication, even if
26588
+ * user-specified flags overlap with the defaults.
26589
+ */ function buildFlags(flags, defaultFlags) {
26590
+ var unsupportedFlags = flags.replace(/[smix]/g, "");
26591
+ if (unsupportedFlags) {
26592
+ throw new Error("illegal flags: " + unsupportedFlags);
26593
+ }
26594
+ // we don't implement the <x> flag
26595
+ if (/x/.test(flags)) {
26596
+ throw notImplemented("matches <x> flag");
26597
+ }
26598
+ return flags + defaultFlags;
26599
+ }
26600
+ /**
26601
+ * Creates a regular expression from a given pattern
26602
+ */ function createRegexp(pattern, flags) {
26603
+ var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
26604
+ try {
26605
+ return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
26606
+ } catch (_err) {
26607
+ if (isNotImplemented(_err)) {
26608
+ throw _err;
26609
+ }
26610
+ }
26611
+ return null;
26612
+ }
26573
26613
  function parseExpression(expression) {
26574
26614
  var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
26575
26615
  return parser.configure({
@@ -27024,27 +27064,59 @@ function evalNode(node, input, args) {
27024
27064
  };
27025
27065
  case "Type":
27026
27066
  return args[0];
27067
+ // (x in [ [1,2], [3,4] ]), (y in x)
27027
27068
  case "InExpressions":
27028
27069
  return function(context) {
27029
- var iterationContexts = args.map(function(ctx) {
27030
- return ctx(context);
27031
- });
27032
- if (iterationContexts.some(function(ctx) {
27033
- return getType(ctx) !== "list";
27034
- })) {
27035
- return null;
27036
- }
27037
- return cartesianProduct(iterationContexts).map(function(ctx) {
27038
- var _Object;
27039
- if (!isArray(ctx)) {
27040
- ctx = [
27041
- ctx
27042
- ];
27070
+ // we build up evaluation contexts from left to right,
27071
+ // ending up with the cartesian product over all available contexts
27072
+ //
27073
+ // previous context is provided to later context providers
27074
+ // producing <null> as a context during evaluation causes the
27075
+ // whole result to turn <null>
27076
+ var isValidContexts = function(contexts) {
27077
+ if (contexts === null || contexts.some(function(arr) {
27078
+ return getType(arr) === "nil";
27079
+ })) {
27080
+ return false;
27081
+ }
27082
+ return true;
27083
+ };
27084
+ var join = function(aContexts, bContextProducer) {
27085
+ var _instance;
27086
+ return (_instance = []).concat.apply(_instance, _to_consumable_array(aContexts.map(function(aContext) {
27087
+ var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
27088
+ if (!isValidContexts(bContexts)) {
27089
+ return null;
27090
+ }
27091
+ return bContexts.map(function(bContext) {
27092
+ return Object.assign(Object.assign({}, aContext), bContext);
27093
+ });
27094
+ })));
27095
+ };
27096
+ var cartesian = function(aContexts, bContextProducer) {
27097
+ for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27098
+ otherContextProducers[_key - 2] = arguments[_key];
27099
+ }
27100
+ if (!isValidContexts(aContexts)) {
27101
+ return null;
27102
+ }
27103
+ if (!bContextProducer) {
27104
+ return aContexts;
27043
27105
  }
27044
- return (_Object = Object).assign.apply(_Object, [
27045
- {},
27046
- context
27047
- ].concat(_to_consumable_array(ctx)));
27106
+ return cartesian.apply(void 0, [
27107
+ join(aContexts, bContextProducer)
27108
+ ].concat(_to_consumable_array(otherContextProducers)));
27109
+ };
27110
+ var cartesianProduct = function(contextProducers) {
27111
+ var _contextProducers = _to_array(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
27112
+ var aContexts = aContextProducer(context);
27113
+ return cartesian.apply(void 0, [
27114
+ aContexts
27115
+ ].concat(_to_consumable_array(otherContextProducers)));
27116
+ };
27117
+ var product = cartesianProduct(args);
27118
+ return product && product.map(function(p) {
27119
+ return Object.assign(Object.assign({}, context), p);
27048
27120
  });
27049
27121
  };
27050
27122
  // Name kw<"in"> Expr
@@ -27674,31 +27746,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
27674
27746
  includes: includes
27675
27747
  });
27676
27748
  }
27677
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27678
- function cartesianProduct(arrays) {
27679
- var _instance;
27680
- if (arrays.some(function(arr) {
27681
- return getType(arr) === "nil";
27682
- })) {
27683
- return null;
27684
- }
27685
- var f = function(a, b) {
27686
- return (_instance = []).concat.apply(_instance, _to_consumable_array(a.map(function(d) {
27687
- return b.map(function(e) {
27688
- return [].concat(d, e);
27689
- });
27690
- })));
27691
- };
27692
- var cartesian = function(a, b) {
27693
- for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27694
- c[_key - 2] = arguments[_key];
27695
- }
27696
- return b ? cartesian.apply(void 0, [
27697
- f(a, b)
27698
- ].concat(_to_consumable_array(c))) : a || [];
27699
- };
27700
- return cartesian.apply(void 0, _to_consumable_array(arrays));
27701
- }
27702
27749
  function coalecenseTypes(a, b) {
27703
27750
  if (!b) {
27704
27751
  return a.type;
@@ -27760,15 +27807,24 @@ function parseString(str) {
27760
27807
  if (str.endsWith('"')) {
27761
27808
  str = str.slice(0, -1);
27762
27809
  }
27763
- return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27810
+ return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27764
27811
  for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
27765
27812
  groups[_key - 1] = arguments[_key];
27766
27813
  }
27767
- var _groups = _sliced_to_array(groups, 4), quotes = _groups[0], escape = _groups[1], codePoint = _groups[2], charCodes = _groups[3];
27814
+ 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];
27768
27815
  if (quotes) {
27769
27816
  return '"';
27770
27817
  }
27771
- if (escape) {
27818
+ if (newline) {
27819
+ return "\n";
27820
+ }
27821
+ if (carriageReturn) {
27822
+ return "\r";
27823
+ }
27824
+ if (tab) {
27825
+ return " ";
27826
+ }
27827
+ if (backslash) {
27772
27828
  return "\\";
27773
27829
  }
27774
27830
  var escapePattern = /\\u([a-fA-F0-9]+)/ig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-notification",
3
- "version": "0.104.0",
3
+ "version": "0.105.3",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "web",