refactor: impl AdbSocket using internal marks

This commit is contained in:
Simon Chan 2022-03-15 15:17:35 +08:00
parent e36de01d39
commit bc9bc49e8c
No known key found for this signature in database
GPG key ID: 8F75717685A974FB
9 changed files with 25 additions and 19 deletions

View file

@ -4,7 +4,7 @@ import type { StructAsyncDeserializeStream, StructDeserializeStream, StructField
import { StructDefaultOptions, StructValue } from './basic';
import { Syncbird } from "./syncbird";
import { BigIntFieldDefinition, BigIntFieldType, BufferFieldSubType, FixedLengthBufferLikeFieldDefinition, FixedLengthBufferLikeFieldOptions, LengthField, NumberFieldDefinition, NumberFieldType, StringBufferFieldSubType, Uint8ArrayBufferFieldSubType, VariableLengthBufferLikeFieldDefinition, VariableLengthBufferLikeFieldOptions } from './types';
import { Evaluate, Identity, Overwrite, ValueOrPromise } from "./utils";
import type { Evaluate, Identity, Overwrite, ValueOrPromise } from "./utils";
export interface StructLike<TValue> {
deserialize(stream: StructDeserializeStream | StructAsyncDeserializeStream): Promise<TValue>;
@ -212,7 +212,7 @@ export class Struct<
> {
for (const field of this._fields) {
if (field[0] === name) {
throw new Error(`This struct already have a field with name '${name}'`);
throw new Error(`This struct already have a field with name '${String(name)}'`);
}
}