()
| 28 | const MIN_SAFE_BIGINT = BigInt(Number.MIN_SAFE_INTEGER); |
| 29 | |
| 30 | function getInternalStringDetector() { |
| 31 | try { |
| 32 | const { isStringOneByteRepresentation } = require("node:v8"); |
| 33 | if (typeof isStringOneByteRepresentation === "function") { |
| 34 | return isStringOneByteRepresentation; |
| 35 | } |
| 36 | } catch { /* not available */ } |
| 37 | return null; |
| 38 | } |
| 39 | |
| 40 | export class BinaryWriter { |
| 41 | private cursor = 0; |