MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / normalizeRuntimeOffset

Function normalizeRuntimeOffset

src/api/TaskNotesAPI.ts:3097–3112  ·  view source on GitHub ↗
(
	value: unknown,
	path: string,
	issues: TaskNotesRuntimeQueryIssue[]
)

Source from the content-addressed store, hash-verified

3095}
3096
3097function normalizeRuntimeOffset(
3098 value: unknown,
3099 path: string,
3100 issues: TaskNotesRuntimeQueryIssue[]
3101): number {
3102 if (typeof value === "undefined" || value === null) return 0;
3103 if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
3104 issues.push({
3105 path,
3106 code: "offset_invalid",
3107 message: "Runtime query offset must be a non-negative integer.",
3108 });
3109 return 0;
3110 }
3111 return value;
3112}
3113
3114function normalizeRuntimeScope(
3115 value: unknown,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected