2.0.3 • Published 3 years ago

@vanillaes/absurdum v2.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Absurdum is a Javascript utility library built with a focus on providing idempotent side-effect free functions and clear/readable modular source for tree shaking.

Features

  • Explores the flexibility of Reduce
  • Abstraction Free -> tree-shake friendly
  • Functional -> all operators are side-effect free
  • Polyfills -> includes operator polyfills for older browsers
  • Isomorphic -> works consistently across all JS runtimes
  • Typescript -> typings are provided for all operators
  • Intellisense -> supports code completions + inline documentation
  • Well Tested -> includes 600+ tests covering every aspect

Imports

This package works isomorphically in browsers and server-side JavaScript runtimes

Browsers

Import directly from the local path or a CDN

Top-level operator namespaces (ie [arrays, objects, strings]) can be imported from the index

<script type="module">
import { arrays, objects, strings } from 'path/to/absurdum/index.js'
</script>

The minified version can be imported from

<script type="module">
import { arrays, objects, strings } from 'path/to/absurdum/index.min.js'
</script>

Node

Install the package

npm install @vanillaes/absurdum

Top-level operator namespaces are provided

import { arrays, objects, strings } from '@vanillaes/absurdum';

Individual operators can also be imported from their parent namespaces

import { chunk, find } from '@vanillaes/absurdum/arrays';
import { assign, invert } from '@vanillaes/absurdum/objects';
import { camelCase, repeat } from '@vanillaes/absurdum/strings';

Note: Webpack's tree-shaking algorithm doesn't work with multi-layered exports. To optimize bundle size, prefer individual operator imports.

Usage

Import an operator and feed it some inputs

const input = ['a', 'b', 'c', 'd'];
const output = reverse(input);
console.log(output);
// > ['d', 'c', 'b', 'a']

Tip: For VSCode users. Input type-checking, intellisense, and inline documentation are all supported.

API Documentation

Arrays

OperatorLodashPolyfills
chunk_.chunk
compact_.compact
difference_.difference
drop_.drop
dropRight_.dropRight
fill_.fillArray.prototype.fill
filter_.filter
find_.findArray.prototype.find
findIndex_.findIndexArray.prototype.findIndex
findLastIndex_.findLastIndex
flat_.flattenArray.prototype.flat
frequency
intersection_.intersection
map_.map
pull_.pull
take_.take
takeRight_.takeRight
union_.union
unique_.uniq
unzip_.unzip
without_.without
xor_.xor
zip_.zip

Objects

OperatorLodashPolyfills
assign_.assignObject.assign
at_.at
defaults_.defaults
defaultsDeep_.defaultsDeep
entries_.toPairsObject.entries
filter_.filter
findKey_.findKey
findLastKey_.findLastKey
forIn_.forIn
fromEntries_.fromPairsObject.fromEntries
get_.get
has_.has
invert_.invert
mapKeys_.mapKeys
mapValues_.mapValues
merge_.merge
pick_.pick
result_.result
transform_.transform
values_.valuesObject.values

Strings

OperatorLodashPolyfills
camelCase_.camelCase
chomp
deburr_.deburr
endsWith_.endsWithString.prototype.endsWith
includesString.prototype.includes
kebabCase_.kebabCase
pad_.pad
padEnd_.padEndString.prototype.padEnd
padStart_.padStartString.prototype.padStart
pascalCase_.startCase
repeat_.repeatString.prototype.repeat
reverse
snakeCase_.snakeCase
startsWith_.startsWithString.prototype.startsWith
trimEnd_.trimEndString.prototype.trimEnd
trimStart_.trimStartString.prototype.trimStart
truncate_.truncate
words_.words
1.2.18

3 years ago

1.2.19

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.17

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.9

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.10

3 years ago

1.2.11

3 years ago

1.2.16

3 years ago

1.2.15

3 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.10

4 years ago