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

Function readOptionalOffset

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

Source from the content-addressed store, hash-verified

201};
202
203const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
204 if (value === undefined) {
205 return 0;
206 }
207
208 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
209 return new ExecutionToolError({
210 message: `${toolName} offset must be a non-negative number when provided`,
211 });
212 }
213
214 return Math.floor(value);
215};
216
217const makeFullInvoker = (
218 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected