@andrew_l/tl-pack 0.1.5 → 0.1.7
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/dist/BinaryReader.js +1 -1
- package/dist/BinaryWriter.js +10 -1
- package/package.json +1 -1
package/dist/BinaryReader.js
CHANGED
package/dist/BinaryWriter.js
CHANGED
|
@@ -152,7 +152,7 @@ export class BinaryWriter {
|
|
|
152
152
|
writeDate(value) {
|
|
153
153
|
let timestamp = 0;
|
|
154
154
|
if (value instanceof Date) {
|
|
155
|
-
timestamp =
|
|
155
|
+
timestamp = value.getTime();
|
|
156
156
|
}
|
|
157
157
|
else if (typeof value === 'number') {
|
|
158
158
|
timestamp = value;
|
|
@@ -265,7 +265,12 @@ export class BinaryWriter {
|
|
|
265
265
|
const start = this.offset;
|
|
266
266
|
this.allocate(1);
|
|
267
267
|
this.offset++;
|
|
268
|
+
let edgeExt;
|
|
268
269
|
for (const ext of this.extensions.values()) {
|
|
270
|
+
if (ext.token === -1) {
|
|
271
|
+
edgeExt = ext;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
269
274
|
ext.encode.call(this, value);
|
|
270
275
|
const processed = start < this.offset;
|
|
271
276
|
if (processed) {
|
|
@@ -277,6 +282,10 @@ export class BinaryWriter {
|
|
|
277
282
|
}
|
|
278
283
|
}
|
|
279
284
|
this.offset = start;
|
|
285
|
+
if (edgeExt) {
|
|
286
|
+
edgeExt.encode.call(this, value);
|
|
287
|
+
return start < this.offset;
|
|
288
|
+
}
|
|
280
289
|
return false;
|
|
281
290
|
}
|
|
282
291
|
writeObject(value) {
|