MCPcopy Create free account
hub / github.com/Lemoncode/fonk / parseLengthParams

Function parseLengthParams

src/validators/length.ts:5–16  ·  view source on GitHub ↗
(
  customParams: LengthArgs,
  errorMessage: string
)

Source from the content-addressed store, hash-verified

3}
4
5export function parseLengthParams(
6 customParams: LengthArgs,
7 errorMessage: string
8) {
9 const length =
10 customParams.length === null ? NaN : Number(customParams.length);
11 if (isNaN(length)) {
12 throw new Error(errorMessage);
13 }
14
15 return length;
16}
17
18export function isLengthValid(
19 value: any,

Callers 2

validatorFunction · 0.90
validatorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…