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

Function readOptionalOffset

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

Source from the content-addressed store, hash-verified

268};
269
270const readOptionalOffset = (value: unknown, toolName: string): number | ExecutionToolError => {
271 if (value === undefined) {
272 return 0;
273 }
274
275 if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
276 return new ExecutionToolError({
277 message: `${toolName} offset must be a non-negative number when provided`,
278 });
279 }
280
281 return Math.floor(value);
282};
283
284const makeFullInvoker = (
285 executor: Executor,

Callers 1

makeFullInvokerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected