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

Function readOptionalOffset

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

Source from the content-addressed store, hash-verified

246};
247
248const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
249 if (value === undefined) {
250 return 0;
251 }
252
253 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
254 return new ExecutionToolError({
255 message: `${toolName} offset must be a non-negative number when provided`,
256 });
257 }
258
259 return Math.floor(value);
260};
261
262const makeFullInvoker = (
263 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected