2.0.0 • Published 3 years ago
@rowansays/helpers v2.0.0
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/helpers
Functions
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
true
for all iterables
isIterableObject()
- returns
true
for all iterables except strings