MCPcopy
hub / github.com/webpack/webpack / identifyNumber

Function identifyNumber

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

Source from the content-addressed store, hash-verified

121 * @returns {0 | 1 | 2} type of number for serialization
122 */
123const identifyNumber = (n) => {
124 if (n === (n | 0)) {
125 if (n <= 127 && n >= -128) return 0;
126 if (n <= 2147483647 && n >= -2147483648) return 1;
127 }
128 return 2;
129};
130
131/**
132 * Returns type of bigint for serialization.

Callers 1

_serializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected