diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/GenerateTsUtils.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/GenerateTsUtils.java index 52e16f36..d38b2d65 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/GenerateTsUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/GenerateTsUtils.java @@ -87,7 +87,7 @@ public abstract class GenerateTsUtils { } public static void createProtocolManager(List protocolList) throws IOException { - var list = List.of("typescript/buffer/ByteBuffer.ts", "typescript/buffer/Long.ts", "typescript/buffer/Longbits.ts"); + var list = List.of("typescript/IByteBuffer.ts", "typescript/buffer/ByteBuffer.ts", "typescript/buffer/Long.ts", "typescript/buffer/Longbits.ts"); for (var fileName : list) { var fileInputStream = ClassUtils.getFileFromClassPath(fileName); var createFile = new File(StringUtils.format("{}/{}", protocolOutputPath, StringUtils.substringAfterFirst(fileName, "typescript/"))); @@ -105,7 +105,6 @@ public abstract class GenerateTsUtils { var path = GenerateProtocolPath.protocolAbsolutePath(protocolId, CodeLanguage.TypeScript); importBuilder.append(StringUtils.format("import {} from './{}';", protocolName, path)).append(LS); initProtocolBuilder.append(StringUtils.format("protocols.set({}, {});", protocolId, protocolName)).append(LS); - } protocolManagerTemplate = StringUtils.format(protocolManagerTemplate, importBuilder.toString().trim(), initProtocolBuilder.toString().trim()); @@ -138,11 +137,19 @@ public abstract class GenerateTsUtils { private static String importSubProtocol(ProtocolRegistration registration) { var protocolId = registration.getId(); var subProtocols = ProtocolAnalysis.getFirstSubProtocolIds(protocolId); - - if (CollectionUtils.isEmpty(subProtocols)) { - return StringUtils.EMPTY; - } + // import IByteBuffer first var importBuilder = new StringBuilder(); + var protocolPath = GenerateProtocolPath.getProtocolPath(protocolId); + if (StringUtils.isEmpty(protocolPath) ) { + importBuilder.append(StringUtils.format("import IByteBuffer from './IByteBuffer';")).append(LS); + } else { + var splits = protocolPath.split(StringUtils.PERIOD_REGEX); + importBuilder.append(StringUtils.format("import IByteBuffer from '{}IByteBuffer';", "../".repeat(splits.length))).append(LS); + } + if (CollectionUtils.isEmpty(subProtocols)) { + return importBuilder.toString(); + } + // import other sub protocols for (var subProtocolId : subProtocols) { var protocolClassName = EnhanceObjectProtocolSerializer.getProtocolClassSimpleName(subProtocolId); var path = GenerateProtocolPath.getRelativePath(protocolId, subProtocolId); diff --git a/protocol/src/main/resources/typescript/IByteBuffer.ts b/protocol/src/main/resources/typescript/IByteBuffer.ts new file mode 100644 index 00000000..9f05c328 --- /dev/null +++ b/protocol/src/main/resources/typescript/IByteBuffer.ts @@ -0,0 +1,117 @@ +interface IByteBuffer { + adjustPadding(predictionLength: number, beforeWriteIndex: number): void + compatibleRead(beforeReadIndex: number, length: number): boolean + setWriteOffset(writeOffset: number): void + getWriteOffset(): number + setReadOffset(readOffset: number): void + getReadOffset(): number + getCapacity(): number + ensureCapacity(minCapacity: number): void + isReadable(): boolean + writeBytes(byteArray: ArrayBuffer): void + toBytes(): ArrayBuffer + writeBoolean(value: boolean): void + readBoolean(): boolean + writeByte(value: number): void + readByte(): number + writeShort(value: number): void + readShort(): number + writeRawInt(value: number): void + readRawInt(): number + writeInt(value: number): void + writeIntCount(value: number): number + readInt(): number + writeLong(value: number): void + readLong(): number + writeFloat(value: number): void + readFloat(): number + writeDouble(value: number): void + readDouble(): number + writeString(value: string): void + readString(): string + writePacket(packet: any, protocolId: number): void + readPacket(protocolId: number): any + writeBooleanArray(array: Array | null): void + readBooleanArray(): boolean[] + writeByteArray(array: Array | null): void + readByteArray(): number[] + writeShortArray(array: Array | null): void + readShortArray(): number[] + writeIntArray(array: Array | null): void + readIntArray(): number[] + writeLongArray(array: Array | null): void + readLongArray(): number[] + writeFloatArray(array: Array | null): void + readFloatArray(): number[] + writeDoubleArray(array: Array | null): void + readDoubleArray(): number[] + writeStringArray(array: Array | null): void + readStringArray(): string[] + writePacketArray(array: Array | null, protocolId: number): void + readPacketArray(protocolId: number): any + // ---------------------------------------------list------------------------------------------- + writeBooleanList(list: Array | null): void + readBooleanList(): boolean[] + writeByteList(list: Array | null): void + readByteList(): number[] + writeShortList(list: Array | null): void + readShortList(): number[] + writeIntList(list: Array | null): void + readIntList(): number[] + writeLongList(list: Array | null): void + readLongList(): number[] + writeFloatList(list: Array | null): void + readFloatList(): number[] + writeDoubleList(list: Array | null): void + readDoubleList(): number[] + writeStringList(list: Array | null): void + readStringList(): string[] + writePacketList(list: Array | null, protocolId: number): void + readPacketList(protocolId: number): any[] + // ---------------------------------------------set------------------------------------------- + writeBooleanSet(set: Set | null): void + readBooleanSet(): Set + writeByteSet(set: Set | null): void + readByteSet(): Set + writeShortSet(set: Set | null): void + readShortSet(): Set + writeIntSet(set: Set | null): void + readIntSet(): Set + writeLongSet(set: Set | null): void + readLongSet(): Set + writeFloatSet(set: Set | null): void + readFloatSet(): Set + writeDoubleSet(set: Set | null): void + readDoubleSet(): Set + writeStringSet(set: Set | null): void + readStringSet(): Set + writePacketSet(set: Set | null, protocolId: number): void + readPacketSet(protocolId: number): Set + // ---------------------------------------------map------------------------------------------- + writeIntIntMap(map: Map | null): void + readIntIntMap(): Map + writeIntLongMap(map: Map | null): void + readIntLongMap(): Map + writeIntStringMap(map: Map | null): void + readIntStringMap(): Map + writeIntPacketMap(map: Map | null, protocolId: number): void + readIntPacketMap(protocolId: number): Map + writeLongIntMap(map: Map | null): void + readLongIntMap(): Map + writeLongLongMap(map: Map | null): void + readLongLongMap(): Map + writeLongStringMap(map: Map | null): void + readLongStringMap(): Map + writeLongPacketMap(map: Map | null, protocolId: number): any + readLongPacketMap(protocolId: number): Map + writeStringIntMap(map: Map | null): void + readStringIntMap(): Map + writeStringLongMap(map: Map | null): void + readStringLongMap(): Map + writeStringStringMap(map: Map | null): void + readStringStringMap(): Map + writeStringPacketMap(map: Map | null, protocolId: number): void + readStringPacketMap(protocolId: number): Map +} + +export default IByteBuffer; \ No newline at end of file diff --git a/protocol/src/main/resources/typescript/ProtocolTemplate.ts b/protocol/src/main/resources/typescript/ProtocolTemplate.ts index 7af23403..d227593e 100644 --- a/protocol/src/main/resources/typescript/ProtocolTemplate.ts +++ b/protocol/src/main/resources/typescript/ProtocolTemplate.ts @@ -10,7 +10,7 @@ class {} { return {}.PROTOCOL_ID; } - static write(buffer: any, packet: {} | null) { + static write(buffer: IByteBuffer, packet: {} | null) { if (packet === null) { buffer.writeInt(0); return; @@ -18,7 +18,7 @@ class {} { {} } - static read(buffer: any): {} | null { + static read(buffer: IByteBuffer): {} | null { const length = buffer.readInt(); if (length === 0) { return null; diff --git a/protocol/src/main/resources/typescript/buffer/ByteBuffer.ts b/protocol/src/main/resources/typescript/buffer/ByteBuffer.ts index 6fddbc1a..dfa71c26 100644 --- a/protocol/src/main/resources/typescript/buffer/ByteBuffer.ts +++ b/protocol/src/main/resources/typescript/buffer/ByteBuffer.ts @@ -1,3 +1,4 @@ +import IByteBuffer from "../IByteBuffer"; import ProtocolManager from "../ProtocolManager"; import {writeInt64, readInt64} from "./Longbits"; @@ -44,7 +45,7 @@ function decodeZigzagInt(n: number) { } -class ByteBuffer { +class ByteBuffer implements IByteBuffer{ writeOffset: number; readOffset: number; buffer: ArrayBuffer; @@ -388,21 +389,15 @@ class ByteBuffer { return value; } - writePacketFlag(value: any): boolean { - const flag = (value === null) || (value === undefined); - this.writeBoolean(!flag); - return flag; - }; - - writePacket(packet: any, protocolId: number) { + writePacket(packet: any, protocolId: number): void { const protocolRegistration = ProtocolManager.getProtocol(protocolId); protocolRegistration.write(this, packet); - }; + } readPacket(protocolId: number): any { const protocolRegistration = ProtocolManager.getProtocol(protocolId); return protocolRegistration.read(this); - }; + } writeBooleanArray(array: Array | null) { if (array === null) { @@ -413,9 +408,9 @@ class ByteBuffer { this.writeBoolean(element); }); } - }; + } - readBooleanArray(): any { + readBooleanArray(): Array { const array: boolean[] = []; const length = this.readInt(); if (length > 0) { @@ -424,9 +419,9 @@ class ByteBuffer { } } return array; - }; + } - writeByteArray(array: Array | null) { + writeByteArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -435,9 +430,9 @@ class ByteBuffer { this.writeByte(element); }); } - }; + } - readByteArray(): any { + readByteArray(): Array { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -446,9 +441,9 @@ class ByteBuffer { } } return array; - }; + } - writeShortArray(array: Array | null) { + writeShortArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -457,9 +452,9 @@ class ByteBuffer { this.writeShort(element); }); } - }; + } - readShortArray(): any { + readShortArray(): number[] { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -468,9 +463,9 @@ class ByteBuffer { } } return array; - }; + } - writeIntArray(array: Array | null) { + writeIntArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -479,9 +474,9 @@ class ByteBuffer { this.writeInt(element); }); } - }; + } - readIntArray(): any { + readIntArray(): number[] { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -490,9 +485,9 @@ class ByteBuffer { } } return array; - }; + } - writeLongArray(array: Array | null) { + writeLongArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -501,9 +496,9 @@ class ByteBuffer { this.writeLong(element); }); } - }; + } - readLongArray(): any { + readLongArray(): number[] { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -512,9 +507,9 @@ class ByteBuffer { } } return array; - }; + } - writeFloatArray(array: Array | null) { + writeFloatArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -523,9 +518,9 @@ class ByteBuffer { this.writeFloat(element); }); } - }; + } - readFloatArray(): any { + readFloatArray(): number[] { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -534,9 +529,9 @@ class ByteBuffer { } } return array; - }; + } - writeDoubleArray(array: Array | null) { + writeDoubleArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -545,9 +540,9 @@ class ByteBuffer { this.writeDouble(element); }); } - }; + } - readDoubleArray(): any { + readDoubleArray(): number[] { const array: number[] = []; const length = this.readInt(); if (length > 0) { @@ -556,9 +551,9 @@ class ByteBuffer { } } return array; - }; + } - writeStringArray(array: Array | null) { + writeStringArray(array: Array | null): void { if (array === null) { this.writeInt(0); } else { @@ -567,9 +562,9 @@ class ByteBuffer { this.writeString(element); }); } - }; + } - readStringArray(): any { + readStringArray(): string[] { const array: string[] = []; const length = this.readInt(); if (length > 0) { @@ -578,9 +573,9 @@ class ByteBuffer { } } return array; - }; + } - writePacketArray(array: Array | null, protocolId: number) { + writePacketArray(array: Array | null, protocolId: number): void { if (array === null) { this.writeInt(0); } else { @@ -590,9 +585,9 @@ class ByteBuffer { protocolRegistration.write(this, element); }); } - }; + } - readPacketArray(protocolId: number): any { + readPacketArray(protocolId: number): any[] { const array: any[] = []; const length = this.readInt(); if (length > 0) { @@ -602,83 +597,83 @@ class ByteBuffer { } } return array; - }; + } // ---------------------------------------------list------------------------------------------- - writeBooleanList(list: any) { + writeBooleanList(list: Array | null): void { this.writeBooleanArray(list); - }; + } - readBooleanList(): any { + readBooleanList(): boolean[] { return this.readBooleanArray(); - }; + } - writeByteList(list: any) { + writeByteList(list: Array | null): void { this.writeByteArray(list); - }; + } - readByteList(): any { + readByteList(): number[] { return this.readByteArray(); - }; + } - writeShortList(list: any) { + writeShortList(list: Array | null): void { this.writeShortArray(list); - }; + } - readShortList(): any { + readShortList(): number[] { return this.readShortArray(); - }; + } - writeIntList(list: any) { + writeIntList(list: Array | null): void { this.writeIntArray(list); - }; + } - readIntList(): any { + readIntList(): number[] { return this.readIntArray(); - }; + } - writeLongList(list: any) { + writeLongList(list: Array | null): void { this.writeLongArray(list); - }; + } - readLongList(): any { + readLongList(): number[] { return this.readLongArray(); - }; + } - writeFloatList(list: any) { + writeFloatList(list: Array | null): void { this.writeFloatArray(list); - }; + } - readFloatList(): any { + readFloatList(): number[] { return this.readFloatArray(); - }; + } - writeDoubleList(list: any) { + writeDoubleList(list: Array | null): void { this.writeDoubleArray(list); - }; + } - readDoubleList(): any { + readDoubleList(): number[] { return this.readDoubleArray(); - }; + } - writeStringList(list: any) { + writeStringList(list: Array | null): void { this.writeStringArray(list); - }; + } - readStringList(): any { + readStringList(): string[] { return this.readStringArray(); - }; + } - writePacketList(list: any, protocolId: number) { + writePacketList(list: Array | null, protocolId: number): void { this.writePacketArray(list, protocolId); - }; + } - readPacketList(protocolId: number): any { + readPacketList(protocolId: number): any[] { return this.readPacketArray(protocolId); - }; + } // ---------------------------------------------set------------------------------------------- - writeBooleanSet(set: Set | null) { + writeBooleanSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -687,13 +682,13 @@ class ByteBuffer { this.writeBoolean(element); }); } - }; + } - readBooleanSet(): any { + readBooleanSet(): Set { return new Set(this.readBooleanArray()); - }; + } - writeByteSet(set: Set | null) { + writeByteSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -702,13 +697,13 @@ class ByteBuffer { this.writeByte(element); }); } - }; + } - readByteSet(): any { + readByteSet(): Set { return new Set(this.readByteArray()); - }; + } - writeShortSet(set: Set | null) { + writeShortSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -717,13 +712,13 @@ class ByteBuffer { this.writeShort(element); }); } - }; + } - readShortSet(): any { + readShortSet(): Set { return new Set(this.readShortArray()); - }; + } - writeIntSet(set: Set | null) { + writeIntSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -732,13 +727,13 @@ class ByteBuffer { this.writeInt(element); }); } - }; + } - readIntSet(): any { + readIntSet(): Set { return new Set(this.readIntArray()); - }; + } - writeLongSet(set: Set | null) { + writeLongSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -747,13 +742,13 @@ class ByteBuffer { this.writeLong(element); }); } - }; + } - readLongSet(): any { + readLongSet(): Set { return new Set(this.readLongArray()); - }; + } - writeFloatSet(set: Set | null) { + writeFloatSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -762,13 +757,13 @@ class ByteBuffer { this.writeFloat(element); }); } - }; + } - readFloatSet(): any { + readFloatSet(): Set { return new Set(this.readFloatArray()); - }; + } - writeDoubleSet(set: Set | null) { + writeDoubleSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -777,13 +772,13 @@ class ByteBuffer { this.writeDouble(element); }); } - }; + } - readDoubleSet(): any { + readDoubleSet(): Set { return new Set(this.readDoubleArray()); - }; + } - writeStringSet(set: Set | null) { + writeStringSet(set: Set | null): void { if (set === null) { this.writeInt(0); } else { @@ -792,13 +787,13 @@ class ByteBuffer { this.writeString(element); }); } - }; + } - readStringSet(): any { + readStringSet(): Set { return new Set(this.readStringArray()); - }; + } - writePacketSet(set: Set | null, protocolId: number) { + writePacketSet(set: Set | null, protocolId: number): void { if (set === null) { this.writeInt(0); } else { @@ -808,14 +803,14 @@ class ByteBuffer { protocolRegistration.write(this, element); }); } - }; + } - readPacketSet(protocolId: number): any { + readPacketSet(protocolId: number): Set { return new Set(this.readPacketArray(protocolId)); - }; + } // ---------------------------------------------map------------------------------------------- - writeIntIntMap(map: Map | null) { + writeIntIntMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -825,10 +820,10 @@ class ByteBuffer { this.writeInt(value); }); } - }; + } - readIntIntMap(): any { - const map = new Map(); + readIntIntMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -838,9 +833,9 @@ class ByteBuffer { } } return map; - }; + } - writeIntLongMap(map: Map | null) { + writeIntLongMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -850,10 +845,10 @@ class ByteBuffer { this.writeLong(value); }); } - }; + } - readIntLongMap(): any { - const map = new Map(); + readIntLongMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -863,9 +858,9 @@ class ByteBuffer { } } return map; - }; + } - writeIntStringMap(map: Map | null) { + writeIntStringMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -875,10 +870,10 @@ class ByteBuffer { this.writeString(value); }); } - }; + } - readIntStringMap(): any { - const map = new Map(); + readIntStringMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -888,9 +883,9 @@ class ByteBuffer { } } return map; - }; + } - writeIntPacketMap(map: Map | null, protocolId: number) { + writeIntPacketMap(map: Map | null, protocolId: number): void { if (map === null) { this.writeInt(0); } else { @@ -901,10 +896,10 @@ class ByteBuffer { protocolRegistration.write(this, value); }); } - }; + } - readIntPacketMap(protocolId: number): any { - const map = new Map(); + readIntPacketMap(protocolId: number): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { const protocolRegistration = ProtocolManager.getProtocol(protocolId); @@ -915,9 +910,9 @@ class ByteBuffer { } } return map; - }; + } - writeLongIntMap(map: Map | null) { + writeLongIntMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -927,10 +922,10 @@ class ByteBuffer { this.writeInt(value); }); } - }; + } - readLongIntMap(): any { - const map = new Map(); + readLongIntMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -940,9 +935,9 @@ class ByteBuffer { } } return map; - }; + } - writeLongLongMap(map: Map | null) { + writeLongLongMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -952,10 +947,10 @@ class ByteBuffer { this.writeLong(value); }); } - }; + } - readLongLongMap(): any { - const map = new Map(); + readLongLongMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -965,9 +960,9 @@ class ByteBuffer { } } return map; - }; + } - writeLongStringMap(map: Map | null) { + writeLongStringMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -977,10 +972,10 @@ class ByteBuffer { this.writeString(value); }); } - }; + } - readLongStringMap(): any { - const map = new Map(); + readLongStringMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -990,7 +985,7 @@ class ByteBuffer { } } return map; - }; + } writeLongPacketMap(map: Map | null, protocolId: number): any { if (map === null) { @@ -1003,10 +998,10 @@ class ByteBuffer { protocolRegistration.write(this, value); }); } - }; + } - readLongPacketMap(protocolId: number): any { - const map = new Map(); + readLongPacketMap(protocolId: number): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { const protocolRegistration = ProtocolManager.getProtocol(protocolId); @@ -1017,9 +1012,9 @@ class ByteBuffer { } } return map; - }; + } - writeStringIntMap(map: Map | null) { + writeStringIntMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -1029,10 +1024,10 @@ class ByteBuffer { this.writeInt(value); }); } - }; + } - readStringIntMap(): any { - const map = new Map(); + readStringIntMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -1042,9 +1037,9 @@ class ByteBuffer { } } return map; - }; + } - writeStringLongMap(map: Map | null) { + writeStringLongMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -1054,10 +1049,10 @@ class ByteBuffer { this.writeLong(value); }); } - }; + } - readStringLongMap(): any { - const map = new Map(); + readStringLongMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -1067,9 +1062,9 @@ class ByteBuffer { } } return map; - }; + } - writeStringStringMap(map: Map | null) { + writeStringStringMap(map: Map | null): void { if (map === null) { this.writeInt(0); } else { @@ -1079,10 +1074,10 @@ class ByteBuffer { this.writeString(value); }); } - }; + } - readStringStringMap(): any { - const map = new Map(); + readStringStringMap(): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { for (let index = 0; index < size; index++) { @@ -1092,9 +1087,9 @@ class ByteBuffer { } } return map; - }; + } - writeStringPacketMap(map: Map | null, protocolId: number) { + writeStringPacketMap(map: Map | null, protocolId: number): void { if (map === null) { this.writeInt(0); } else { @@ -1105,10 +1100,10 @@ class ByteBuffer { protocolRegistration.write(this, value); }); } - }; + } - readStringPacketMap(protocolId: number): any { - const map = new Map(); + readStringPacketMap(protocolId: number): Map { + const map = new Map(); const size = this.readInt(); if (size > 0) { const protocolRegistration = ProtocolManager.getProtocol(protocolId); @@ -1119,7 +1114,7 @@ class ByteBuffer { } } return map; - }; + } } export default ByteBuffer;