Package detail

hord

DarrenPaulWright191MIT0.7.10

A data storage and manipulation library for javascript

collections, indexeddb, dexie, mongo

readme

Hord

A data storage and manipulation library for javascript

npm build coverage deps size vulnerabilities license


Installation

npm install hord

Requires Babel 7.2+


Classes

CollectionArray

An array of objects with optional model enforcement and indexed queries.

List

Always sorted array.

Model

Data models with automatic schema enforcement.

Schema

Schema enforcement.


Functions

compare([paths], [desc])sortCompareFunction

Returns a function that compares two values. If paths are provided, compares the values at that path on objects.

Notes:

  • Handles undefined, null, and NaN.
  • Distinguishes numbers from strings.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning

0.7.0 - 2020-01-30

Added

  • .discardAt, .median, .total, .mean, and .quartiles methods to List

Changed

  • .sorter to .comparer in List
  • Collection.sort has a default comparer function

0.6.1 - 2019-12-26

Changed

  • Better docs

Security

  • Updated dependencies

0.6.0 - 2019-12-11

Added

0.5.10 - 2019-12-09

Security

  • Updated dependencies

0.5.9 - 2019-12-04

Changed

  • Performance improvements

Security

  • Updated dependencies

0.5.8 - 2019-10-22

Security

  • Updated dependencies

0.5.7 - 2019-10-21

Security

  • Updated dependencies

0.5.6 - 2019-10-09

Security

  • Updated dependencies

0.5.5 - 2019-10-06

Fixed

  • In Schema.enforce, don't try to set a value if the item is not an object

0.5.4 - 2019-10-05

Fixed

  • Nested Models and Schemas are now handled like other datatypes

0.5.3 - 2019-10-01

Fixed

  • Model should process errors when apply is called

Security

  • Updated dependencies

0.5.2 - 2019-08-28

Security

  • Updated dependencies

Added

0.5.1 - 2019-07-29

Security

  • Updated dependencies

Fixed

  • Fixed compare function when NaN is provided

0.5.0 - 2019-07-18

Added

  • List
    • Added .someRight method
    • Added .intersection method
  • Collection
    • Added support for query operators
    • Improved performance when deriving new collections with indexes

Changed

  • Schema
    • Improved support for nested Schemas
    • Added support for '*' key
  • Model
    • Improved support for nested Schemas/Models
  • List
    • .concat now returns a new List instead of mutating the calling list.

0.4.1 - 2019-07-01

Added

0.4.0 - 2019-07-01

Added

0.3.2 - 2019-06-25

Changed

  • Model:
    • Exporting MODEL_ERROR_LEVEL.
    • Now accepts multiple callbacks for onChange and onError.
  • List:
    • .values() now returns a shallow clone of values.
    • Binary search:
      • No longer compares a non-existent value at index array.length
      • Compares against the matcher object more consistently
  • Collection
    • Predicate can now be deeply nested.
    • Fixed model application in push and unshift

0.3.1 - 2019-06-20

  • Fixed Tests

0.3.0 - 2019-06-20

Added

0.2.4 - 2019-06-13

  • Improved documentation

0.2.3 - 2019-06-07

  • Improved documentation

0.2.2 - 2019-06-05

Security

  • Updated dependencies

0.2.1 - 2019-04-03

  • Fixed build environment

0.2.0 - 2019-03-16

Changed

  • List methods findAll, filter, and slice now return new Lists with the same sorter as the calling list
  • List uses a better default sorter with default-compare

Added

  • Method discardAll to List
  • Method unique to List

0.1.3 - 2019-02-26

Added

  • Added the method addUnique to List

0.1.2 - 2019-02-25

Changed

  • Fixed a bug in List when finding items at the beginning of the array

0.1.1 - 2019-02-06

Changed

  • Removed .flat and .flatMap from List

0.1.0 - 2019-02-06

Added