A Javascript utility belt with an emphasis on Functional Programming.
- No direct overlap with lodash
- No dependencies
Installation
npm install cint --save
Usage
import cint from 'cint'
API
Function
not(f)
partialAt(f, index, curriedArgs)
aritize(f, n)
callTillValue(value)
spy(f, spier)
toAsync(f)
String
supplant(str, o)
startsWith(str, sub)
before(str, delim)
after(str, delim)
betweenstr, left, right)
bookend(middle, left, right)
repeatString(str, n, delim)
toTitleCase(str)
Number
ordinal(n)
mapNumber(n, f)
Array
pluck(arr, property)
group(arr, propOrFunc)
orderedGroup(arr, propOrFunc)
tally(arr)
tallyProps(arr)
unique(arr)
reversed(arr)
index(arr, i)
rotate(arr, n)
toObject(arr, f)
find(arr, f)
findByProperty(arr, prop, value)
spliced(arr, index, howMany
range(start, end)
filterBy(arr, prop, value)
chunk(a, n)
Object
values(o)
keyValue(key, value)
getValue(o, key)
setValue(o, key, value)
mapOverKey(f, originalKey, newKey)
joinObject(obj, propSeparator, valueSeparator)
isEmpty(o)
numProperties(o)
toArray(obj, f)
filterObject(obj, f)
changeKeys(obj, changedKeys)
tap(f, o)
look(o)
Utility
addTwo(x, y)
add()
compare(a,b)
compareProperty(property)
createNew(C, args)
dynamicCompare(props)
equals(a,b)
hasKey(creamFilling, donut)
hasValue(x)
hash(o)
intoString(value)
guid()
typeOf(value)