Metakit / @doeixd/metakit/build

Facts

namespace · packages/metakit/src/facts.ts:1

export * as Facts from './facts.js'

Members

Facts.cannotRefuse

function · packages/metakit/src/ops/kind.ts:171

function cannotRefuse(node: Node.Node): boolean

Whether evaluation can never refuse node, nor give a value an operation refuses for itself (text holding a NUL, NaN), judged from the expression and its Schemas: a literal of none; a path whose Schema admits none (a finite number, a boolean, a literal set of none, Text); a core operation that refuses only for its operands' values, over operands of its kind that cannot be refused; an any or every over a list or a row's related rows whose test cannot be refused (foldCannotRefuse). The guard of every rewrite that drops an operand: a refusal decides before null and is not absorbed.

Facts.fractionBesideInteger

function · packages/metakit/src/ops/integerTerm.ts:112

function fractionBesideInteger(node: Node.Node): boolean

Whether a call in node has a fraction literal beside an integer term, as an operand or among its candidates: the expression SQL lowering refuses.

Facts.isAlwaysInteger

function · packages/metakit/src/ops/integerTerm.ts:75

function isAlwaysInteger(node: Node.Node): boolean

Whether node always evaluates to a safe integer, null, or a refusal, including constant integer expressions (9000 + 9000) and conditional branches mixing integer terms with integer literals. Used to discharge effect/schema/isInt during derived-operation expansion without relaxing isIntegerTerm for SQL.

Facts.isFiniteNumber

function · packages/metakit/src/ops/kind.ts:36

function isFiniteNumber(ast: SchemaAST.AST): boolean

A number Schema that admits neither NaN nor an infinity (Schema.Int, Schema.Finite).

Facts.isFraction

function · packages/metakit/src/ops/integerTerm.ts:95

function isFraction(value: unknown): boolean

Facts.isInteger

function · packages/metakit/src/ops/kind.ts:40

function isInteger(ast: SchemaAST.AST): boolean

A number Schema that admits only safe integers (Schema.Int).

Facts.isIntegerLiteral

function · packages/metakit/src/ops/integerTerm.ts:56

function isIntegerLiteral(node: Node.Node): boolean

Facts.isIntegerOperand

function · packages/metakit/src/ops/integerTerm.ts:66

function isIntegerOperand(node: Node.Node): boolean

An operand of integer arithmetic in SQL: an integer term, an integer literal, or a constant integer expression such as neg(4000), which is no term (it reads no row) but is as much an integer as the literal it negates. A null literal is none. isIntegerTerm stays as it was: the guard readers take a term as an integer without asking, and the checker's counts move with what they ask.

Facts.isIntegerTerm

function · packages/metakit/src/ops/integerTerm.ts:32

function isIntegerTerm(node: Node.Node): boolean

Whether node reads the row and yields a safe integer, null, or a refusal under its path Schemas.

Facts.isPortableRead

function · packages/metakit/src/ops/kind.ts:90

function isPortableRead(node: Node.Node): boolean

A literal or a path that holds neither text with a NUL character nor NaN: a term evaluation reads, which no text or equality operation refuses for it.

Facts.isPortableValue

function · packages/metakit/src/ops/kind.ts:110

function isPortableValue(value: unknown): boolean

A literal isPortableRead takes: not a refusal, no text holding a NUL, and not NaN.

Facts.isSafeNumber

function · packages/metakit/src/ops/kind.ts:96

function isSafeNumber(value: unknown): boolean

A number within ±(2^53−1), past which arithmetic refuses an operand.

Facts.isSafeRead

function · packages/metakit/src/ops/kind.ts:104

function isSafeRead(node: Node.Node): boolean

A literal or a path that, whenever it holds a number, holds one within ±(2^53−1): a path whose Schema admits only integers (Schema.Int takes only safe ones). The guard of a numeric law that returns an operand.

Facts.isText

function · packages/metakit/src/ops/kind.ts:68

function isText(ast: SchemaAST.AST): boolean

Text Text.schema from @doeixd/metakit/domain describes, refinements after it included: text holding no NUL, recognised by the annotation on the check that refuses one (an annotation on the Schema alone refuses nothing).

Facts.kindOf

function · packages/metakit/src/ops/kind.ts:439

function kindOf(node: Node.Node): Option.Option<Node.ValueKind>

The kind of node's value where it is neither null nor refused; none when unknown.

Facts.maxAbsOfAst

function · packages/metakit/src/ops/kind.ts:338

function maxAbsOfAst(ast: SchemaAST.AST): Option.Option<number>

Max absolute value of a bounded numeric Schema AST, if both sides are finite.

Facts.present

function · packages/metakit/src/ops/kind.ts:28

function present(ast: SchemaAST.AST): ReadonlyArray<SchemaAST.AST>

The members of ast other than null and undefined; an Option's are its value's, which a path reads.

Facts.TextChecks

interface · packages/metakit/src/ops/textChecks.ts:15

interface TextChecks {
  readonly minLength: number
  readonly maxLength: number
  readonly nulFree: boolean
  readonly modelled: boolean
}

What the checks on a string Schema ask of a value: a length in UTF-16 units at least minLength and at most maxLength, no NUL (Text.schema), and modelled false where a check asks anything else (a pattern, a trim), which a reader cannot show a value meets.

Facts.textChecksOf

function · packages/metakit/src/ops/textChecks.ts:22

function textChecksOf(ast: SchemaAST.AST): TextChecks