MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readOptionalOffset

Function readOptionalOffset

packages/core/execution/src/engine.ts:229–241  ·  view source on GitHub ↗
(value: unknown, toolName: string)

Source from the content-addressed store, hash-verified

227};
228
229const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
230 if (value === undefined) {
231 return 0;
232 }
233
234 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
235 return new ExecutionToolError({
236 message: `${toolName} offset must be a non-negative number when provided`,
237 });
238 }
239
240 return Math.floor(value);
241};
242
243const makeFullInvoker = (
244 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected