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

Function readOptionalOffset

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

Source from the content-addressed store, hash-verified

277};
278
279const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
280 if (value === undefined) {
281 return 0;
282 }
283
284 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
285 return new ExecutionToolError({
286 message: `${toolName} offset must be a non-negative number when provided`,
287 });
288 }
289
290 return Math.floor(value);
291};
292
293const makeFullInvoker = (
294 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected