Alternate of Lodash Library
https://alt-lodash.vercel.app
Installation
With Yarn:
yarn add alt-lodash
With npm:
npm install alt-lodash
Usage
// import all available the methods
import _ from 'alt-lodash'; // ESM ( ECMA Script ) module
or
const _ = require('alt-lodash'); // cjs ( common js ) module
// import specific methods instead of all
import { concat, chunk, forEach, filter } from 'alt-lodash'; // ESM ( ECMA Script ) module
or
const { concat, chunk, forEach, filter } = require('alt-lodash'); // cjs ( common js ) module
Array
- 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 ✔️
- unshift ✔️ New
- unzip ✔️
- unzipWith ✔️
- without ✔️
- xor ✔️
- xorBy ✔️
- xorWith ✔️
- zip ✔️
- zipObject ✔️
- zipObjectDeep ( 🔜 - Work in progress - PRs most welcome ) Issue - #13
- zipWith ✔️
Collection
- eachRight -> forEachRight ✔️
- every ✔️
- filter ✔️
- find ✔️
- findLast ✔️
- flatMap ✔️
- flatMapDeep ✔️
- flatMapDepth ✔️
- forEach ✔️
- forEachRight ✔️
- freeze ✔️ New
- groupBy ✔️
- includes ✔️
- invokeMap ✔️
- keyBy ✔️
- map ✔️
- orderBy ✔️
- partition ✔️
- preventExtensions ✔️ New
- reduce ✔️
- reduceRight ✔️
- reject ✔️
- sample ✔️
- sampleSize ✔️
- seal ✔️ New
- shuffle ✔️
- size ✔️
- some ✔️
- sortBy ✔️
Dates
Function
[after ✔️](https://alt-lodash.vercel.app/home#after]
- before ✔️
- bind ✔️
- bindKey ✔️
- curry ✔️
- curryRight ✔️
- debounce ✔️
- defer ( 🔜 - Work in progress - PRs most welcome ) Issue - #17
- delay ✔️
- flip ✔️
- memoize ( 🔜 - Work in progress - PRs most welcome ) Issue - #18
- negate ✔️
- once ✔️
- overArgs ✔️
- partial ✔️
- partialRight ✔️
- rearg ✔️
- rest ✔️
- spread ✔️
- throttle ( 🔜 - Work in progress - PRs most welcome ) Issue - #19
- unary ✔️
- wrap ✔️
Lang
- cloneDeep ✔️
- cloneDeepWith ( 🔜 - Work in progress - PRs most welcome ) Issue - #20
- cloneWith ✔️
- conformsTo ✔️
- eq ✔️
- gt ✔️
- gte ✔️
- isArguments ✔️
- isArray ✔️
- isArrayBuffer ✔️
- isArrayLike ✔️
- isArrayLikeObject ✔️
- isBoolean ✔️
- isBuffer ✔️
- isDate ✔️
- isElement ✔️
- isEmpty ✔️
- isEqual ✔️
- isEqualWith ✔️
- isError ✔️
- isExtensible ✔️ New
- isFinite ✔️
- isFrozen ✔️ New
- isFunction ✔️
- isInteger ✔️
- isLength ✔️
- isMap ✔️
- isMatch ✔️
- isMatchWith ✔️
- isNaN ✔️
- isNative ✔️
- isNil ✔️
- isNode ✔️ New
- isNull ✔️
- isNumber ✔️
- isObject ✔️
- isObjectLike ✔️
- isPlainObject ✔️
- isRegExp ✔️
- isSafeInteger ✔️
- isSealed ✔️ New
- isSet ✔️
- isString ✔️
- isSymbol ✔️
- isTypedArray ✔️
- isUndefined ✔️
- isWeakMap ✔️
- isWeakSet ✔️
- lt ✔️
- lte ✔️
- toArray ✔️
- toFinite ( 🔜 - Work in progress - PRs most welcome ) Issue - #27
- toInteger ✔️
- toLength ( 🔜 - Work in progress - PRs most welcome ) Issue - #28
- toNumber ✔️
- toPlainObject ✔️
- toSafeInteger ✔️
- toString ✔️
Math
- divide ✔️
- floor ✔️
- max ✔️
- maxBy ✔️
- mean ✔️
- meanBy ✔️
- min ✔️
- minBy ✔️
- multiply ✔️
- round ✔️
- subtract ✔️
- sum ✔️
- sumBy ✔️
- clamp ✔️
- inRange ✔️
- random ✔️
Number
Object
- assignInWith ✔️
- assignWith ✔️
- at ✔️
- create ✔️
- defaults ✔️
- defaultsDeep ( 🔜 - Work in progress - PRs most welcome ) Issue - #42
- entries -> toPairs ✔️
- entriesIn -> toPairsIn ✔️
- extend -> assignIn ✔️
- extendWith -> assignInWith ✔️
- findKey ✔️
- findLastKey ✔️
- forIn ✔️
- forInRight ✔️
- forOwn ✔️
- forOwnRight ✔️
- functions ✔️
- functionsIn ✔️
- get ✔️
- has ✔️
- hasIn ✔️
- invert ✔️
- invertBy ✔️
- invoke ( 🔜 - Work in progress - PRs most welcome ) Issue - #46
- keys ✔️
- keysIn ✔️
- mapKeys ✔️
- mapValues ✔️
- merge ✔️
- mergeWith ( 🔜 - Work in progress - PRs most welcome ) Issue - #48
- omit ✔️
- omitBy ✔️
- pick ✔️
- pickBy ✔️
- result ( 🔜 - Work in progress - PRs most welcome ) Issue - #49
- set ✔️
- setWith ✔️
- toPairs ✔️
- toPairsIn ✔️
- transform ✔️
- unset ✔️
- update ✔️
- updateWith ✔️
- values ✔️
- valuesIn ✔️
String
- deburr ( 🔜 - Work in progress - PRs most welcome ) Issue - #63
- endsWith ✔️
- escape ✔️
- escapeRegExp ✔️
- kebabCase ✔️
- lowerCase ✔️
- lowerFirst ✔️
- pad ✔️
- padEnd ✔️
- padStart ✔️
- parseInt ✔️
- repeat ✔️
- replace ✔️
- snakeCase ✔️
- split ✔️
- startCase ✔️
- startsWith ✔️
- template ( 🔜 - Work in progress - PRs most welcome )
- toLower ✔️
- toUpper ✔️
- trim ✔️
- trimEnd ✔️
- trimStart ✔️
- truncate ( 🔜 - Work in progress - PRs most welcome ) Issue - #64
- unescape ✔️
- upperCase ✔️
- upperFirst ✔️
- words ✔️
Util
bindAll ( 🔜 - Work in progress - PRs most welcome ) Issue - #67
- cond ✔️
- conforms ✔️
- constant ✔️
- defaultTo ✔️
- flow ✔️
- flowRight ✔️
- identity ✔️
- iteratee ✔️
- matches ( 🔜 - Work in progress - PRs most welcome ) Issue - #68
- matchesProperty ( 🔜 - Work in progress - PRs most welcome ) Issue - #69
- method ✔️
- methodOf ✔️
- mixin ( 🔜 - Work in progress - PRs most welcome ) Issue - #72
- noConflict ( 🔜 - Work in progress - PRs most welcome ) Issue - #73
- noop ✔️
- nthArg ✔️
- over ✔️
- overEvery ✔️
- overSome ✔️
- property ✔️
- propertyOf ✔️
- range ✔️
- rangeRight ✔️
- runInContext ( 🔜 - Work in progress - PRs most welcome ) Issue - #75
- sleep ✔️ New
- stubArray ✔️
- stubFalse ✔️
- stubObject ✔️
- stubString ✔️
- stubTrue ✔️
- times ✔️
- toPath ✔️
- uniqueId ✔️
- uniqueId2 ✔️ New
Seq
_ ( 🔜 - Work in progress - PRs most welcome )
chain- chain2 ✔️ ( Alternate of chain method with minimal code )
```ts
chain2(value)
```
## Arguments
```bash
value (*): The value to wrap.
```
## Returns
```bash
(Object): Returns the new wrapper instance.
```
## Example
```typescript
import { chain2, map, sortBy, head } from 'alt-lodash';
const users = [
{ 'user': 'barney', 'age': 36 },
{ 'user': 'fred', 'age': 40 },
{ 'user': 'pebbles', 'age': 1 }
];
const youngest = chain2(users)
.fn(sortBy, 'age')
.fn(map, (function (o: any) {
return o.user + ' is ' + o.age;
}))
.fn(head)
.value();
// => 'pebbles is 1'
```
```ts
tap2(value, interceptor)
```
## Arguments
```bash
value (*): The value to provide to interceptor.
interceptor (Function): The function to invoke.
```
## Returns
```bash
(*): Returns value.
```
## Example
```typescript
import { tap2, concat } from 'alt-lodash';
const data = [1, 2, 3];
const tappedData = tap2(data, (array: number[]) => {
// Mutate input array.
array.push(100);
})
.fn(concat, [4])
.fn(concat, [5])
.value();
// => [1, 2, 3, 100, 4, 5]
```
- thru ✔️
- prototype[Symbol.iterator] ( 🔜 - Work in progress - PRs most welcome )
- prototype.at ( 🔜 - Work in progress - PRs most welcome )
- prototype.chain ( 🔜 - Work in progress - PRs most welcome )
- prototype.commit ( 🔜 - Work in progress - PRs most welcome )
- prototype.next ( 🔜 - Work in progress - PRs most welcome )
- prototype.plant ( 🔜 - Work in progress - PRs most welcome )
- prototype.reverse ( 🔜 - Work in progress - PRs most welcome )
- prototype.toJSON -> value ( 🔜 - Work in progress - PRs most welcome )
- prototype.value ( 🔜 - Work in progress - PRs most welcome )
- prototype.valueOf -> value ( 🔜 - Work in progress - PRs most welcome )