(n)
| 134 | * @returns {0 | 1 | 2} type of bigint for serialization |
| 135 | */ |
| 136 | const identifyBigInt = (n) => { |
| 137 | if (n <= BigInt(127) && n >= BigInt(-128)) return 0; |
| 138 | if (n <= BigInt(2147483647) && n >= BigInt(-2147483648)) return 1; |
| 139 | return 2; |
| 140 | }; |
| 141 | |
| 142 | /** @typedef {PrimitiveSerializableType[]} DeserializedType */ |
| 143 | /** @typedef {BufferSerializableType[]} SerializedType} */ |