Adds extra native object methods using the Sugar Javascript utility library. It also corrects and enhances existing Sugar typescript definitions.
https://github.com/andrewplummer/Sugar
Object.isDefined(obj)
- Returns false if
obj
is undefined, otherwise true. .mapKeys(obj, map, [skipNull])
.cordon(obj, [deep])
.collect(obj, collectFn)
.replace(obj, key, replacer)
.selectValues(obj, keys)
.getWithDefault(obj, key, default, [inherited])
.duplicate(obj, [duplicateFn])
.when(obj, condition, whenFn)
.canBeNumber()
.compare(str)
.splice(start, [deleteCount], [...items])
Array.ensure(arr, [ignoreNull])
.move(fromIndex, toIndex)
.indexesOf(items)
.sift(search)
.tapEach(eachFn, [context])
.toObject(mapFn)
.indexes()
.normalizeIndex(index, [loop])
.expel(items)
.transpose(items, [missing])
.isA(classType)
Boolean.parse(value)
Date.earliest(dates)
Date.latest(dates)
start
end
primitive
UnensuredArray<T>