lodash-featurefill v0.0.1
lodash-featurefill
A module for setting lodash functions as prototype methods.
Currently only built for nodejs and requires nodejs v6.0.0+.
Usage
$ npm install lodash-featurefills --save
Constructor takes a bool parameter indicating if native prototype implementations should be overwritten or not. E.g. if is set to true
, Array.prototype.forEach
will be overridden with lodash foreach implementation.
var lodashFeaturefills = require('lodash-featurefills');
var overrideNativeImplementation = false;
lodashFeaturefills( overrideNativeImplementation );
Example
var items = [0, 1, false, 2, '', 3];
//With lodash
_.compact(items); // → [1, 2, 3]
//With featurefills
items.compact(); // → [1, 2, 3]
Supported API
Array
.chunk
.compact
.concat
.difference
.differenceBy
.differenceWith
.drop
.dropRight
.dropRightWhile
.dropWhile
.fill
.findIndex
.findLastIndex
.first → head
.flatten
.flattenDeep
.flattenDepth
.fromPairs
.head
.indexOf
.initial
.intersection
.intersectionBy
.intersectionWith
.join
.last
.lastIndexOf
.nth
.pull
.pullAll
.pullAllBy
.pullAllWith
.pullAt
.remove
.reverse
.slice
.sortedIndex
.sortedIndexBy
.sortedIndexOf
.sortedLastIndex
.sortedLastIndexBy
.sortedLastIndexOf
.sortedUniq
.sortedUniqBy
.tail
.take
.takeRight
.takeRightWhile
.takeWhile
.union
.unionBy
.unionWith
.uniq
.uniqBy
.uniqWith
.unzip
.unzipWith
.without
.xor
.xorBy
.xorWith
.zip
.zipObject
.zipObjectDeep
_.zipWith
Collection
.countBy
.each → forEach
.eachRight → forEachRight
.every
.filter
.find
.findLast
.flatMap
.flatMapDeep
.flatMapDepth
.forEach
.forEachRight
.groupBy
.includes
.invokeMap
.keyBy
.map
.orderBy
.partition
.reduce
.reduceRight
.reject
.sample
.sampleSize
.shuffle
.size
.some
.sortBy
Date
_.now
String
.camelCase
.capitalize
.deburr
.endsWith
.escape
.escapeRegExp
.kebabCase
.lowerCase
.lowerFirst
.pad
.padEnd
.padStart
.parseInt
.repeat
.replace
.snakeCase
.split
.startCase
.startsWith
.template
.toLower
.toUpper
.trim
.trimEnd
.trimStart
.truncate
.unescape
.upperCase
.upperFirst
.words
8 years ago