MCPcopy
hub / github.com/webpack/webpack / identifyBigInt

Function identifyBigInt

lib/serialization/BinaryMiddleware.js:136–140  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

134 * @returns {0 | 1 | 2} type of bigint for serialization
135 */
136const 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} */

Callers 1

_serializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected