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
-
zipObjectDeep (
🔜 - Work in progress - PRs most welcome ) Issue - #13
Collection
Dates
Function
-
[after
✔️ ](https://alt-lodash.vercel.app/home#after] -
defer (
🔜 - Work in progress - PRs most welcome ) Issue - #17 -
memoize (
🔜 - Work in progress - PRs most welcome ) Issue - #18 -
throttle (
🔜 - Work in progress - PRs most welcome ) Issue - #19
Lang
-
cloneDeepWith (
🔜 - Work in progress - PRs most welcome ) Issue - #20 -
toFinite (
🔜 - Work in progress - PRs most welcome ) Issue - #27 -
toLength (
🔜 - Work in progress - PRs most welcome ) Issue - #28
Math
Number
Object
-
defaultsDeep (
🔜 - Work in progress - PRs most welcome ) Issue - #42 -
invoke (
🔜 - Work in progress - PRs most welcome ) Issue - #46 -
mergeWith (
🔜 - Work in progress - PRs most welcome ) Issue - #48 -
result (
🔜 - Work in progress - PRs most welcome ) Issue - #49
String
-
deburr (
🔜 - Work in progress - PRs most welcome ) Issue - #63 -
template (
🔜 - Work in progress - PRs most welcome ) -
truncate (
🔜 - Work in progress - PRs most welcome ) Issue - #64
Util
-
bindAll (
🔜 - Work in progress - PRs most welcome ) Issue - #67 -
matches (
🔜 - Work in progress - PRs most welcome ) Issue - #68 -
matchesProperty (
🔜 - Work in progress - PRs most welcome ) Issue - #69 -
mixin (
🔜 - Work in progress - PRs most welcome ) Issue - #72 -
noConflict (
🔜 - Work in progress - PRs most welcome ) Issue - #73 -
runInContext (
🔜 - Work in progress - PRs most welcome ) Issue - #75
Seq
-
_ (
🔜 - Work in progress - PRs most welcome ) -
chain -
chain2
✔️ ( Alternate of chain method with minimal code )chain2(value)
Arguments
value (*): The value to wrap.
Returns
(Object): Returns the new wrapper instance.
Example
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'
-
tap -
tap2
✔️ ( Alternate of tap method with minimal code )tap2(value, interceptor)
Arguments
value (*): The value to provide to interceptor. interceptor (Function): The function to invoke.
Returns
(*): Returns value.
Example
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]
-
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 )