@ch1/utility

Utility functions I end up adding to all my projects

Usage no npm install needed!

<script type="module">
  import ch1Utility from 'https://cdn.skypack.dev/@ch1/utility';
</script>

README

CH1 Utility

CircleCI

This is not well maintained

Installation

yarn add @ch1/utility

Interfaces

  • Dictionary<T>

Functions

  • arrToObj
  • createBetween (random: () => number) => () => number
  • deepFreeze
  • findCaseInsensitivePropInObj
  • hasProp
  • isBoolean
  • identity
  • isFunction
  • isNaN
  • isNumber
  • isNull
  • isObject
  • isString
  • isUndefined
  • noop
  • partial
  • pluck
  • objEach
  • objFilter
  • objReduce
  • toGtZeroIntMax
  • toInt
  • toIntArray
  • toIntArrayMax
  • toIntArrayMin
  • toIntBetweenOptional
  • toIntMax
  • toIntMin
  • toString
  • toStringArray
  • toStringArrayMax
  • toStringMax
  • unzip
  • zip
const between = createBetween(Math.random.bind(Math));
const randomNumber = between(0, 100); // inclusive due to Math.random

License

LGPL