@ai-matrx/vault 0.1.33 → 0.1.35

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.
@@ -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_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/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_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/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_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/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_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/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_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/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
@@ -212,7 +230,7 @@ function parse(text, reviver, options) {
212
230
  throwObjectValueExpected();
213
231
  return;
214
232
  }
215
- if (Object.prototype.hasOwnProperty.call(object2, key) && !isDeepEqual(value2, object2[key])) {
233
+ if (Object.prototype.hasOwnProperty.call(object2, key)) {
216
234
  const returnedValue = onDuplicateKey({
217
235
  key,
218
236
  position: start + 1,
@@ -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
  }
@@ -436,22 +467,6 @@ function isNonZeroDigit(code) {
436
467
  function isValidStringCharacter(code) {
437
468
  return code >= 32 && code <= 1114111;
438
469
  }
439
- function isDeepEqual(a, b) {
440
- if (a === b) {
441
- return true;
442
- }
443
- if (Array.isArray(a) && Array.isArray(b)) {
444
- return a.length === b.length && a.every((item, index) => isDeepEqual(item, b[index]));
445
- }
446
- if (isObject(a) && isObject(b)) {
447
- const keys = [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])];
448
- return keys.every((key) => isDeepEqual(a[key], b[key]));
449
- }
450
- return false;
451
- }
452
- function isObject(value) {
453
- return typeof value === "object" && value !== null;
454
- }
455
470
  var escapeCharacters = {
456
471
  '"': '"',
457
472
  "\\": "\\",
@@ -488,7 +503,7 @@ var codeLowercaseE = 101;
488
503
  var codeUppercaseF = 70;
489
504
  var codeLowercaseF = 102;
490
505
 
491
- // ../../node_modules/.pnpm/lossless-json@4.3.1/node_modules/lossless-json/lib/esm/stringify.js
506
+ // ../../node_modules/.pnpm/lossless-json@4.3.3_patch_hash=3d667bc403737067026a4025cf7583b9ec434c0318d7d958811f88333c596dfb/node_modules/lossless-json/lib/esm/stringify.js
492
507
  function stringify(value, replacer, space, numberStringifiers) {
493
508
  const resolvedSpace = resolveSpace(space);
494
509
  const replacedValue = typeof replacer === "function" ? replacer.call({
@@ -509,7 +524,7 @@ function stringify(value, replacer, space, numberStringifiers) {
509
524
  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
525
  return JSON.stringify(value2);
511
526
  }
512
- if (value2?.isLosslessNumber) {
527
+ if (isLosslessNumber(value2)) {
513
528
  return value2.toString();
514
529
  }
515
530
  if (typeof value2 === "bigint") {
@@ -535,7 +550,8 @@ function stringify(value, replacer, space, numberStringifiers) {
535
550
  str += childIndent;
536
551
  }
537
552
  if (typeof item !== "undefined" && typeof item !== "function") {
538
- str += stringifyValue(item, childIndent);
553
+ const serialized = stringifyValue(item, childIndent);
554
+ str += serialized === void 0 ? "null" : serialized;
539
555
  } else {
540
556
  str += "null";
541
557
  }
@@ -549,9 +565,9 @@ ${indent}]` : "]";
549
565
  }
550
566
  function stringifyObject(object2, indent) {
551
567
  if (typeof object2.toJSON === "function") {
552
- return stringify(object2.toJSON(), replacer, space, void 0);
568
+ return stringifyValue(object2.toJSON(), indent);
553
569
  }
554
- const keys = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object2);
570
+ const keys = Array.isArray(replacer) ? [...new Set(replacer.map(String))] : Object.keys(object2);
555
571
  if (keys.length === 0) {
556
572
  return "{}";
557
573
  }
@@ -561,6 +577,10 @@ ${indent}]` : "]";
561
577
  for (const key of keys) {
562
578
  const value2 = typeof replacer === "function" ? replacer.call(object2, key, object2[key]) : object2[key];
563
579
  if (includeProperty(key, value2)) {
580
+ const serialized = stringifyValue(value2, childIndent);
581
+ if (serialized === void 0) {
582
+ continue;
583
+ }
564
584
  if (first) {
565
585
  first = false;
566
586
  } else {
@@ -568,7 +588,7 @@ ${indent}]` : "]";
568
588
  }
569
589
  const keyStr = JSON.stringify(key);
570
590
  str += resolvedSpace ? `${childIndent + keyStr}: ` : `${keyStr}:`;
571
- str += stringifyValue(value2, childIndent);
591
+ str += serialized;
572
592
  }
573
593
  }
574
594
  str += resolvedSpace ? `
@@ -579,12 +599,14 @@ ${indent}}` : "}";
579
599
  return typeof value2 !== "undefined" && typeof value2 !== "function" && typeof value2 !== "symbol";
580
600
  }
581
601
  }
602
+ var MAX_SPACE_LENGTH = 10;
582
603
  function resolveSpace(space) {
583
604
  if (typeof space === "number") {
584
- return " ".repeat(space);
605
+ const count = Math.min(Math.trunc(space), MAX_SPACE_LENGTH);
606
+ return count >= 1 ? " ".repeat(count) : void 0;
585
607
  }
586
608
  if (typeof space === "string" && space !== "") {
587
- return space;
609
+ return space.slice(0, MAX_SPACE_LENGTH);
588
610
  }
589
611
  return void 0;
590
612
  }