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)→booleanlevel(input)→0 | 1 | 2 | -1(-1 = invalid)canonical(input)→string | undefined(spec-preferred form)parse(input)→ JSON string of aSummaryorundefinedrelation(a, b)→ JSON string of aRelationSummaryorundefined
Structs§
- Relation
Summary - The JSON shape
relationreturns: the modality of each of the six coarsened Allen relations between the two inputs, each"impossible" | "possible" | "definite". Semantics:docs/spec-notes.mdD23 (possible-completions over bounds regions; Unknown bounds are possible-everything, never definite). - Summary
- The JSON shape
parsereturns; one object per valid expression.
Functions§
- canonical
- The canonical (spec-preferred) form of
input, orundefinedif invalid. - is_
valid - True if
inputis 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
undefinedif invalid. SeeSummaryfor the object shape. - relate
- Build the
RelationSummaryfor two inputs, if both are valid EDTF. - relation
- Three-valued temporal relation between
aandbas a JSON string, orundefinedif either input is invalid. SeeRelationSummaryfor the object shape. - summarize
- Build the
Summaryfor an input, if it is valid EDTF.