Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 1.47 KB

File metadata and controls

60 lines (38 loc) · 1.47 KB

zerolocus62

This directory contains the JavaScript reference implementation for the ZeroLocus62 v3.1.1 release of the v3.1 format.

The repository-level overview is in ../README.md, and the canonical format specification is in ../specification.md.

Install

Install the local package from the repository root:

npm install ./javascript

Or develop against the directory directly:

npm --prefix javascript install

Test

Run the JavaScript regression suite:

npm --prefix javascript test

Usage

import { Factor, decodeLabel, encodeLabel } from "zerolocus62";

const label = encodeLabel([new Factor("A", 1, 1)], [[[1]]]);
console.assert(label === "1.0");

const result = decodeLabel(label);
console.assert(result.factors[0].group === "A");
console.assert(result.summands[0][0][0] === 1);

As in the specification, a one-bundle label is also a canonical descriptor of the encoded bundle itself, not only of a prospective zero locus, so signed rows such as encodeLabel([new Factor("A", 1, 1)], [[[-1]]]) === "1.z220" are valid.

Website

Build the static site artifact used by GitHub Pages:

npm --prefix javascript run build:site

Preview the same static artifact locally:

npm --prefix javascript run site

Then open http://localhost:4173.

The repository publishes this artifact through the GitHub Pages workflow in ../.github/workflows/pages.yml.