# types.js A library of JavaScript type extensions, types and type utilities. - [types.js](#typesjs) - [Built-in type extenstions](#built-in-type-extenstions) - [`Object`](#object) - [`Object.deepKeys(..)`](#objectdeepkeys) - [`Object.match(..)`](#objectmatch) - [`Object.matchPartial(..)`](#objectmatchpartial) - [`Object.flatCopy(..)`](#objectflatcopy) - [`.run(..)`](#objectrun) - [`Array`](#array) - [`.first(..)` / `.last(..)`](#arrayfirst--arraylast) - [`.compact()`](#arraycompact) - [`.len`](#arraylen) - [`.toKeys(..)`](#arraytokeys) - [`.toMap(..)`](#arraytomap) - [`.unique(..)` / `.tailUnique(..)`](#arrayunique--arraytailunique) - [`.cmp(..)`](#arraycmp) - [`.setCmp(..)`](#arraysetcmp) - [`.sortAs(..)`](#arraysortas) - [`.inplaceSortAs(..)`](#arrayinplacesortas) - [`.mapChunks(..)`](#arraymapchunks) - [`.filterChunks(..)`](#arrayfilterchunks) - [`.reduceChunks(..)`](#arrayreducechunks) - [`Array` (polyfill)](#array-polyfill) - [`.flat()`](#arrayflat) - [`.includes()`](#arrayincludes) - [`Set`](#set) - [`.unite(..)`](#setunite) - [`.intersect(..)`](#setintersect) - [`.subtract(..)`](#setsubtract) - [`Date`](#date) - [`Date.timeStamp(..)`](#datetimestamp) - [`Date.fromTimeStamp(..)`](#datefromtimestamp) - [`Date.str2ms(..)`](#datestr2ms) - [`.toShortDate(..)`](#datetoshortdate) - [`.getTimeStamp(..)`](#dategettimestamp) - [`.setTimeStamp(..)`](#datesettimestamp) - [`String`](#string) - [`.capitalize()`](#stringcapitalize) - [`RegExp`](#regexp) - [`RegExp.quoteRegExp(..)`](#regexpquoteregexp) - [Containers](#containers) - [`UniqueKeyMap()` (`Map`)](#uniquekeymap-map) - [`.reset(..)`](#unique-key-mapreset) - [`.uniqueKey(..)`](#unique-key-mapuniquekey) - [`.rename(..)`](#unique-key-maprename) - [`.keysOf(..)`](#unique-key-mapkeysof) ## Built-in type extenstions ### `Object` #### `Object.deepKeys(..)` #### `Object.match(..)` #### `Object.matchPartial(..)` #### `Object.flatCopy(..)` #### `.run(..)` ### `Array` #### `.first(..)` / `.last(..)` Get or set the first/last items of ``. #### `.compact()` Generate a compact `` from a sparse ``, i.e. removing all the empty slots. #### `.len` Number of non-empty slots/elements in ``. #### `.toKeys(..)` #### `.toMap(..)` #### `.unique(..)` / `.tailUnique(..)` Generate an array with all duplicate elements removed. #### `.cmp(..)` #### `.setCmp(..)` #### `.sortAs(..)` #### `.inplaceSortAs(..)` #### `.mapChunks(..)` #### `.filterChunks(..)` #### `.reduceChunks(..)` ### `Array` (polyfill) #### `.flat()` #### `.includes()` ### `Set` #### `.unite(..)` #### `.intersect(..)` #### `.subtract(..)` ### `Date` #### `Date.timeStamp(..)` #### `Date.fromTimeStamp(..)` #### `Date.str2ms(..)` #### `.toShortDate(..)` #### `.getTimeStamp(..)` #### `.setTimeStamp(..)` ### `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 #### `.reset(..)` #### `.uniqueKey(..)` #### `.rename(..)` #### `.keysOf(..)`