typia 7.0.0-dev.20241009-2 → 7.0.0-dev.20241010

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 (151) hide show
  1. package/lib/factories/JsonMetadataFactory.d.ts +5 -1
  2. package/lib/factories/JsonMetadataFactory.js +4 -1
  3. package/lib/factories/JsonMetadataFactory.js.map +1 -1
  4. package/lib/internal/{$httpFormDataReadArray.js → $httpFormdataReadArray.js} +1 -1
  5. package/lib/internal/$httpFormdataReadArray.js.map +1 -0
  6. package/lib/programmers/CheckerProgrammer.js +4 -1
  7. package/lib/programmers/CheckerProgrammer.js.map +1 -1
  8. package/lib/programmers/FeatureProgrammer.d.ts +4 -1
  9. package/lib/programmers/FeatureProgrammer.js +2 -2
  10. package/lib/programmers/FeatureProgrammer.js.map +1 -1
  11. package/lib/programmers/RandomProgrammer.js +12 -9
  12. package/lib/programmers/RandomProgrammer.js.map +1 -1
  13. package/lib/programmers/TypiaProgrammer.js +4 -1
  14. package/lib/programmers/TypiaProgrammer.js.map +1 -1
  15. package/lib/programmers/internal/prune_object_properties.js +3 -2
  16. package/lib/programmers/internal/prune_object_properties.js.map +1 -1
  17. package/lib/programmers/json/JsonAssertParseProgrammer.js +2 -2
  18. package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -1
  19. package/lib/programmers/misc/MiscCloneProgrammer.js +4 -1
  20. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
  21. package/lib/programmers/misc/MiscPruneProgrammer.js +4 -1
  22. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
  23. package/lib/programmers/notations/NotationGeneralProgrammer.js +4 -1
  24. package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -1
  25. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js +1 -1
  26. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -1
  27. package/lib/transformers/FileTransformer.js +0 -6
  28. package/lib/transformers/FileTransformer.js.map +1 -1
  29. package/lib/transformers/ImportTransformer.d.ts +4 -1
  30. package/lib/transformers/ImportTransformer.js +34 -30
  31. package/lib/transformers/ImportTransformer.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/IRandomGenerator.ts +49 -49
  34. package/src/factories/ExpressionFactory.ts +164 -164
  35. package/src/factories/JsonMetadataFactory.ts +25 -15
  36. package/src/factories/LiteralFactory.ts +50 -50
  37. package/src/factories/MetadataCommentTagFactory.ts +650 -650
  38. package/src/functional.ts +750 -750
  39. package/src/http.ts +1042 -1042
  40. package/src/internal/$IProtobufWriter.ts +18 -18
  41. package/src/internal/$ProtobufReader.ts +194 -194
  42. package/src/internal/$ProtobufSizer.ts +151 -151
  43. package/src/internal/$ProtobufWriter.ts +145 -145
  44. package/src/internal/$accessExpressionAsString.ts +46 -46
  45. package/src/internal/$assertGuard.ts +13 -13
  46. package/src/internal/$functionalTypeGuardErrorFactory.ts +4 -4
  47. package/src/internal/$httpFormDataReadBigint.ts +18 -18
  48. package/src/internal/$httpFormDataReadBlob.ts +10 -10
  49. package/src/internal/$httpFormDataReadBoolean.ts +16 -16
  50. package/src/internal/$httpFormDataReadFile.ts +10 -10
  51. package/src/internal/$httpFormDataReadNumber.ts +15 -15
  52. package/src/internal/$httpFormDataReadString.ts +10 -10
  53. package/src/internal/{$httpFormDataReadArray.ts → $httpFormdataReadArray.ts} +4 -4
  54. package/src/internal/$httpHeaderReadBigint.ts +10 -10
  55. package/src/internal/$httpHeaderReadBoolean.ts +8 -8
  56. package/src/internal/$httpHeaderReadNumber.ts +7 -7
  57. package/src/internal/$httpParameterBigint.ts +10 -10
  58. package/src/internal/$httpParameterBoolean.ts +8 -8
  59. package/src/internal/$httpParameterNumber.ts +7 -7
  60. package/src/internal/$httpParameterString.ts +2 -2
  61. package/src/internal/$httpQueryParseURLSearchParams.ts +10 -10
  62. package/src/internal/$httpQueryReadArray.ts +4 -4
  63. package/src/internal/$httpQueryReadBigint.ts +12 -12
  64. package/src/internal/$httpQueryReadBoolean.ts +14 -14
  65. package/src/internal/$httpQueryReadNumber.ts +9 -9
  66. package/src/internal/$httpQueryReadString.ts +4 -4
  67. package/src/internal/$isBetween.ts +2 -2
  68. package/src/internal/$isBigintString.ts +8 -8
  69. package/src/internal/$jsonStringifyNumber.ts +12 -12
  70. package/src/internal/$jsonStringifyRest.ts +3 -3
  71. package/src/internal/$jsonStringifyString.ts +42 -42
  72. package/src/internal/$jsonStringifyTail.ts +2 -2
  73. package/src/internal/$llmApplicationFinalize.ts +18 -18
  74. package/src/internal/$miscCloneAny.ts +48 -48
  75. package/src/internal/$notationAny.ts +37 -37
  76. package/src/internal/$notationCamel.ts +13 -13
  77. package/src/internal/$notationPascal.ts +8 -8
  78. package/src/internal/$notationSnake.ts +43 -43
  79. package/src/internal/$randomArray.ts +21 -21
  80. package/src/internal/$randomBigint.ts +6 -6
  81. package/src/internal/$randomBoolean.ts +1 -1
  82. package/src/internal/$randomFormatByte.ts +3 -3
  83. package/src/internal/$randomFormatDate.ts +18 -18
  84. package/src/internal/$randomFormatDatetime.ts +16 -16
  85. package/src/internal/$randomFormatDuration.ts +27 -27
  86. package/src/internal/$randomFormatEmail.ts +11 -11
  87. package/src/internal/$randomFormatHostname.ts +6 -6
  88. package/src/internal/$randomFormatIdnEmail.ts +3 -3
  89. package/src/internal/$randomFormatIdnHostname.ts +3 -3
  90. package/src/internal/$randomFormatIpv4.ts +11 -11
  91. package/src/internal/$randomFormatIpv6.ts +11 -11
  92. package/src/internal/$randomFormatIri.ts +3 -3
  93. package/src/internal/$randomFormatIriReference.ts +3 -3
  94. package/src/internal/$randomFormatJsonPointer.ts +7 -7
  95. package/src/internal/$randomFormatPassword.ts +8 -8
  96. package/src/internal/$randomFormatRegex.ts +4 -4
  97. package/src/internal/$randomFormatRelativeJsonPointer.ts +8 -8
  98. package/src/internal/$randomFormatTime.ts +14 -14
  99. package/src/internal/$randomFormatUri.ts +3 -3
  100. package/src/internal/$randomFormatUriReference.ts +3 -3
  101. package/src/internal/$randomFormatUriTemplate.ts +3 -3
  102. package/src/internal/$randomFormatUrl.ts +11 -11
  103. package/src/internal/$randomFormatUuid.ts +6 -6
  104. package/src/internal/$randomInteger.ts +47 -47
  105. package/src/internal/$randomNumber.ts +74 -74
  106. package/src/internal/$randomPattern.ts +10 -10
  107. package/src/internal/$randomPick.ts +9 -9
  108. package/src/internal/$randomString.ts +24 -24
  109. package/src/internal/$throwTypeGuardError.ts +5 -5
  110. package/src/internal/$validateReport.ts +13 -13
  111. package/src/internal/private/$__notationCapitalize.ts +2 -2
  112. package/src/internal/private/$__notationUnsnake.ts +24 -24
  113. package/src/json.ts +651 -651
  114. package/src/llm.ts +178 -178
  115. package/src/misc.ts +658 -658
  116. package/src/module.ts +933 -933
  117. package/src/notations.ts +827 -827
  118. package/src/programmers/CheckerProgrammer.ts +4 -1
  119. package/src/programmers/FeatureProgrammer.ts +619 -616
  120. package/src/programmers/RandomProgrammer.ts +24 -16
  121. package/src/programmers/TypiaProgrammer.ts +4 -1
  122. package/src/programmers/functional/FunctionalAssertFunctionProgrammer.ts +153 -153
  123. package/src/programmers/functional/FunctionalAssertParametersProgrammer.ts +125 -125
  124. package/src/programmers/functional/FunctionalAssertReturnProgrammer.ts +115 -115
  125. package/src/programmers/functional/FunctionalValidateFunctionProgrammer.ts +119 -119
  126. package/src/programmers/functional/FunctionalValidateParametersProgrammer.ts +274 -274
  127. package/src/programmers/functional/FunctionalValidateReturnProgrammer.ts +135 -135
  128. package/src/programmers/helpers/FunctionProgrammer.ts +67 -67
  129. package/src/programmers/helpers/RandomJoiner.ts +168 -168
  130. package/src/programmers/helpers/StringifyJoinder.ts +115 -115
  131. package/src/programmers/helpers/disable_function_programmer_declare.ts +32 -32
  132. package/src/programmers/internal/check_dynamic_key.ts +201 -201
  133. package/src/programmers/internal/check_dynamic_properties.ts +208 -208
  134. package/src/programmers/internal/check_object.ts +75 -75
  135. package/src/programmers/internal/feature_object_entries.ts +61 -61
  136. package/src/programmers/internal/prune_object_properties.ts +71 -63
  137. package/src/programmers/json/JsonAssertParseProgrammer.ts +14 -11
  138. package/src/programmers/llm/LlmApplicationProgrammer.ts +235 -235
  139. package/src/programmers/llm/LlmSchemaProgrammer.ts +51 -51
  140. package/src/programmers/misc/MiscCloneProgrammer.ts +4 -1
  141. package/src/programmers/misc/MiscPruneProgrammer.ts +4 -1
  142. package/src/programmers/notations/NotationGeneralProgrammer.ts +4 -1
  143. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +1 -1
  144. package/src/protobuf.ts +868 -868
  145. package/src/reflect.ts +57 -57
  146. package/src/transformers/FileTransformer.ts +0 -6
  147. package/src/transformers/ImportTransformer.ts +59 -44
  148. package/src/utils/NamingConvention.ts +94 -94
  149. package/src/utils/StringUtil.ts +16 -16
  150. package/lib/internal/$httpFormDataReadArray.js.map +0 -1
  151. /package/lib/internal/{$httpFormDataReadArray.d.ts → $httpFormdataReadArray.d.ts} +0 -0
@@ -1,18 +1,18 @@
1
- export interface $IProtobufWriter {
2
- bool(value: boolean): void;
3
- int32(value: number): void;
4
- sint32(value: number): void;
5
- uint32(value: number): void;
6
-
7
- int64(value: bigint | number): void;
8
- sint64(value: bigint | number): void;
9
- uint64(value: bigint | number): void;
10
-
11
- float(value: number): void;
12
- double(value: number): void;
13
- bytes(value: Uint8Array): void;
14
- string(value: string): void;
15
-
16
- fork(): void;
17
- ldelim(): void;
18
- }
1
+ export interface $IProtobufWriter {
2
+ bool(value: boolean): void;
3
+ int32(value: number): void;
4
+ sint32(value: number): void;
5
+ uint32(value: number): void;
6
+
7
+ int64(value: bigint | number): void;
8
+ sint64(value: bigint | number): void;
9
+ uint64(value: bigint | number): void;
10
+
11
+ float(value: number): void;
12
+ double(value: number): void;
13
+ bytes(value: Uint8Array): void;
14
+ string(value: string): void;
15
+
16
+ fork(): void;
17
+ ldelim(): void;
18
+ }
@@ -1,194 +1,194 @@
1
- import { ProtobufWire } from "../programmers/helpers/ProtobufWire";
2
-
3
- import { Singleton } from "../utils/Singleton";
4
-
5
- /// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedReader.ts
6
- export class $ProtobufReader {
7
- /**
8
- * Read buffer
9
- */
10
- private buf: Uint8Array;
11
-
12
- /**
13
- * Read buffer pointer.
14
- */
15
- private ptr: number;
16
-
17
- /**
18
- * DataView for buffer.
19
- */
20
- private view: DataView;
21
-
22
- public constructor(buf: Uint8Array) {
23
- this.buf = buf;
24
- this.ptr = 0;
25
- this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
26
- }
27
-
28
- public index(): number {
29
- return this.ptr;
30
- }
31
-
32
- public size(): number {
33
- return this.buf.length;
34
- }
35
-
36
- public uint32(): number {
37
- return this.varint32();
38
- }
39
-
40
- public int32(): number {
41
- return this.varint32();
42
- }
43
-
44
- public sint32(): number {
45
- const value: number = this.varint32();
46
- return (value >>> 1) ^ -(value & 1);
47
- }
48
-
49
- public uint64(): bigint {
50
- return this.varint64();
51
- }
52
-
53
- public int64(): bigint {
54
- return this.varint64();
55
- }
56
-
57
- public sint64(): bigint {
58
- const value = this.varint64();
59
- return (value >> BigInt(0x01)) ^ -(value & BigInt(0x01));
60
- }
61
-
62
- public bool(): boolean {
63
- return this.varint32() !== 0;
64
- }
65
-
66
- public float(): number {
67
- const value: number = this.view.getFloat32(this.ptr, true);
68
- this.ptr += 4;
69
- return value;
70
- }
71
-
72
- public double(): number {
73
- const value: number = this.view.getFloat64(this.ptr, true);
74
- this.ptr += 8;
75
- return value;
76
- }
77
-
78
- public bytes(): Uint8Array {
79
- const length: number = this.uint32();
80
- const from: number = this.ptr;
81
- this.ptr += length;
82
- return this.buf.subarray(from, from + length);
83
- }
84
-
85
- public string(): string {
86
- return utf8.get().decode(this.bytes());
87
- }
88
-
89
- public skip(length: number): void {
90
- if (length === 0) while (this.u8() & 0x80);
91
- else {
92
- if (this.index() + length > this.size())
93
- throw new Error("Error on typia.protobuf.decode(): buffer overflow.");
94
- this.ptr += length;
95
- }
96
- }
97
-
98
- public skipType(wireType: ProtobufWire): void {
99
- switch (wireType) {
100
- case ProtobufWire.VARIANT:
101
- this.skip(0);
102
- break;
103
- case ProtobufWire.I64:
104
- this.skip(8);
105
- break;
106
- case ProtobufWire.LEN:
107
- this.skip(this.uint32());
108
- break;
109
- case ProtobufWire.START_GROUP:
110
- while ((wireType = this.uint32() & 0x07) !== ProtobufWire.END_GROUP)
111
- this.skipType(wireType);
112
- break;
113
- case ProtobufWire.I32:
114
- this.skip(4);
115
- break;
116
- default:
117
- throw new Error(`Invalid wire type ${wireType} at offset ${this.ptr}.`);
118
- }
119
- }
120
-
121
- private varint32(): number {
122
- let loaded: number;
123
- let value: number;
124
-
125
- value = (loaded = this.u8()) & 0x7f;
126
- if (loaded < 0x80) return value;
127
-
128
- value |= ((loaded = this.u8()) & 0x7f) << 7;
129
- if (loaded < 0x80) return value;
130
-
131
- value |= ((loaded = this.u8()) & 0x7f) << 14;
132
- if (loaded < 0x80) return value;
133
-
134
- value |= ((loaded = this.u8()) & 0x7f) << 21;
135
- if (loaded < 0x80) return value;
136
-
137
- value |= ((loaded = this.u8()) & 0xf) << 28;
138
- if (loaded < 0x80) return value;
139
-
140
- // increment position until there is no continuation bit or until we read 10 bytes
141
- if (this.u8() < 0x80) return value;
142
- if (this.u8() < 0x80) return value;
143
- if (this.u8() < 0x80) return value;
144
- if (this.u8() < 0x80) return value;
145
- if (this.u8() < 0x80) return value;
146
-
147
- return value;
148
- }
149
-
150
- private varint64(): bigint {
151
- let loaded: bigint;
152
- let value: bigint;
153
-
154
- value = (loaded = this.u8n()) & BigInt(0x7f);
155
- if (loaded < BigInt(0x80)) return value;
156
-
157
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(7);
158
- if (loaded < BigInt(0x80)) return value;
159
-
160
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(14);
161
- if (loaded < BigInt(0x80)) return value;
162
-
163
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(21);
164
- if (loaded < BigInt(0x80)) return value;
165
-
166
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(28);
167
- if (loaded < BigInt(0x80)) return value;
168
-
169
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(35);
170
- if (loaded < BigInt(0x80)) return value;
171
-
172
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(42);
173
- if (loaded < BigInt(0x80)) return value;
174
-
175
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(49);
176
- if (loaded < BigInt(0x80)) return value;
177
-
178
- value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(56);
179
- if (loaded < BigInt(0x80)) return value;
180
-
181
- value |= (this.u8n() & BigInt(0x01)) << BigInt(63);
182
- return BigInt.asIntN(64, value);
183
- }
184
-
185
- private u8(): number {
186
- return this.view.getUint8(this.ptr++);
187
- }
188
-
189
- private u8n(): bigint {
190
- return BigInt(this.u8());
191
- }
192
- }
193
-
194
- const utf8 = /** @__PURE__ */ new Singleton(() => new TextDecoder("utf-8"));
1
+ import { ProtobufWire } from "../programmers/helpers/ProtobufWire";
2
+
3
+ import { Singleton } from "../utils/Singleton";
4
+
5
+ /// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedReader.ts
6
+ export class $ProtobufReader {
7
+ /**
8
+ * Read buffer
9
+ */
10
+ private buf: Uint8Array;
11
+
12
+ /**
13
+ * Read buffer pointer.
14
+ */
15
+ private ptr: number;
16
+
17
+ /**
18
+ * DataView for buffer.
19
+ */
20
+ private view: DataView;
21
+
22
+ public constructor(buf: Uint8Array) {
23
+ this.buf = buf;
24
+ this.ptr = 0;
25
+ this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
26
+ }
27
+
28
+ public index(): number {
29
+ return this.ptr;
30
+ }
31
+
32
+ public size(): number {
33
+ return this.buf.length;
34
+ }
35
+
36
+ public uint32(): number {
37
+ return this.varint32();
38
+ }
39
+
40
+ public int32(): number {
41
+ return this.varint32();
42
+ }
43
+
44
+ public sint32(): number {
45
+ const value: number = this.varint32();
46
+ return (value >>> 1) ^ -(value & 1);
47
+ }
48
+
49
+ public uint64(): bigint {
50
+ return this.varint64();
51
+ }
52
+
53
+ public int64(): bigint {
54
+ return this.varint64();
55
+ }
56
+
57
+ public sint64(): bigint {
58
+ const value = this.varint64();
59
+ return (value >> BigInt(0x01)) ^ -(value & BigInt(0x01));
60
+ }
61
+
62
+ public bool(): boolean {
63
+ return this.varint32() !== 0;
64
+ }
65
+
66
+ public float(): number {
67
+ const value: number = this.view.getFloat32(this.ptr, true);
68
+ this.ptr += 4;
69
+ return value;
70
+ }
71
+
72
+ public double(): number {
73
+ const value: number = this.view.getFloat64(this.ptr, true);
74
+ this.ptr += 8;
75
+ return value;
76
+ }
77
+
78
+ public bytes(): Uint8Array {
79
+ const length: number = this.uint32();
80
+ const from: number = this.ptr;
81
+ this.ptr += length;
82
+ return this.buf.subarray(from, from + length);
83
+ }
84
+
85
+ public string(): string {
86
+ return utf8.get().decode(this.bytes());
87
+ }
88
+
89
+ public skip(length: number): void {
90
+ if (length === 0) while (this.u8() & 0x80);
91
+ else {
92
+ if (this.index() + length > this.size())
93
+ throw new Error("Error on typia.protobuf.decode(): buffer overflow.");
94
+ this.ptr += length;
95
+ }
96
+ }
97
+
98
+ public skipType(wireType: ProtobufWire): void {
99
+ switch (wireType) {
100
+ case ProtobufWire.VARIANT:
101
+ this.skip(0);
102
+ break;
103
+ case ProtobufWire.I64:
104
+ this.skip(8);
105
+ break;
106
+ case ProtobufWire.LEN:
107
+ this.skip(this.uint32());
108
+ break;
109
+ case ProtobufWire.START_GROUP:
110
+ while ((wireType = this.uint32() & 0x07) !== ProtobufWire.END_GROUP)
111
+ this.skipType(wireType);
112
+ break;
113
+ case ProtobufWire.I32:
114
+ this.skip(4);
115
+ break;
116
+ default:
117
+ throw new Error(`Invalid wire type ${wireType} at offset ${this.ptr}.`);
118
+ }
119
+ }
120
+
121
+ private varint32(): number {
122
+ let loaded: number;
123
+ let value: number;
124
+
125
+ value = (loaded = this.u8()) & 0x7f;
126
+ if (loaded < 0x80) return value;
127
+
128
+ value |= ((loaded = this.u8()) & 0x7f) << 7;
129
+ if (loaded < 0x80) return value;
130
+
131
+ value |= ((loaded = this.u8()) & 0x7f) << 14;
132
+ if (loaded < 0x80) return value;
133
+
134
+ value |= ((loaded = this.u8()) & 0x7f) << 21;
135
+ if (loaded < 0x80) return value;
136
+
137
+ value |= ((loaded = this.u8()) & 0xf) << 28;
138
+ if (loaded < 0x80) return value;
139
+
140
+ // increment position until there is no continuation bit or until we read 10 bytes
141
+ if (this.u8() < 0x80) return value;
142
+ if (this.u8() < 0x80) return value;
143
+ if (this.u8() < 0x80) return value;
144
+ if (this.u8() < 0x80) return value;
145
+ if (this.u8() < 0x80) return value;
146
+
147
+ return value;
148
+ }
149
+
150
+ private varint64(): bigint {
151
+ let loaded: bigint;
152
+ let value: bigint;
153
+
154
+ value = (loaded = this.u8n()) & BigInt(0x7f);
155
+ if (loaded < BigInt(0x80)) return value;
156
+
157
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(7);
158
+ if (loaded < BigInt(0x80)) return value;
159
+
160
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(14);
161
+ if (loaded < BigInt(0x80)) return value;
162
+
163
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(21);
164
+ if (loaded < BigInt(0x80)) return value;
165
+
166
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(28);
167
+ if (loaded < BigInt(0x80)) return value;
168
+
169
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(35);
170
+ if (loaded < BigInt(0x80)) return value;
171
+
172
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(42);
173
+ if (loaded < BigInt(0x80)) return value;
174
+
175
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(49);
176
+ if (loaded < BigInt(0x80)) return value;
177
+
178
+ value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(56);
179
+ if (loaded < BigInt(0x80)) return value;
180
+
181
+ value |= (this.u8n() & BigInt(0x01)) << BigInt(63);
182
+ return BigInt.asIntN(64, value);
183
+ }
184
+
185
+ private u8(): number {
186
+ return this.view.getUint8(this.ptr++);
187
+ }
188
+
189
+ private u8n(): bigint {
190
+ return BigInt(this.u8());
191
+ }
192
+ }
193
+
194
+ const utf8 = /** @__PURE__ */ new Singleton(() => new TextDecoder("utf-8"));