types.js/README.md
Alex A. Naanou e29ce4583c started work on docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2020-10-07 03:53:10 +03:00

4.0 KiB

types.js

A library of JavaScript type extensions, types and type utilities.

Built-in type extenstions

Object

Object.deepKeys(..)

Object.match(..)

Object.matchPartial(..)

Object.flatCopy(..)

<object>.run(..)

Array

<array>.first(..) / <array>.last(..)

Get or set the first/last items of <array>.

<array>.compact()

Generate a compact <array> from a sparse <array>, i.e. removing all the empty slots.

<array>.len

Number of non-empty slots/elements in <array>.

<array>.toKeys(..)

<array>.toMap(..)

<array>.unique(..) / <array>.tailUnique(..)

Generate an array with all duplicate elements removed.

<array>.cmp(..)

<array>.setCmp(..)

<array>.sortAs(..)

<array>.inplaceSortAs(..)

<array>.mapChunks(..)

<array>.filterChunks(..)

<array>.reduceChunks(..)

Array (polyfill)

<array>.flat()

<array>.includes()

Set

<set>.unite(..)

<set>.intersect(..)

<set>.subtract(..)

Date

Date.timeStamp(..)

Date.fromTimeStamp(..)

Date.str2ms(..)

<date>.toShortDate(..)

<date>.getTimeStamp(..)

<date>.setTimeStamp(..)

String

<string>.capitalize()

RegExp

RegExp.quoteRegExp(..)

Containers

UniqueKeyMap() (Map)

UniqueKeyMap extends the Map constructor.

XXX

For more info on Map see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

<unique-key-map>.reset(..)

<unique-key-map>.uniqueKey(..)

<unique-key-map>.rename(..)

<unique-key-map>.keysOf(..)