{"id":18496419,"url":"https://github.com/thecoderdream/lodash-clone","last_synced_at":"2025-10-19T19:21:50.352Z","repository":{"id":144685090,"uuid":"153635641","full_name":"TheCoderDream/Lodash-Clone","owner":"TheCoderDream","description":"This library is just for demonstration my coding skill and a utility that i use in my own projects","archived":false,"fork":false,"pushed_at":"2020-08-26T12:38:09.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-17T00:16:06.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheCoderDream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-18T14:16:46.000Z","updated_at":"2020-08-26T12:38:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d3bcbf9-cf57-42d1-aa8d-d0a662f30d40","html_url":"https://github.com/TheCoderDream/Lodash-Clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderDream%2FLodash-Clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderDream%2FLodash-Clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderDream%2FLodash-Clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderDream%2FLodash-Clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCoderDream","download_url":"https://codeload.github.com/TheCoderDream/Lodash-Clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254071405,"owners_count":22009784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:29:20.842Z","updated_at":"2025-10-19T19:21:50.283Z","avatar_url":"https://github.com/TheCoderDream.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LODASH CLONE\n**This library is just for demonstration my coding skill and a utility that i use in my own projects.it is heavily inspired from Lodash Library, but entire implementation by me **\n\nUsing the library:\n\n**DOCS:**\n\n_Using Array **reduce**_\n```js\nArrMan.reduce([1, 2], function(sum, n) {\n  return sum + n;\n}, 0);\n// =\u003e 3\n \nArrMan.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n  (result[value] || (result[value] = [])).push(key);\n  return result;\n}, {});\n// =\u003e { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n```\n\n_Using Array **reduceRight**_\n```js\nvar array = [[0, 1], [2, 3], [4, 5]];\n \nArrMan.reduceRight(array, function(flattened, other) {\n  return flattened.concat(other);\n}, []);\n// =\u003e [4, 5, 2, 3, 0, 1]\n```\n\n_Using Array **forEach**_\n```js\nArrMan.forEach([1, 2], function(value) {\n  console.log(value);\n});\n// =\u003e Logs `1` then `2`.\n \nArrMan.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n  console.log(key);\n});\n```\n\n_Using Array **forEachRight**_\n```js\nArrMan.forEachRight([1, 2], function(value) {\n  console.log(value);\n});\n// =\u003e Logs `2` then `1`\n```\n\n_Using Array **map**_\n```js\nfunction square(n) {\n  return n * n;\n}\n \nArrMan.map([4, 8], square);\n// =\u003e [16, 64]\n \nArrMan.map({ 'a': 4, 'b': 8 }, square);\n// =\u003e [16, 64] (iteration order is not guaranteed)\n \nvar users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n \nArrMan.map(users, 'user');\n// =\u003e ['barney', 'fred']\n```\n\n_Using Array **filter**_\n```js\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n \nArrMan.filter(users, function(o) { return !o.active; });\n// =\u003e objects for ['fred']\n\nArrMan.filter(users, { 'age': 36, 'active': true });\n// =\u003e objects for ['barney']\n\nArrMan.filter(users, ['active', false]);\n// =\u003e objects for ['fred']\n\nArrMan.filter(users, 'active');\n// =\u003e objects for ['barney']\n```\n\n_Using Array **reject**_\n```js\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': false },\n  { 'user': 'fred',   'age': 40, 'active': true }\n];\n \nArrMan.reject(users, function(o) { return !o.active; });\n// =\u003e objects for ['fred']\n\nArrMan.reject(users, { 'age': 40, 'active': true });\n// =\u003e objects for ['barney']\n\nArrMan.reject(users, ['active', false]);\n// =\u003e objects for ['fred']\n\nArrMan.reject(users, 'active');\n// =\u003e objects for ['barney']\n```\n\n_Using Array **find**_\n```js\nvar users = [\n  { 'user': 'barney',  'age': 36, 'active': true },\n  { 'user': 'fred',    'age': 40, 'active': false },\n  { 'user': 'pebbles', 'age': 1,  'active': true }\n];\n \nArrMan.find(users, function(o) { return o.age \u003c 40; });\n// =\u003e object for 'barney'\n\nArrMan.find(users, { 'age': 1, 'active': true });\n// =\u003e object for 'pebbles'\n\nArrMan.find(users, ['active', false]);\n// =\u003e object for 'fred'\n\nArrMan.find(users, 'active');\n// =\u003e object for 'barney'\n```\n\n_Using Array **every**_\n```js\nArrMan.every([true, 1, null, 'yes'], Boolean);\n// =\u003e false\n \nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': false },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n \n\nArrMan.every(users, { 'user': 'barney', 'active': false });\n// =\u003e false\n \nArrMan.every(users, ['active', false]);\n// =\u003e true\n \nArrMan.every(users, 'active');\n// =\u003e false\n```\n\n_Using Array **some**_\n```js\n_.some([null, 0, 'yes', false], Boolean);\n// =\u003e true\n \nvar users = [\n  { 'user': 'barney', 'active': true },\n  { 'user': 'fred',   'active': false }\n];\n \nArrMan.some(users, { 'user': 'barney', 'active': false });\n// =\u003e false\n \nArrMan.some(users, ['active', false]);\n// =\u003e true\n \n// The `ArrMan.property` iteratee shorthand.\nArrMan.some(users, 'active');\n// =\u003e true\n```\n\n_Using Array **sample**_\n```js\nArrMan.sample([1, 2, 3, 4]);\n// =\u003e 2\n```\n\n_Using Array **sampleSize**_\n```js\nArrMan.sampleSize([1, 2, 3], 2);\n// =\u003e [3, 1]\n \nArrMan.sampleSize([1, 2, 3], 4);\n// =\u003e [2, 3, 1]\n```\n\n_Using Array **shuffle**_\n```js\nArrMan.shuffle([1, 2, 3, 4]);\n// =\u003e [4, 1, 3, 2]\n```\n\n_Using Array **shuffle**_\n```js\nArrMan.shuffle([1, 2, 3, 4]);\n// =\u003e [4, 1, 3, 2]\n```\n\n_Using Array **reverse**_\n```js\nArrMan.size([1, 2, 3]);\n// =\u003e 3\n \nArrMan.size({ 'a': 1, 'b': 2 });\n// =\u003e 2\n \nArrMan.size('pebbles');\n// =\u003e 7\n```\n\n_Using Array **take**_\n```js\nArrMan.take([1, 2, 3]);\n// =\u003e [1]\n \nArrMan.take([1, 2, 3], 2);\n// =\u003e [1, 2]\n \nArrMan.take([1, 2, 3], 5);\n// =\u003e [1, 2, 3]\n \nArrMan.take([1, 2, 3], 0);\n// =\u003e []\n```\n\n_Using Array **takeRight**_\n```js\nArrMan.takeRight([1, 2, 3]);\n// =\u003e [3]\n \nArrMan.takeRight([1, 2, 3], 2);\n// =\u003e [2, 3]\n \nArrMan.takeRight([1, 2, 3], 5);\n// =\u003e [1, 2, 3]\n \nArrMan.takeRight([1, 2, 3], 0);\n// =\u003e []\n```\n\n_Using Array **union**_\n```js\nArrMan.union([2], [1, 2]);\n// =\u003e [2, 1]\n```\n\n_Using Array **Chunk**_\n```js\nArrMan.chunk(['a', 'b', 'c', 'd'], 2);\n// =\u003e [['a', 'b'], ['c', 'd']]\n \nArrMan.chunk(['a', 'b', 'c', 'd'], 3);\n// =\u003e [['a', 'b', 'c'], ['d']]\n```\n\n_Using Array **Compact**_\n```js\nArrMan.compact([0, 1, false, 2, '', 3]);\n// =\u003e [1, 2, 3]\n```\n\n_Using Array **Concat**_\n```js\nconst array = [1];\nArrMan.concat(array, 2, [3], [[4]]);\nconsole.log(other);\n// =\u003e [1, 2, 3, [4]]\n \nconsole.log(array);\n// =\u003e [1]\n```\n\n_Using Array **difference**_\n```js\nconst array = [1];\nArrMan.difference([2, 1], [2, 3]);\n// =\u003e [1]\n```\n\n_Using Array **Drop**_\n```js\nArrMan.drop([1, 2, 3]);\n// =\u003e [2, 3]\n \nArrMan.drop([1, 2, 3], 2);\n// =\u003e [3]\n \nArrMan.drop([1, 2, 3], 5);\n// =\u003e []\n \nArrMan.drop([1, 2, 3], 0);\n// =\u003e [1, 2, 3]\n```\n\n_Using Array **DropRight**_\n```js\nArrMan.dropRight([1, 2, 3]);\n// =\u003e [1, 2]\n \nArrMan.dropRight([1, 2, 3], 2);\n// =\u003e [1]\n \nArrMan.dropRight([1, 2, 3], 5);\n// =\u003e []\n \nArrMan.dropRight([1, 2, 3], 0);\n// =\u003e [1, 2, 3]\n```\n\n_Using Array **Fill**_\n```js\nvar array = [1, 2, 3];\n \nArrMan.fill(array, 'a');\nconsole.log(array);\n// =\u003e ['a', 'a', 'a']\n \nArrMan.fill(Array(3), 2);\n// =\u003e [2, 2, 2]\n \nArrMan.fill([4, 6, 8, 10], '*', 1, 3);\n// =\u003e [4, '*', '*', 10]\n```\n\n_Using Array **fromPairsToObject**_\n```js\nArrMan.fromPairsToObject([['a', 1], ['b', 2]]);\n// =\u003e { 'a': 1, 'b': 2 }\n```\n\n_Using Array **Head**_\n```js\nArrMan.head([1, 2, 3]);\n// =\u003e 1\n \nArrMan.head([]);\n// =\u003e undefined\n```\n\n_Using Array **IndexOf**_\n```js\nArrMan.indexOf([1, 2, 1, 2], 2);\n// =\u003e 1\n \n// Search from the `fromIndex`.\nArrMan.indexOf([1, 2, 1, 2], 2, 2);\n// =\u003e 3\n```\n\n_Using Array **Initial**_\n```js\nArrMan.initial([1, 2, 3]);\n// =\u003e [1, 2]\n```\n\n_Using Array **Intersection**_\n```js\nArrMan.intersection([2, 1], [2, 3]);\n// =\u003e [2]\n```\n\n_Using Array **Join**_\n```js\nArrMan.join(['a', 'b', 'c'], '~');\n// =\u003e 'a~b~c'\n```\n\n_Using Array **Last**_\n```js\nArrMan.last([1, 2, 3]);\n// =\u003e 3\n```\n\n_Using Array **LastIndexOf**_\n```js\nArrMan.lastIndexOf([1, 2, 1, 2], 2);\n// =\u003e 3\n \n// Search from the `fromIndex`.\nArrMan.lastIndexOf([1, 2, 1, 2], 2, 2);\n// =\u003e 1\n```\n\n_Using Array **Pull**_\n```js\nconst array = ['a', 'b', 'c', 'a', 'b', 'c'];\n \nArrMan.pull(array, 'a', 'c');\nconsole.log(array);\n// =\u003e ['b', 'b']\n```\n\n_Using Array **PullInTheSameArray**_\n```js\n// Note that it returns array itself, instead of creating new one.\nconst array = ['a', 'b', 'c', 'a', 'b', 'c'];\n \nArrMan.pullInTheSameArr(array, 'a', 'c');\nconsole.log(array);\n// =\u003e ['b', 'b']\n```\n\n_Using Array **PullAll**_\n```js\nconst array = ['a', 'b', 'c', 'a', 'b', 'c'];\n \nArrMan.pullAll(array, ['a', 'c']);\nconsole.log(array);\n// =\u003e ['b', 'b']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoderdream%2Flodash-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecoderdream%2Flodash-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoderdream%2Flodash-clone/lists"}