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

Function collectWildcards

scripts/fungrim/compile-rules.ts:185–189  ·  view source on GitHub ↗
(x: MathJSON, out = new Set<string>())

Source from the content-addressed store, hash-verified

183}
184
185/** All wildcard symbols (`_…`) appearing in a MathJSON tree. */
186export function collectWildcards(x: MathJSON, out = new Set<string>()): Set<string> {
187 if (typeof x === 'string' && x.startsWith('_')) out.add(x);
188 else if (Array.isArray(x)) for (const y of x) collectWildcards(y, out);
189 return out;
190}
191
192/** All symbol-position strings appearing in a MathJSON tree. */

Callers 4

guardWildcardsFunction · 0.70
orientEntryFunction · 0.70
selfTestScopedFunction · 0.70
compileEntriesFunction · 0.70

Calls 1

addMethod · 0.65

Tested by

no test coverage detected