(value, min, max, buf, offset, byteLength)
| 62 | } |
| 63 | |
| 64 | function checkInt(value, min, max, buf, offset, byteLength) { |
| 65 | if (value > max || value < min) { |
| 66 | const n = typeof min === 'bigint' ? 'n' : ''; |
| 67 | let range; |
| 68 | if (byteLength > 3) { |
| 69 | if (min === 0 || min === 0n) { |
| 70 | range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; |
| 71 | } else { |
| 72 | range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and ` + |
| 73 | `< 2${n} ** ${(byteLength + 1) * 8 - 1}${n}`; |
| 74 | } |
| 75 | } else { |
| 76 | range = `>= ${min}${n} and <= ${max}${n}`; |
| 77 | } |
| 78 | throw new ERR_OUT_OF_RANGE('value', range, value); |
| 79 | } |
| 80 | checkBounds(buf, offset, byteLength); |
| 81 | } |
| 82 | |
| 83 | function boundsError(value, length, type) { |
| 84 | if (MathFloor(value) !== value) { |
no test coverage detected
searching dependent graphs…