/clj-fractional-indexing

Fractional Indexing in Clojure/Clojurescript

Primary LanguageClojureEclipse Public License 1.0EPL-1.0

clj-fractional-indexing

This is a Clojure port of the original JavaScript implementation https://github.com/rocicorp/fractional-indexing.

Usage

(require '[logseq.clj-fractional-indexing :as index])

;; Generate one key

(index/generate-key-between nil nil)
;; "a0"

(generate-key-between "a0" nil)
;; "a1"

(generate-key-between "a0" "a1")
;; "a0V"

;; Generate multiple keys
;; ["a0G" "a0V" "a0l"]

License

Distributed under the Eclipse Public License version 1.0.