@rowansays/helpers
v2.0.0
Published
Library of helper functions.
Readme
Rowan's JavaScript Helpers
Library of pure JavaScript filters and predicates. This library is available via node package manager and may be installed by using the following command:
npm i @rowansays/helpersFunctions
castArray()
- clones existing arrays
- converts Map, Set, and other iterables to arrays
- optional filtering of allowed types
- optional recursion
castString()
- strings pass through unaltered
- numbers are coerced to strings
- an empty string is returned for everything else
castStringArray()
- filter an array preserving all string values
- numbers are coerced to strings
- all other values are excluded from the array
isIterable()
- returns
truefor all iterables
isIterableObject()
- returns
truefor all iterables except strings
