@ai-matrx/vault 0.1.33 → 0.1.34

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.33
3
+ ## 0.1.34
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/vault/src`.
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/utils.js
1
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/utils.js
2
2
  function isInteger(value) {
3
3
  return INTEGER_REGEX.test(value);
4
4
  }
@@ -12,6 +12,9 @@ function isSafeNumber(value, config2) {
12
12
  return Number.isSafeInteger(Number.parseInt(value, 10));
13
13
  }
14
14
  const num = Number.parseFloat(value);
15
+ if (Number.isInteger(num) && !Number.isSafeInteger(num)) {
16
+ return false;
17
+ }
15
18
  const parsed = String(num);
16
19
  if (value === parsed) {
17
20
  return true;
@@ -23,7 +26,7 @@ function isSafeNumber(value, config2) {
23
26
  }
24
27
  if (config2?.approx === true) {
25
28
  const requiredDigits = 14;
26
- if (!isInteger(value) && parsedDigits.length >= requiredDigits && valueDigits.startsWith(parsedDigits.substring(0, requiredDigits))) {
29
+ if (parsedDigits.length >= requiredDigits && valueDigits.startsWith(parsedDigits.substring(0, requiredDigits))) {
27
30
  return true;
28
31
  }
29
32
  }
@@ -90,11 +93,21 @@ function getSignificantDigitRange(value) {
90
93
  };
91
94
  }
92
95
 
93
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/LosslessNumber.js
96
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/LosslessNumber.js
97
+ var losslessNumberMarker = /* @__PURE__ */ Symbol.for("lossless-json.LosslessNumber");
94
98
  var LosslessNumber = class {
95
99
  // numeric value as string
96
- // type information
100
+ value;
101
+ /**
102
+ * @deprecated Use the isLosslessNumber(value) function instead.
103
+ *
104
+ * Ordinary objects may also have an isLosslessNumber property, so this
105
+ * field cannot reliably identify lossless numbers.
106
+ */
97
107
  isLosslessNumber = true;
108
+ get [losslessNumberMarker]() {
109
+ return true;
110
+ }
98
111
  constructor(value) {
99
112
  if (!isNumber(value)) {
100
113
  throw new Error(`Invalid number (value: "${value}")`);
@@ -133,15 +146,15 @@ var LosslessNumber = class {
133
146
  // stringified JSON since it has to be parsed into a number first.
134
147
  };
135
148
  function isLosslessNumber(value) {
136
- return value && typeof value === "object" && value.isLosslessNumber || false;
149
+ return value !== null && typeof value === "object" && value[losslessNumberMarker] === true;
137
150
  }
138
151
 
139
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/numberParsers.js
152
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/numberParsers.js
140
153
  function parseLosslessNumber(value) {
141
154
  return new LosslessNumber(value);
142
155
  }
143
156
 
144
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/revive.js
157
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/revive.js
145
158
  function revive(json, reviver) {
146
159
  return reviveValue({
147
160
  "": json
@@ -169,12 +182,17 @@ function reviveObject(object2, reviver) {
169
182
  }
170
183
  function reviveArray(array, reviver) {
171
184
  for (let i = 0; i < array.length; i++) {
172
- array[i] = reviveValue(array, String(i), array[i], reviver);
185
+ const value = reviveValue(array, String(i), array[i], reviver);
186
+ if (value === void 0) {
187
+ delete array[i];
188
+ } else {
189
+ array[i] = value;
190
+ }
173
191
  }
174
192
  return array;
175
193
  }
176
194
 
177
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/parse.js
195
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/parse.js
178
196
  function parse(text, reviver, options) {
179
197
  const optionsObj = typeof options === "function" ? {
180
198
  parseNumber: options
@@ -220,10 +238,10 @@ function parse(text, reviver, options) {
220
238
  newValue: value2
221
239
  });
222
240
  if (returnedValue !== void 0) {
223
- object2[key] = returnedValue;
241
+ setObjectKey(object2, key, returnedValue);
224
242
  }
225
243
  } else {
226
- object2[key] = value2;
244
+ setObjectKey(object2, key, value2);
227
245
  }
228
246
  }
229
247
  if (text.charCodeAt(i) !== codeClosingBrace) {
@@ -321,6 +339,8 @@ function parse(text, reviver, options) {
321
339
  while (isDigit(text.charCodeAt(i))) {
322
340
  i++;
323
341
  }
342
+ } else {
343
+ return void 0;
324
344
  }
325
345
  if (text.charCodeAt(i) === codeDot) {
326
346
  i++;
@@ -384,11 +404,10 @@ function parse(text, reviver, options) {
384
404
  function throwObjectKeyExpected() {
385
405
  throw new SyntaxError(`Quoted object key expected ${gotAt()}`);
386
406
  }
387
- function throwDuplicateKey(_ref) {
388
- let {
389
- key,
390
- position
391
- } = _ref;
407
+ function throwDuplicateKey({
408
+ key,
409
+ position
410
+ }) {
392
411
  throw new SyntaxError(`Duplicate key '${key}' encountered at position ${position}`);
393
412
  }
394
413
  function throwObjectKeyOrEndExpected() {
@@ -421,6 +440,18 @@ function parse(text, reviver, options) {
421
440
  return `${got()} ${pos()}`;
422
441
  }
423
442
  }
443
+ function setObjectKey(object2, key, value) {
444
+ if (key === "__proto__") {
445
+ Object.defineProperty(object2, key, {
446
+ value,
447
+ writable: true,
448
+ enumerable: true,
449
+ configurable: true
450
+ });
451
+ } else {
452
+ object2[key] = value;
453
+ }
454
+ }
424
455
  function isWhitespace(code) {
425
456
  return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn;
426
457
  }
@@ -488,7 +519,7 @@ var codeLowercaseE = 101;
488
519
  var codeUppercaseF = 70;
489
520
  var codeLowercaseF = 102;
490
521
 
491
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/stringify.js
522
+ // ../../node_modules/.pnpm/lossless-json@4.3.3/node_modules/lossless-json/lib/esm/stringify.js
492
523
  function stringify(value, replacer, space, numberStringifiers) {
493
524
  const resolvedSpace = resolveSpace(space);
494
525
  const replacedValue = typeof replacer === "function" ? replacer.call({
@@ -509,7 +540,7 @@ function stringify(value, replacer, space, numberStringifiers) {
509
540
  if (typeof value2 === "boolean" || typeof value2 === "number" || typeof value2 === "string" || value2 === null || value2 instanceof Date || value2 instanceof Boolean || value2 instanceof Number || value2 instanceof String) {
510
541
  return JSON.stringify(value2);
511
542
  }
512
- if (value2?.isLosslessNumber) {
543
+ if (isLosslessNumber(value2)) {
513
544
  return value2.toString();
514
545
  }
515
546
  if (typeof value2 === "bigint") {
@@ -535,7 +566,8 @@ function stringify(value, replacer, space, numberStringifiers) {
535
566
  str += childIndent;
536
567
  }
537
568
  if (typeof item !== "undefined" && typeof item !== "function") {
538
- str += stringifyValue(item, childIndent);
569
+ const serialized = stringifyValue(item, childIndent);
570
+ str += serialized === void 0 ? "null" : serialized;
539
571
  } else {
540
572
  str += "null";
541
573
  }
@@ -549,9 +581,9 @@ ${indent}]` : "]";
549
581
  }
550
582
  function stringifyObject(object2, indent) {
551
583
  if (typeof object2.toJSON === "function") {
552
- return stringify(object2.toJSON(), replacer, space, void 0);
584
+ return stringifyValue(object2.toJSON(), indent);
553
585
  }
554
- const keys = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object2);
586
+ const keys = Array.isArray(replacer) ? [...new Set(replacer.map(String))] : Object.keys(object2);
555
587
  if (keys.length === 0) {
556
588
  return "{}";
557
589
  }
@@ -561,6 +593,10 @@ ${indent}]` : "]";
561
593
  for (const key of keys) {
562
594
  const value2 = typeof replacer === "function" ? replacer.call(object2, key, object2[key]) : object2[key];
563
595
  if (includeProperty(key, value2)) {
596
+ const serialized = stringifyValue(value2, childIndent);
597
+ if (serialized === void 0) {
598
+ continue;
599
+ }
564
600
  if (first) {
565
601
  first = false;
566
602
  } else {
@@ -568,7 +604,7 @@ ${indent}]` : "]";
568
604
  }
569
605
  const keyStr = JSON.stringify(key);
570
606
  str += resolvedSpace ? `${childIndent + keyStr}: ` : `${keyStr}:`;
571
- str += stringifyValue(value2, childIndent);
607
+ str += serialized;
572
608
  }
573
609
  }
574
610
  str += resolvedSpace ? `
@@ -579,12 +615,14 @@ ${indent}}` : "}";
579
615
  return typeof value2 !== "undefined" && typeof value2 !== "function" && typeof value2 !== "symbol";
580
616
  }
581
617
  }
618
+ var MAX_SPACE_LENGTH = 10;
582
619
  function resolveSpace(space) {
583
620
  if (typeof space === "number") {
584
- return " ".repeat(space);
621
+ const count = Math.min(Math.trunc(space), MAX_SPACE_LENGTH);
622
+ return count >= 1 ? " ".repeat(count) : void 0;
585
623
  }
586
624
  if (typeof space === "string" && space !== "") {
587
- return space;
625
+ return space.slice(0, MAX_SPACE_LENGTH);
588
626
  }
589
627
  return void 0;
590
628
  }