Skip to main content

Crate edtf_wasm

Crate edtf_wasm 

Source
Expand description

WebAssembly bindings for edtf_core — the same validator the database runs, compiled for JavaScript. The app imports this in place of edtf.js.

Exported API (JS names):

  • isValid(input)boolean
  • level(input)0 | 1 | 2 | -1 (-1 = invalid)
  • canonical(input)string | undefined (spec-preferred form)
  • parse(input) → JSON string of a Summary or undefined
  • relation(a, b) → JSON string of a RelationSummary or undefined

Structs§

RelationSummary
The JSON shape relation returns: the modality of each of the six coarsened Allen relations between the two inputs, each "impossible" | "possible" | "definite". Semantics: docs/spec-notes.md D23 (possible-completions over bounds regions; Unknown bounds are possible-everything, never definite).
Summary
The JSON shape parse returns; one object per valid expression.

Functions§

canonical
The canonical (spec-preferred) form of input, or undefined if invalid.
is_valid
True if input is valid EDTF (levels 0–2).
level
Minimum conformance level of input: 0, 1 or 2; -1 if invalid.
parse
Full parse summary as a JSON string, or undefined if invalid. See Summary for the object shape.
relate
Build the RelationSummary for two inputs, if both are valid EDTF.
relation
Three-valued temporal relation between a and b as a JSON string, or undefined if either input is invalid. See RelationSummary for the object shape.
summarize
Build the Summary for an input, if it is valid EDTF.