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

Function checkPure

src/compute-engine/boxed-expression/validate.ts:300–309  ·  view source on GitHub ↗
(
  ce: ComputeEngine,
  arg: Expression | Expression | undefined | null
)

Source from the content-addressed store, hash-verified

298 *
299 * - `error`, `unknown`, `any` and a number type are admitted;
300 * - with `admittedKinds`, a kind value (with numbers only beside it);
301 * - a collection whose cells are provably not numbers is refused
302 * (`list<string>`);
303 * - a type with an absence arm is refused only when the rest of it is
304 * provably not a number, a numeric collection or a numeric tuple
305 * (`string | missing`);
306 * - a type that could be a numeric collection or a numeric tuple is
307 * admitted, and so is a type that overlaps `number`
308 * (`integer | string`, `value`);
309 * - every other type is refused (`string`, `boolean`, a function type).
310 *
311 * The refusals of `checkNumericArgs` that read the operand expression (the
312 * elements of a list literal of unknown element type) are not decided here,

Callers

nothing calls this directly

Calls 2

errorMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected