@digipair/skill-mongodb 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 (2) hide show
  1. package/index.esm.js +113 -57
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -23941,14 +23941,14 @@ function indent(str, spaces) {
23941
23941
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23942
23942
  // match is required
23943
23943
  if (!match) {
23944
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23944
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23945
23945
  v: nextMatch1
23946
23946
  };
23947
23947
  }
23948
23948
  var token = match.token, offset = match.offset;
23949
23949
  i1 += offset;
23950
23950
  if (token === " ") {
23951
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23951
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23952
23952
  }
23953
23953
  tokens1 = _to_consumable_array$a(tokens1).concat([
23954
23954
  token
@@ -23967,7 +23967,7 @@ function indent(str, spaces) {
23967
23967
  if (contextKeys.some(function(el) {
23968
23968
  return el.startsWith(name);
23969
23969
  })) {
23970
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23970
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23971
23971
  }
23972
23972
  if (dateTimeIdentifiers.some(function(el) {
23973
23973
  return el === name;
@@ -23986,9 +23986,9 @@ function indent(str, spaces) {
23986
23986
  if (dateTimeIdentifiers.some(function(el) {
23987
23987
  return el.startsWith(name);
23988
23988
  })) {
23989
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23989
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23990
23990
  }
23991
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23991
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23992
23992
  v: nextMatch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!['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~",
24856
24856
  tokenizers: [
24857
24857
  propertyIdentifiers,
24858
24858
  identifiers,
@@ -25368,6 +25368,9 @@ function parseParameterNames(fn) {
25368
25368
  function notImplemented(thing) {
25369
25369
  return new Error("not implemented: ".concat(thing));
25370
25370
  }
25371
+ function isNotImplemented(err) {
25372
+ return /^not implemented/.test(err.message);
25373
+ }
25371
25374
  /**
25372
25375
  * Returns a name from context or undefined if it does not exist.
25373
25376
  *
@@ -25488,6 +25491,9 @@ var builtins = {
25488
25491
  d = from;
25489
25492
  }
25490
25493
  if (year) {
25494
+ if (!isNumber(month) || !isNumber(day)) {
25495
+ return null;
25496
+ }
25491
25497
  d = date().setZone("utc").set({
25492
25498
  year: year,
25493
25499
  month: month,
@@ -25542,7 +25548,7 @@ var builtins = {
25542
25548
  from = hour;
25543
25549
  hour = null;
25544
25550
  }
25545
- if (isString(from)) {
25551
+ if (isString(from) && from) {
25546
25552
  t = date(null, from);
25547
25553
  }
25548
25554
  if (isDateTime(from)) {
@@ -25553,6 +25559,9 @@ var builtins = {
25553
25559
  });
25554
25560
  }
25555
25561
  if (isNumber(hour)) {
25562
+ if (!isNumber(minute) || !isNumber(second)) {
25563
+ return null;
25564
+ }
25556
25565
  // TODO: support offset = days and time duration
25557
25566
  t = date().set({
25558
25567
  hour: hour,
@@ -25662,7 +25671,8 @@ var builtins = {
25662
25671
  "string"
25663
25672
  ]),
25664
25673
  "replace": fn(function(input, pattern, replacement, flags) {
25665
- return input.replace(new RegExp(pattern, "ug" + (flags || "").replace(/[x]/g, "")), replacement.replace(/\$0/g, "$$&"));
25674
+ var regexp = createRegexp(pattern, flags || "", "g");
25675
+ return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
25666
25676
  }, [
25667
25677
  "string",
25668
25678
  "string",
@@ -25675,9 +25685,9 @@ var builtins = {
25675
25685
  "string",
25676
25686
  "string"
25677
25687
  ]),
25678
- // eslint-disable-next-line
25679
25688
  "matches": fn(function(input, pattern, flags) {
25680
- throw notImplemented("matches");
25689
+ var regexp = createRegexp(pattern, flags || "", "");
25690
+ return regexp && regexp.test(input);
25681
25691
  }, [
25682
25692
  "string",
25683
25693
  "string",
@@ -25696,7 +25706,8 @@ var builtins = {
25696
25706
  "string"
25697
25707
  ]),
25698
25708
  "split": fn(function(string, delimiter) {
25699
- return string.split(new RegExp(delimiter, "u"));
25709
+ var regexp = createRegexp(delimiter, "", "");
25710
+ return regexp && string.split(regexp);
25700
25711
  }, [
25701
25712
  "string",
25702
25713
  "string"
@@ -26612,6 +26623,35 @@ function mode(array) {
26612
26623
  function ifValid(o) {
26613
26624
  return o.isValid ? o : null;
26614
26625
  }
26626
+ /**
26627
+ * Concatenates flags for a regular expression.
26628
+ *
26629
+ * Ensures that default flags are included without duplication, even if
26630
+ * user-specified flags overlap with the defaults.
26631
+ */ function buildFlags(flags, defaultFlags) {
26632
+ var unsupportedFlags = flags.replace(/[smix]/g, "");
26633
+ if (unsupportedFlags) {
26634
+ throw new Error("illegal flags: " + unsupportedFlags);
26635
+ }
26636
+ // we don't implement the <x> flag
26637
+ if (/x/.test(flags)) {
26638
+ throw notImplemented("matches <x> flag");
26639
+ }
26640
+ return flags + defaultFlags;
26641
+ }
26642
+ /**
26643
+ * Creates a regular expression from a given pattern
26644
+ */ function createRegexp(pattern, flags) {
26645
+ var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
26646
+ try {
26647
+ return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
26648
+ } catch (_err) {
26649
+ if (isNotImplemented(_err)) {
26650
+ throw _err;
26651
+ }
26652
+ }
26653
+ return null;
26654
+ }
26615
26655
  function parseExpression(expression) {
26616
26656
  var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
26617
26657
  return parser.configure({
@@ -27066,27 +27106,59 @@ function evalNode(node, input, args) {
27066
27106
  };
27067
27107
  case "Type":
27068
27108
  return args[0];
27109
+ // (x in [ [1,2], [3,4] ]), (y in x)
27069
27110
  case "InExpressions":
27070
27111
  return function(context) {
27071
- var iterationContexts = args.map(function(ctx) {
27072
- return ctx(context);
27073
- });
27074
- if (iterationContexts.some(function(ctx) {
27075
- return getType(ctx) !== "list";
27076
- })) {
27077
- return null;
27078
- }
27079
- return cartesianProduct(iterationContexts).map(function(ctx) {
27080
- var _Object;
27081
- if (!isArray(ctx)) {
27082
- ctx = [
27083
- ctx
27084
- ];
27112
+ // we build up evaluation contexts from left to right,
27113
+ // ending up with the cartesian product over all available contexts
27114
+ //
27115
+ // previous context is provided to later context providers
27116
+ // producing <null> as a context during evaluation causes the
27117
+ // whole result to turn <null>
27118
+ var isValidContexts = function(contexts) {
27119
+ if (contexts === null || contexts.some(function(arr) {
27120
+ return getType(arr) === "nil";
27121
+ })) {
27122
+ return false;
27085
27123
  }
27086
- return (_Object = Object).assign.apply(_Object, [
27087
- {},
27088
- context
27089
- ].concat(_to_consumable_array$9(ctx)));
27124
+ return true;
27125
+ };
27126
+ var join = function(aContexts, bContextProducer) {
27127
+ var _instance;
27128
+ return (_instance = []).concat.apply(_instance, _to_consumable_array$9(aContexts.map(function(aContext) {
27129
+ var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
27130
+ if (!isValidContexts(bContexts)) {
27131
+ return null;
27132
+ }
27133
+ return bContexts.map(function(bContext) {
27134
+ return Object.assign(Object.assign({}, aContext), bContext);
27135
+ });
27136
+ })));
27137
+ };
27138
+ var cartesian = function(aContexts, bContextProducer) {
27139
+ for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27140
+ otherContextProducers[_key - 2] = arguments[_key];
27141
+ }
27142
+ if (!isValidContexts(aContexts)) {
27143
+ return null;
27144
+ }
27145
+ if (!bContextProducer) {
27146
+ return aContexts;
27147
+ }
27148
+ return cartesian.apply(void 0, [
27149
+ join(aContexts, bContextProducer)
27150
+ ].concat(_to_consumable_array$9(otherContextProducers)));
27151
+ };
27152
+ var cartesianProduct = function(contextProducers) {
27153
+ var _contextProducers = _to_array(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
27154
+ var aContexts = aContextProducer(context);
27155
+ return cartesian.apply(void 0, [
27156
+ aContexts
27157
+ ].concat(_to_consumable_array$9(otherContextProducers)));
27158
+ };
27159
+ var product = cartesianProduct(args);
27160
+ return product && product.map(function(p) {
27161
+ return Object.assign(Object.assign({}, context), p);
27090
27162
  });
27091
27163
  };
27092
27164
  // Name kw<"in"> Expr
@@ -27716,31 +27788,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
27716
27788
  includes: includes
27717
27789
  });
27718
27790
  }
27719
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27720
- function cartesianProduct(arrays) {
27721
- var _instance;
27722
- if (arrays.some(function(arr) {
27723
- return getType(arr) === "nil";
27724
- })) {
27725
- return null;
27726
- }
27727
- var f = function(a, b) {
27728
- return (_instance = []).concat.apply(_instance, _to_consumable_array$9(a.map(function(d) {
27729
- return b.map(function(e) {
27730
- return [].concat(d, e);
27731
- });
27732
- })));
27733
- };
27734
- var cartesian = function(a, b) {
27735
- for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
27736
- c[_key - 2] = arguments[_key];
27737
- }
27738
- return b ? cartesian.apply(void 0, [
27739
- f(a, b)
27740
- ].concat(_to_consumable_array$9(c))) : a || [];
27741
- };
27742
- return cartesian.apply(void 0, _to_consumable_array$9(arrays));
27743
- }
27744
27791
  function coalecenseTypes(a, b) {
27745
27792
  if (!b) {
27746
27793
  return a.type;
@@ -27802,15 +27849,24 @@ function parseString(str) {
27802
27849
  if (str.endsWith('"')) {
27803
27850
  str = str.slice(0, -1);
27804
27851
  }
27805
- return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27852
+ return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
27806
27853
  for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
27807
27854
  groups[_key - 1] = arguments[_key];
27808
27855
  }
27809
- var _groups = _sliced_to_array$g(groups, 4), quotes = _groups[0], escape = _groups[1], codePoint = _groups[2], charCodes = _groups[3];
27856
+ var _groups = _sliced_to_array$g(groups, 7), quotes = _groups[0], backslash = _groups[1], newline = _groups[2], carriageReturn = _groups[3], tab = _groups[4], codePoint = _groups[5], charCodes = _groups[6];
27810
27857
  if (quotes) {
27811
27858
  return '"';
27812
27859
  }
27813
- if (escape) {
27860
+ if (newline) {
27861
+ return "\n";
27862
+ }
27863
+ if (carriageReturn) {
27864
+ return "\r";
27865
+ }
27866
+ if (tab) {
27867
+ return " ";
27868
+ }
27869
+ if (backslash) {
27814
27870
  return "\\";
27815
27871
  }
27816
27872
  var escapePattern = /\\u([a-fA-F0-9]+)/ig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-mongodb",
3
- "version": "0.104.0",
3
+ "version": "0.105.3",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "service",