@northtech/ginnungagap
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

ginnungagap

... is the formless void before all else

These are stand-alone TypeScript utilities, not depending on any frameworks. (In other words, this is the "utils" kitchensink).

Undefined Handling

is heavily inspired by Guava's Preconditions, and null-handling in Strings, but also contains TypeScript-specific narrowing guards.

Comparison

has null-aware comparison, and can be used to build a comparator which compares multiple fields in objects. It also sorts embedded numbers (integers) according to their numeric value; not their lexical order, so, say, A2: Something sorts before A10: Other.

TrigramIndex

is a fuzzy search algorithm for in-memory arrays of objects. This is very effective for something like filtering lists on a couple of keystrokes, quickly narrowing down a selection.
If you need more full-featured text search, consider something like https://lunrjs.com/.

Arrays

contains a shuffle function to randomize an array (correctly).

Usage

Install with

npm install @northtech/ginnungagap@^1.3

TypeDocs at https://doc.northtech.dk/ginnungagap/

Readme

Keywords

none

Package Sidebar

Install

npm i @northtech/ginnungagap

Weekly Downloads

14

Version

1.3.1

License

ISC

Unpacked Size

75.4 kB

Total Files

36

Last publish

Collaborators

  • wulfsberg