MCPcopy Create free account
hub / github.com/bytespider/Meross / numberInRange

Function numberInRange

packages/cli/src/meross-setup.ts:37–44  ·  view source on GitHub ↗
(min: number, max: number)

Source from the content-addressed store, hash-verified

35};
36
37const numberInRange = (min: number, max: number) => (value: string) => {
38 if (Number(value) < min || Number(value) > max) {
39 throw new InvalidOptionArgumentError(
40 `Value is out of range (${min}-${max})`
41 );
42 }
43 return parseInt(value);
44};
45
46const parseIntWithValidation = (value: string) => {
47 const i = parseInt(value);

Callers 1

meross-setup.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected