MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / argIndexOf

Function argIndexOf

scripts/fungrim/compile-properties.ts:56–60  ·  view source on GitHub ↗
(expr: Json, v: string | null)

Source from the content-addressed store, hash-verified

54// (expr is `[head, arg0, arg1, ...]`). Null when there is no single argument
55// position (parametric or non-trivial expressions).
56function argIndexOf(expr: Json, v: string | null): number | null {
57 if (v === null || !Array.isArray(expr)) return null;
58 const i = (expr as Json[]).slice(1).findIndex((a) => a === v);
59 return i < 0 ? null : i;
60}
61
62function compile(source: { generator?: string; entries: SourceEntry[] }) {
63 const operators: Record<string, CompiledRecord[]> = {};

Callers 1

compileFunction · 0.85

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected