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

Function readOptionalOffset

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

Source from the content-addressed store, hash-verified

326};
327
328const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
329 if (value === undefined) {
330 return 0;
331 }
332
333 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
334 return new ExecutionToolError({
335 message: `${toolName} offset must be a non-negative number when provided`,
336 });
337 }
338
339 return Math.floor(value);
340};
341
342const makeFullInvoker = (
343 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected