MCPcopy Create free account
hub / github.com/denoland/celld / __checkNum

Function __checkNum

crates/celld/js/node_buffer.js:46–52  ·  view source on GitHub ↗
(name, value, min, max)

Source from the content-addressed store, hash-verified

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) => {

Callers 2

compareMethod · 0.85
fillMethod · 0.85

Calls 2

__bufTypeFunction · 0.85
__bufRangeFunction · 0.85

Tested by

no test coverage detected