A reference implementation of a list ordering system like JIRA's Lexorank algorithm.
Npm
npm install lexorank
Yarn
yarn add lexorank
import {LexoRank} from "lexorank";
// min
const minLexoRank = LexoRank.min();
// max
const maxLexoRank = LexoRank.max();
// middle
const middleLexoRank = LexoRank.middle();
// parse
const parsedLexoRank = LexoRank.parse('0|0i0000:');
import {LexoRank} from "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.
import {LexoRank} from "lexorank";
// any lexorank
const any1LexoRank = LexoRank.min();
// another lexorank
const any2LexoRank = any1LexoRank.genNext().genNext();
// calculate between
const betweenLexoRank = any1LexoRank.between(any2LexoRank);
MIT
I have not found information about the license of the algorithm LexoRank. If the rights are violated, please contact me to correct the current license.