@ai-matrx/vault 0.1.32 → 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 +5 -0
- package/dist/{chunk-IJVSAR5M.js → chunk-B5TOAIY6.js} +1 -2
- package/dist/identity.js +1 -1
- package/dist/index.cjs +123 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +128 -84
- package/dist/index.js.map +1 -1
- package/dist/io/bitwarden-json.worker.js +62 -24
- package/dist/io/bitwarden-json.worker.js.map +1 -1
- package/dist/io/onepux.worker.js +62 -24
- package/dist/io/onepux.worker.js.map +1 -1
- package/dist/io/proton-pass.worker.js +62 -24
- package/dist/io/proton-pass.worker.js.map +1 -1
- package/knob-declaration.json +31 -0
- package/package.json +7 -6
- /package/dist/{chunk-IJVSAR5M.js.map → chunk-B5TOAIY6.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/lossless-json@4.3.
|
|
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 (
|
|
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.
|
|
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
|
-
|
|
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
|
|
149
|
+
return value !== null && typeof value === "object" && value[losslessNumberMarker] === true;
|
|
137
150
|
}
|
|
138
151
|
|
|
139
|
-
// ../../node_modules/.pnpm/lossless-json@4.3.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
241
|
+
setObjectKey(object2, key, returnedValue);
|
|
224
242
|
}
|
|
225
243
|
} else {
|
|
226
|
-
object2
|
|
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(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
|
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 +=
|
|
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
|
-
|
|
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
|
}
|