(name, value, min, max)
| 44 | ? `an instance of ${value.constructor?.name ?? "Object"}` |
| 45 | : `type ${typeof value}`)); |
| 46 | const __checkNum = (name, value, min, max) => { |
| 47 | if (typeof value !== "number") |
| 48 | throw __bufType(name, "of type number", value); |
| 49 | if (Number.isNaN(value) || value < min || value > max) |
| 50 | throw __bufRange(name, `>= ${min} and <= ${max}`, value); |
| 51 | return value; |
| 52 | }; |
| 53 | const __badEnc = (enc) => __bufErr(TypeError, |
| 54 | "ERR_UNKNOWN_ENCODING", `Unknown encoding: ${enc}`); |
| 55 | const __normEnc = (enc) => { |
no test coverage detected