o1js-pack 0.3.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/.husky/pre-commit +0 -0
  3. package/README.md +9 -30
  4. package/build/src/index.d.ts +5 -5
  5. package/build/src/index.js +5 -5
  6. package/build/src/lib/PackingPlant.d.ts +132 -92
  7. package/build/src/lib/PackingPlant.js +190 -74
  8. package/build/src/lib/PackingPlant.js.map +1 -1
  9. package/build/src/lib/packed-types/PackedBool.d.ts +85 -77
  10. package/build/src/lib/packed-types/PackedBool.js +49 -47
  11. package/build/src/lib/packed-types/PackedBool.js.map +1 -1
  12. package/build/src/lib/packed-types/PackedBool.test.d.ts +1 -1
  13. package/build/src/lib/packed-types/PackedBool.test.js +75 -75
  14. package/build/src/lib/packed-types/PackedBool.test.js.map +1 -1
  15. package/build/src/lib/packed-types/PackedString.d.ts +181 -78
  16. package/build/src/lib/packed-types/PackedString.js +127 -82
  17. package/build/src/lib/packed-types/PackedString.js.map +1 -1
  18. package/build/src/lib/packed-types/PackedString.test.d.ts +1 -1
  19. package/build/src/lib/packed-types/PackedString.test.js +100 -99
  20. package/build/src/lib/packed-types/PackedString.test.js.map +1 -1
  21. package/build/src/lib/packed-types/PackedUInt32.d.ts +85 -77
  22. package/build/src/lib/packed-types/PackedUInt32.js +49 -47
  23. package/build/src/lib/packed-types/PackedUInt32.js.map +1 -1
  24. package/build/src/lib/packed-types/PackedUInt32.test.d.ts +1 -1
  25. package/build/src/lib/packed-types/PackedUInt32.test.js +83 -83
  26. package/build/src/lib/packed-types/PackedUInt32.test.js.map +1 -1
  27. package/package.json +1 -1
  28. package/tests/provable/end_to_end.test.ts +65 -0
  29. package/tests/provable/example_packed_string_circuit.ts +47 -0
  30. package/tests/provable/example_packed_uint_circuit.ts +39 -0
  31. package/build/src/lib/packed-types/PackedCharacter.d.ts +0 -51
  32. package/build/src/lib/packed-types/PackedCharacter.js +0 -34
  33. package/build/src/lib/packed-types/PackedCharacter.js.map +0 -1
  34. package/build/src/lib/packed-types/PackedCharacter.test.d.ts +0 -1
  35. package/build/src/lib/packed-types/PackedCharacter.test.js +0 -31
  36. package/build/src/lib/packed-types/PackedCharacter.test.js.map +0 -1
  37. package/build/src/lib/scratch.d.ts +0 -1
  38. package/build/src/lib/scratch.js +0 -16
  39. package/build/src/lib/scratch.js.map +0 -1
  40. package/build/src/packed-types/PackedBool.d.ts +0 -51
  41. package/build/src/packed-types/PackedBool.js +0 -34
  42. package/build/src/packed-types/PackedBool.js.map +0 -1
  43. package/build/src/packed-types/PackedBool.test.d.ts +0 -1
  44. package/build/src/packed-types/PackedBool.test.js +0 -101
  45. package/build/src/packed-types/PackedBool.test.js.map +0 -1
  46. package/build/src/packed-types/PackedCharacter.d.ts +0 -51
  47. package/build/src/packed-types/PackedCharacter.js +0 -34
  48. package/build/src/packed-types/PackedCharacter.js.map +0 -1
  49. package/build/src/packed-types/PackedCharacter.test.d.ts +0 -1
  50. package/build/src/packed-types/PackedCharacter.test.js +0 -31
  51. package/build/src/packed-types/PackedCharacter.test.js.map +0 -1
  52. package/build/src/packed-types/PackedUInt32.d.ts +0 -51
  53. package/build/src/packed-types/PackedUInt32.js +0 -34
  54. package/build/src/packed-types/PackedUInt32.js.map +0 -1
  55. package/build/src/packed-types/PackedUInt32.test.d.ts +0 -1
  56. package/build/src/packed-types/PackedUInt32.test.js +0 -68
  57. package/build/src/packed-types/PackedUInt32.test.js.map +0 -1
  58. package/build/src/packed-types/PackingPlant.d.ts +0 -54
  59. package/build/src/packed-types/PackingPlant.js +0 -45
  60. package/build/src/packed-types/PackingPlant.js.map +0 -1
  61. package/build/src/packed-types/scratch.d.ts +0 -1
  62. package/build/src/packed-types/scratch.js +0 -5
  63. package/build/src/packed-types/scratch.js.map +0 -1
  64. package/coverage/clover.xml +0 -166
  65. package/coverage/coverage-final.json +0 -5
  66. package/coverage/lcov-report/PackedBool.ts.html +0 -268
  67. package/coverage/lcov-report/PackedUInt32.ts.html +0 -313
  68. package/coverage/lcov-report/base.css +0 -224
  69. package/coverage/lcov-report/block-navigation.js +0 -87
  70. package/coverage/lcov-report/favicon.png +0 -0
  71. package/coverage/lcov-report/index.html +0 -131
  72. package/coverage/lcov-report/lib/PackingPlant.ts.html +0 -478
  73. package/coverage/lcov-report/lib/index.html +0 -116
  74. package/coverage/lcov-report/lib/packed-types/PackedBool.ts.html +0 -238
  75. package/coverage/lcov-report/lib/packed-types/PackedString.ts.html +0 -364
  76. package/coverage/lcov-report/lib/packed-types/PackedUInt32.ts.html +0 -238
  77. package/coverage/lcov-report/lib/packed-types/index.html +0 -146
  78. package/coverage/lcov-report/prettify.css +0 -1
  79. package/coverage/lcov-report/prettify.js +0 -2
  80. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  81. package/coverage/lcov-report/sorter.js +0 -196
  82. package/coverage/lcov.info +0 -282
@@ -1,78 +1,181 @@
1
- import { Field, Character } from 'o1js';
2
- export declare function PackedStringFactory(l: number): {
3
- new (packed: import("o1js/dist/node/lib/field.js").Field[], aux: Character[]): {
4
- toString(): string;
5
- packed: import("o1js/dist/node/lib/field.js").Field[];
6
- aux: Character[];
7
- bitSize: bigint;
8
- assertEquals(other: {
9
- packed: import("o1js/dist/node/lib/field.js").Field[];
10
- aux: Character[];
11
- bitSize: bigint;
12
- assertEquals(other: any): void;
13
- }): void;
14
- };
15
- toAuxiliary(value?: {
16
- packed: Array<Field>;
17
- } | undefined): Character[];
18
- pack(aux: Character[]): Array<Field>;
19
- fromString(str: string): {
20
- toString(): string;
21
- packed: import("o1js/dist/node/lib/field.js").Field[];
22
- aux: Character[];
23
- bitSize: bigint;
24
- assertEquals(other: {
25
- packed: import("o1js/dist/node/lib/field.js").Field[];
26
- aux: Character[];
27
- bitSize: bigint;
28
- assertEquals(other: any): void;
29
- }): void;
30
- };
31
- fromAuxiliary(aux: Array<Character>): {
32
- toString(): string;
33
- packed: import("o1js/dist/node/lib/field.js").Field[];
34
- aux: Character[];
35
- bitSize: bigint;
36
- assertEquals(other: {
37
- packed: import("o1js/dist/node/lib/field.js").Field[];
38
- aux: Character[];
39
- bitSize: bigint;
40
- assertEquals(other: any): void;
41
- }): void;
42
- };
43
- type: import("o1js/dist/node/bindings/lib/provable-snarky.js").ProvableExtended<{
44
- packed: import("o1js/dist/node/lib/field.js").Field[];
45
- }, {
46
- packed: string[];
47
- }>;
48
- l: number;
49
- n: number;
50
- unpack(fields: import("o1js/dist/node/lib/field.js").Field[]): Character[];
51
- _isStruct: true;
52
- toFields: (value: {
53
- packed: import("o1js/dist/node/lib/field.js").Field[];
54
- }) => import("o1js/dist/node/lib/field.js").Field[];
55
- fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
56
- packed: import("o1js/dist/node/lib/field.js").Field[];
57
- };
58
- sizeInFields(): number;
59
- check: (value: {
60
- packed: import("o1js/dist/node/lib/field.js").Field[];
61
- }) => void;
62
- toInput: (x: {
63
- packed: import("o1js/dist/node/lib/field.js").Field[];
64
- }) => {
65
- fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
66
- packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
67
- };
68
- toJSON: (x: {
69
- packed: import("o1js/dist/node/lib/field.js").Field[];
70
- }) => {
71
- packed: string[];
72
- };
73
- fromJSON: (x: {
74
- packed: string[];
75
- }) => {
76
- packed: import("o1js/dist/node/lib/field.js").Field[];
77
- };
78
- };
1
+ import { Field, Character } from 'o1js';
2
+ export declare function PackedStringFactory(l?: number): {
3
+ new (packed: import("o1js/dist/node/lib/field.js").Field): {
4
+ toString(): string;
5
+ assertEquals(other: {
6
+ assertEquals(other: any): void;
7
+ packed: import("o1js/dist/node/lib/field.js").Field;
8
+ }): void;
9
+ packed: import("o1js/dist/node/lib/field.js").Field;
10
+ };
11
+ extractField(input: Character): Field;
12
+ sizeInBits(): bigint;
13
+ /**
14
+ *
15
+ * @param f Field, packed with the information, as returned by #pack
16
+ * @returns Array of Character
17
+ */
18
+ unpack(f: Field): Character[];
19
+ /**
20
+ *
21
+ * @param characters Array of Character to be packed
22
+ * @returns Instance of the implementing class
23
+ */
24
+ fromCharacters(input: Array<Character>): {
25
+ toString(): string;
26
+ assertEquals(other: {
27
+ assertEquals(other: any): void;
28
+ packed: import("o1js/dist/node/lib/field.js").Field;
29
+ }): void;
30
+ packed: import("o1js/dist/node/lib/field.js").Field;
31
+ };
32
+ /**
33
+ *
34
+ * @param str string to be packed
35
+ * @returns Instance of the implementing class
36
+ */
37
+ fromString(str: string): {
38
+ toString(): string;
39
+ assertEquals(other: {
40
+ assertEquals(other: any): void;
41
+ packed: import("o1js/dist/node/lib/field.js").Field;
42
+ }): void;
43
+ packed: import("o1js/dist/node/lib/field.js").Field;
44
+ };
45
+ /**
46
+ *
47
+ * @param f Field, packed with the information, as returned by #pack
48
+ * @returns Array of Character
49
+ */
50
+ type: import("o1js/dist/node/bindings/lib/provable-snarky.js").ProvableExtended<{
51
+ packed: import("o1js/dist/node/lib/field.js").Field;
52
+ }, {
53
+ packed: string;
54
+ }>;
55
+ l: number;
56
+ bitSize: bigint;
57
+ checkPack(unpacked: Character[]): void;
58
+ pack(unpacked: Character[]): import("o1js/dist/node/lib/field.js").Field;
59
+ unpackToBigints(f: import("o1js/dist/node/lib/field.js").Field): bigint[];
60
+ _isStruct: true;
61
+ toFields: (value: {
62
+ packed: import("o1js/dist/node/lib/field.js").Field;
63
+ }) => import("o1js/dist/node/lib/field.js").Field[];
64
+ toAuxiliary: (value?: {
65
+ packed: import("o1js/dist/node/lib/field.js").Field;
66
+ } | undefined) => any[];
67
+ fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
68
+ packed: import("o1js/dist/node/lib/field.js").Field;
69
+ };
70
+ sizeInFields(): number;
71
+ check: (value: {
72
+ packed: import("o1js/dist/node/lib/field.js").Field;
73
+ }) => void;
74
+ toInput: (x: {
75
+ packed: import("o1js/dist/node/lib/field.js").Field;
76
+ }) => {
77
+ fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
78
+ packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
79
+ };
80
+ toJSON: (x: {
81
+ packed: import("o1js/dist/node/lib/field.js").Field;
82
+ }) => {
83
+ packed: string;
84
+ };
85
+ fromJSON: (x: {
86
+ packed: string;
87
+ }) => {
88
+ packed: import("o1js/dist/node/lib/field.js").Field;
89
+ };
90
+ };
91
+ /**
92
+ *
93
+ * @param n number of fields to employ to store the string
94
+ * @returns MultiPackedString_ class with length of n * CHARS_PER_FIELD
95
+ */
96
+ export declare function MultiPackedStringFactory(n?: number): {
97
+ new (packed: import("o1js/dist/node/lib/field.js").Field[]): {
98
+ toString(): string;
99
+ assertEquals(other: {
100
+ assertEquals(other: any): void;
101
+ packed: import("o1js/dist/node/lib/field.js").Field[];
102
+ }): void;
103
+ packed: import("o1js/dist/node/lib/field.js").Field[];
104
+ };
105
+ extractField(input: Character): Field;
106
+ sizeInBits(): bigint;
107
+ elementsPerField(): number;
108
+ /**
109
+ *
110
+ * @param fields Array of Fields, containing packed Characters
111
+ * @returns Array of Character
112
+ */
113
+ unpack(fields: Field[]): Character[];
114
+ /**
115
+ *
116
+ * @param characters Array of Character to be packed
117
+ * @returns Instance of the implementing class
118
+ */
119
+ fromCharacters(input: Array<Character>): {
120
+ toString(): string;
121
+ assertEquals(other: {
122
+ assertEquals(other: any): void;
123
+ packed: import("o1js/dist/node/lib/field.js").Field[];
124
+ }): void;
125
+ packed: import("o1js/dist/node/lib/field.js").Field[];
126
+ };
127
+ /**
128
+ *
129
+ * @param str string to be packed
130
+ * @returns Instance of the implementing class
131
+ */
132
+ fromString(str: string): {
133
+ toString(): string;
134
+ assertEquals(other: {
135
+ assertEquals(other: any): void;
136
+ packed: import("o1js/dist/node/lib/field.js").Field[];
137
+ }): void;
138
+ packed: import("o1js/dist/node/lib/field.js").Field[];
139
+ };
140
+ type: import("o1js/dist/node/bindings/lib/provable-snarky.js").ProvableExtended<{
141
+ packed: import("o1js/dist/node/lib/field.js").Field[];
142
+ }, {
143
+ packed: string[];
144
+ }>;
145
+ l: number;
146
+ n: number;
147
+ bitSize: bigint;
148
+ checkPack(unpacked: Character[]): void;
149
+ pack(unpacked: Character[]): import("o1js/dist/node/lib/field.js").Field[];
150
+ unpackToBigints(fields: import("o1js/dist/node/lib/field.js").Field[]): bigint[];
151
+ _isStruct: true;
152
+ toFields: (value: {
153
+ packed: import("o1js/dist/node/lib/field.js").Field[];
154
+ }) => import("o1js/dist/node/lib/field.js").Field[];
155
+ toAuxiliary: (value?: {
156
+ packed: import("o1js/dist/node/lib/field.js").Field[];
157
+ } | undefined) => any[];
158
+ fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
159
+ packed: import("o1js/dist/node/lib/field.js").Field[];
160
+ };
161
+ sizeInFields(): number;
162
+ check: (value: {
163
+ packed: import("o1js/dist/node/lib/field.js").Field[];
164
+ }) => void;
165
+ toInput: (x: {
166
+ packed: import("o1js/dist/node/lib/field.js").Field[];
167
+ }) => {
168
+ fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
169
+ packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
170
+ };
171
+ toJSON: (x: {
172
+ packed: import("o1js/dist/node/lib/field.js").Field[];
173
+ }) => {
174
+ packed: string[];
175
+ };
176
+ fromJSON: (x: {
177
+ packed: string[];
178
+ }) => {
179
+ packed: import("o1js/dist/node/lib/field.js").Field[];
180
+ };
181
+ };
@@ -1,83 +1,128 @@
1
- import { Field, Provable, Character } from 'o1js';
2
- import { MultiPackingPlant } from '../PackingPlant.js';
3
- const SIZE_IN_BITS = 16n;
4
- const CHARS_PER_FIELD = 15;
5
- export function PackedStringFactory(l) {
6
- class PackedString_ extends MultiPackingPlant(Character, l, SIZE_IN_BITS) {
7
- static toAuxiliary(value) {
8
- const auxiliary = Provable.witness(Provable.Array(Character, l), () => {
9
- let uints_ = new Array(l);
10
- uints_.fill(0n);
11
- let packedNs = new Array(this.n);
12
- packedNs.fill(0n);
13
- const packedArg = new Array(this.n);
14
- packedArg.fill(Field(0), 0, this.n);
15
- for (let i = 0; i < this.n; i++) {
16
- if (value?.packed[i]) {
17
- packedArg[i] = value?.packed[i];
18
- }
19
- }
20
- if (packedArg.length !== this.n) {
21
- throw new Error(`Packed value must be exactly ${this.n} in length`);
22
- }
23
- for (let i = 0; i < this.n; i++) {
24
- packedNs[i] = packedArg[i].toConstant().toBigInt();
25
- }
26
- for (let i = 0; i < packedNs.length; i++) {
27
- let packedN = packedNs[i];
28
- for (let j = 0; j < CHARS_PER_FIELD; j++) {
29
- const k = i * CHARS_PER_FIELD + j;
30
- uints_[k] = packedN & ((1n << SIZE_IN_BITS) - 1n);
31
- packedN >>= SIZE_IN_BITS;
32
- }
33
- }
34
- return uints_.map((x) => Character.fromString(String.fromCharCode(Number(x))));
35
- });
36
- return auxiliary;
37
- }
38
- static pack(aux) {
39
- let fields = [];
40
- let mutableAux = [...aux];
41
- while (mutableAux.length > 0) {
42
- const initialChar = mutableAux.shift();
43
- if (!initialChar) {
44
- throw new Error('Unexpected Array Length');
45
- }
46
- // f = initialChar.value is the same as f = 0; f += char.value * c^0;
47
- // If f is initialized as 0, then it is a "constant" field and can't be added to a "variable" field in a proof
48
- let f = initialChar.value;
49
- const n = Math.min(mutableAux.length + 1, CHARS_PER_FIELD);
50
- for (let i = 1; i < n; i++) {
51
- const char = mutableAux.shift();
52
- if (!char) {
53
- throw new Error('Unexpected Array Length');
54
- }
55
- const value = char.value || Field(0);
56
- const c = Field((2n ** SIZE_IN_BITS) ** BigInt(i));
57
- f = f.add(value.mul(c));
58
- }
59
- fields.push(f);
60
- }
61
- return fields;
62
- }
63
- static fromString(str) {
64
- let characters = [];
65
- for (let i = 0; i < str.length; i++) {
66
- characters.push(Character.fromString(str[i]));
67
- }
68
- return this.fromAuxiliary(characters);
69
- }
70
- static fromAuxiliary(aux) {
71
- const packed = this.pack(aux);
72
- return new PackedString_(packed, aux);
73
- }
74
- toString() {
75
- const nullChar = String.fromCharCode(0);
76
- return PackedString_.unpack(this.packed)
77
- .filter((c) => c.toString() !== nullChar)
78
- .join('');
79
- }
80
- }
81
- return PackedString_;
82
- }
1
+ import { Field, Provable, Character, Poseidon } from 'o1js';
2
+ import { PackingPlant, MultiPackingPlant } from '../PackingPlant.js';
3
+ const SIZE_IN_BITS = 16n;
4
+ const L = 15; // Default to one-field worth of characters
5
+ const CHARS_PER_FIELD = 15;
6
+ export function PackedStringFactory(l = L) {
7
+ class PackedString_ extends PackingPlant(Character, l, SIZE_IN_BITS) {
8
+ static extractField(input) {
9
+ return input.value;
10
+ }
11
+ static sizeInBits() {
12
+ return SIZE_IN_BITS;
13
+ }
14
+ /**
15
+ *
16
+ * @param f Field, packed with the information, as returned by #pack
17
+ * @returns Array of Character
18
+ */
19
+ static unpack(f) {
20
+ const unpacked = Provable.witness(Provable.Array(Character, l), () => {
21
+ const unpacked = this.unpackToBigints(f);
22
+ return unpacked.map((x) => Character.fromString(String.fromCharCode(Number(x))));
23
+ });
24
+ f.assertEquals(PackedString_.pack(unpacked));
25
+ return unpacked;
26
+ }
27
+ /**
28
+ *
29
+ * @param characters Array of Character to be packed
30
+ * @returns Instance of the implementing class
31
+ */
32
+ static fromCharacters(input) {
33
+ let characters = new Array(this.l);
34
+ characters.fill(new Character(Field(0)), 0, this.l);
35
+ for (let i = 0; i < input.length; i++) {
36
+ characters[i] = input[i];
37
+ }
38
+ const packed = this.pack(characters);
39
+ return new PackedString_(packed);
40
+ }
41
+ /**
42
+ *
43
+ * @param str string to be packed
44
+ * @returns Instance of the implementing class
45
+ */
46
+ static fromString(str) {
47
+ let characters = new Array(this.l);
48
+ characters.fill(new Character(Field(0)), 0, this.l);
49
+ for (let i = 0; i < str.length; i++) {
50
+ characters[i] = Character.fromString(str[i]);
51
+ }
52
+ return this.fromCharacters(characters);
53
+ }
54
+ toString() {
55
+ const nullChar = String.fromCharCode(0);
56
+ return PackedString_.unpack(this.packed)
57
+ .filter((c) => c.toString() !== nullChar)
58
+ .join('');
59
+ }
60
+ }
61
+ return PackedString_;
62
+ }
63
+ /**
64
+ *
65
+ * @param n number of fields to employ to store the string
66
+ * @returns MultiPackedString_ class with length of n * CHARS_PER_FIELD
67
+ */
68
+ export function MultiPackedStringFactory(n = 8) {
69
+ class MultiPackedString_ extends MultiPackingPlant(Character, n * CHARS_PER_FIELD, SIZE_IN_BITS) {
70
+ static extractField(input) {
71
+ return input.value;
72
+ }
73
+ static sizeInBits() {
74
+ return SIZE_IN_BITS;
75
+ }
76
+ static elementsPerField() {
77
+ return CHARS_PER_FIELD;
78
+ }
79
+ /**
80
+ *
81
+ * @param fields Array of Fields, containing packed Characters
82
+ * @returns Array of Character
83
+ */
84
+ static unpack(fields) {
85
+ const unpacked = Provable.witness(Provable.Array(Character, this.l), () => {
86
+ let unpacked = this.unpackToBigints(fields);
87
+ return unpacked.map((x) => Character.fromString(String.fromCharCode(Number(x))));
88
+ });
89
+ Poseidon.hash(fields).assertEquals(Poseidon.hash(MultiPackedString_.pack(unpacked)));
90
+ return unpacked;
91
+ }
92
+ /**
93
+ *
94
+ * @param characters Array of Character to be packed
95
+ * @returns Instance of the implementing class
96
+ */
97
+ static fromCharacters(input) {
98
+ let characters = new Array(this.l);
99
+ characters.fill(new Character(Field(0)), 0, this.l);
100
+ for (let i = 0; i < input.length; i++) {
101
+ characters[i] = input[i];
102
+ }
103
+ const packed = this.pack(characters);
104
+ return new MultiPackedString_(packed);
105
+ }
106
+ /**
107
+ *
108
+ * @param str string to be packed
109
+ * @returns Instance of the implementing class
110
+ */
111
+ static fromString(str) {
112
+ let characters = new Array(this.l);
113
+ characters.fill(new Character(Field(0)), 0, this.l);
114
+ for (let i = 0; i < str.length; i++) {
115
+ characters[i] = Character.fromString(str[i]);
116
+ }
117
+ return this.fromCharacters(characters);
118
+ }
119
+ toString() {
120
+ const nullChar = String.fromCharCode(0);
121
+ return MultiPackedString_.unpack(this.packed)
122
+ .filter((c) => c.toString() !== nullChar)
123
+ .join('');
124
+ }
125
+ }
126
+ return MultiPackedString_;
127
+ }
83
128
  //# sourceMappingURL=PackedString.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackedString.js","sourceRoot":"","sources":["../../../../src/lib/packed-types/PackedString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,mBAAmB,CAAC,CAAS;IAC3C,MAAM,aAAc,SAAQ,iBAAiB,CAAC,SAAS,EAAE,CAAC,EAAE,YAAY,CAAC;QACvE,MAAM,CAAC,WAAW,CAChB,KAA4C;YAE5C,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE;gBACpE,IAAI,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAChB,IAAI,QAAQ,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAClB,MAAM,SAAS,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;oBAC/B,IAAI,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;wBACpB,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,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