MCPcopy Create free account
hub / github.com/apache/maka / integerValue

Function integerValue

packages/core/src/runtime-policy/domain-codec.ts:41–46  ·  view source on GitHub ↗
(value: unknown, context: string, min: number, max: number)

Source from the content-addressed store, hash-verified

39}
40
41export function integerValue(value: unknown, context: string, min: number, max: number): number {
42 if (!Number.isSafeInteger(value) || (value as number) < min || (value as number) > max) {
43 throw domainError(`${context} must be an integer between ${min} and ${max}`);
44 }
45 return value as number;
46}
47
48export function revisionValue(value: unknown, context: string): Revision {
49 return integerValue(value, context, 0, Number.MAX_SAFE_INTEGER);

Callers 8

decodeCredentialStatusFunction · 0.85
revisionValueFunction · 0.85
positiveRevisionValueFunction · 0.85
decodeConnectionModelFunction · 0.85
normalizeNetworkProxyFunction · 0.85

Calls 1

domainErrorFunction · 0.85

Tested by

no test coverage detected