MCPcopy Index your code
hub / github.com/callstack/agent-device / requireIntInRange

Function requireIntInRange

src/utils/validation.ts:3–8  ·  view source on GitHub ↗
(value: number, name: string, min: number, max: number)

Source from the content-addressed store, hash-verified

1import { AppError } from '../kernel/errors.ts';
2
3export function requireIntInRange(value: number, name: string, min: number, max: number): number {
4 if (!Number.isFinite(value) || !Number.isInteger(value) || value < min || value > max) {
5 throw new AppError('INVALID_ARGS', `${name} must be an integer between ${min} and ${max}`);
6 }
7 return value;
8}

Callers 15

normalizePageOptionsFunction · 0.90
alertCommandFunction · 0.90
normalizeRecordingFpsFunction · 0.90
typeTextCommandFunction · 0.90
longPressCommandFunction · 0.90
swipeCommandFunction · 0.90
runSwipePresetFunction · 0.90
handleTypeCommandFunction · 0.90
handleFillCommandFunction · 0.90

Calls 1

isFiniteMethod · 0.80

Tested by

no test coverage detected