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

Function parseRotateGestureParams

src/core/dispatch-interactions.ts:957–970  ·  view source on GitHub ↗
(positionals: string[])

Source from the content-addressed store, hash-verified

955};
956
957function parseRotateGestureParams(positionals: string[]): RotateGestureParams {
958 const degrees = Number(positionals[0]);
959 if (!Number.isFinite(degrees)) {
960 throw new AppError('INVALID_ARGS', 'gesture rotate requires degrees [x] [y] [velocity]');
961 }
962
963 const center = parseOptionalGestureCenter(positionals[1], positionals[2]);
964 const velocity = Number(positionals[3] ?? (degrees >= 0 ? 1 : -1));
965 if (!Number.isFinite(velocity) || velocity === 0) {
966 throw new AppError('INVALID_ARGS', 'gesture rotate velocity must be a non-zero number');
967 }
968
969 return { degrees, ...center, velocity: Math.abs(velocity) * (degrees >= 0 ? 1 : -1) };
970}
971
972function parseTransformGestureParams(positionals: string[]): TransformGestureParams {
973 const x = Number(positionals[0]);

Callers 1

Calls 2

isFiniteMethod · 0.80

Tested by

no test coverage detected