bin-serde 1.5.0 → 1.5.1
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/index.ts +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -184,6 +184,12 @@ export class Reader {
|
|
|
184
184
|
return this.bytes[this.pos++];
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
readUInt16() {
|
|
188
|
+
const val = this.view.getUint16(this.pos);
|
|
189
|
+
this.pos += 2;
|
|
190
|
+
return val;
|
|
191
|
+
}
|
|
192
|
+
|
|
187
193
|
readUInt32() {
|
|
188
194
|
const val = this.view.getUint32(this.pos);
|
|
189
195
|
this.pos += 4;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -164,6 +164,11 @@ export class Reader {
|
|
|
164
164
|
readUInt8() {
|
|
165
165
|
return this.bytes[this.pos++];
|
|
166
166
|
}
|
|
167
|
+
readUInt16() {
|
|
168
|
+
const val = this.view.getUint16(this.pos);
|
|
169
|
+
this.pos += 2;
|
|
170
|
+
return val;
|
|
171
|
+
}
|
|
167
172
|
readUInt32() {
|
|
168
173
|
const val = this.view.getUint32(this.pos);
|
|
169
174
|
this.pos += 4;
|