@ayte/archetype.value
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Ayte / TypeScript / Archetype / Value

npm CircleCI

This package consists of common value types and types for everyday tasks related to values, such as comparison.

Installation

yarn add @ayte/archetype.value

# - or -

npm install -S @ayte/archetype.value

Structure

Value types

Packages exposes IBound<T>, which describes abstract value bound (limit and whether that limit is exclusive or not), IRange<T>, which consists of upper and lower IBound<T>s, and Equivalence, special enum describing comparison result.

Processing types

As for now, three types are exposed: IComparator<T>, IClassicComparator<T> and IMaterializer<T>.

Comparator types expose standard comparison, allowing caller to know whether left value is lesser than, equal to or greater than right, the only difference is that classic comparator returns number, while regular comparator returns Equivalence enum value.

Materializer is a function that takes in partial value and reconstructs all properties, which is a usual task in configuration reading and other types of value normalization.

Licensing

MIT / UPL-1.0

Ayte Labs, 2020

Readme

Keywords

none

Package Sidebar

Install

npm i @ayte/archetype.value

Weekly Downloads

0

Version

0.2.0

License

(MIT OR UPL-1.0)

Unpacked Size

6.89 kB

Total Files

13

Last publish

Collaborators

  • ayte-bot
  • etki