An implementation of JIRA's Lexorank algorithm
npm install @wewatch/lexorank

- About
- Installation
- Usage
- License
A reference implementation of a list ordering system
like JIRA's Lexorank algorithm. This project is a fork
from lexorank-ts with modifications to allow customizations.
- npm
``shell`
npm install @wewatch/lexorank
- yarn
`shell`
yarn add @wewatch/lexorank
`typescript
import { LexoRank } from "@wewatch/lexorank";
// min
const minLexoRank = LexoRank.min();
// max
const maxLexoRank = LexoRank.max();
// middle
const midLexoRank = LexoRank.middle();
// parse
const parsedLexoRank = LexoRank.parse("0|0i0000:");
`
`typescript
import { LexoRank } from "@wewatch/lexorank";
// any lexoRank
const lexoRank = LexoRank.middle();
// generate next lexorank
const nextLexoRank = lexoRank.genNext();
// generate previous lexorank
const prevLexoRank = lexoRank.genPrev();
// toString
const lexoRankStr = lexoRank.toString();
`
LexRank calculation based on existing LexoRanks.
`typescript
import { LexoRank } from "@wewatch/lexorank";
// any lexorank
const rank1 = LexoRank.min();
// another lexorank
const rank2 = rank1.genNext().genNext();
// calculate between
const betweenLexoRank = rank1.between(rank2);
`
`typescript
import { buildLexoRank, NumeralSystem64 } from "@wewatch/lexorank";
const LexoRank = buildLexoRank({
NumeralSystem: NumeralSystem64,
maxOrder: 8,
initialMinDecimal: "1000",
defaultGap: "1000",
});
``
Apache-2.0