2belt

Useful utility functions with strong FP support

Usage no npm install needed!

<script type="module">
  import belt from 'https://cdn.skypack.dev/2belt';
</script>

README

2belt

A library of higher order functions that is immutable, minimalist and versatile

Under construction

This module is still under internal development. We are working on:

  • firming up the API
  • tree shaking
  • usable in all browsers

Available functions

  • filter(obj, fn(val, key))
  • reject(obj, fn(val, key))
  • map(obj, fn(val, key))
  • remap(obj, fn(val, key))
  • shuffle(arr)
  • sortBy(arr, key, desc?)
  • toPairs(obj)
  • fromPairs(arr)
  • groupBy(arr, keyFn, valFn)