{"_id":"@danilogondim/lotide","_rev":"4-b263ab9ca95b1fa214ebe3ad0bc5906b","name":"@danilogondim/lotide","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@danilogondim/lotide","version":"1.0.0","description":"A mini clone of the Lodash library made and published for learning purposes","main":"assertArraysEqual.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/danilogondim/lotide.git"},"keywords":[],"author":{"name":"Danilo Gondim","email":"daniloencarnacao@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/danilogondim/lotide/issues"},"homepage":"https://github.com/danilogondim/lotide#readme","devDependencies":{"chai":"^4.2.0","mocha":"^8.1.1"},"gitHead":"33af7ab7d2680afcbf4df587c3c0511c3cf1984b","_id":"@danilogondim/lotide@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-doHgKuuBVGTu6boWR5V/dzE4jn004hs0IFGJJeUxB/t//Q3s+TepOR7FrYh4SblBxKXfDbWUcDBxrIUPIYo/Wg==","shasum":"08b0c6cb843252f976d97bbd46426cf312c7f382","tarball":"https://registry.npmjs.org/@danilogondim/lotide/-/lotide-1.0.0.tgz","fileCount":29,"unpackedSize":27606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfREk3CRA9TVsSAnZWagAAJ4QP/j2YyJtpV2WGc5xvcOmu\nT/SfXiRgq3W6oeOK/33IRuni5YHsH3lYR3ILq87iettFPqZ0brdjEKigqKoZ\nI1yi2NmAJoJZxz55odBwjFME9ktnh9loGE7itYrPJebvpBVG9W7PkZZOJHAu\npBGUIlhhL00W4wIzi4PV/B0Ji5iQclbikvR6x3jL6lse3X4YhP0U9K+lLkSn\npRMHd14uGTBIAXfYkqM7U+NL56sBahQo90CIrJ+b4bw41bkRLT7PUY5r0Wbi\n9NFn9/vyQeFHO3iGiLcnq3sQ7Tgo+b0bnLUSXhepyYthSGtQidca8bgBBkfy\nHA2+yclsS1Lm18Z63b+9/+o4CEGXly14/01IumpOg9gtGKE9aH2z7exYsQv1\ngqZKlfQgtKY0jtrH7NrDdh+BtVXszbq0mZNi9ps5XoU3K9nxw4mcM1LT9CEq\nEifRajkwIQApWMUdGpsLeT0uMWdki4idRBzDt+mnvGYmeGjWiwug3B07ssh0\nC3tR+/qIM1lTSngrxiTXVpPb8tsVdjFitw4QU5OOjjmslHGZjSVKSnIooJsR\nuf+JMPUe4Eh247o88QN8pFpaLz8MkR93y0Yz9jPI81S+29degvqVF4ZNto3z\nuOL8zzz3JhCI76a3UzmLe8CeyMMpB8fY6zB2SLorLuypboHLAo7nfcg/micY\n2WbX\r\n=YP4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMBywau6ELrocON3fK8rjv3sSkckNul567F0xcD1ZIkAiEA7AEyn+WEv1CYM8TX8ZFuRMkwvaMWHKoxoN0Sw53Eg2Q="}]},"maintainers":[{"name":"danilogondim","email":"daniloencarnacao@gmail.com"}],"_npmUser":{"name":"danilogondim","email":"daniloencarnacao@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.0_1598310711254_0.15826506390587625"},"_hasShrinkwrap":false},"1.0.1":{"name":"@danilogondim/lotide","version":"1.0.1","description":"A mini clone of the Lodash library made and published for learning purposes","main":"","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/danilogondim/lotide.git"},"keywords":[],"author":{"name":"Danilo Gondim","email":"daniloencarnacao@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/danilogondim/lotide/issues"},"homepage":"https://github.com/danilogondim/lotide#readme","devDependencies":{"chai":"^4.2.0","mocha":"^8.1.1"},"gitHead":"4f2656d27f3c690690a4694681b70d4a1de3fb4f","_id":"@danilogondim/lotide@1.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-fvKO/7yzQYrwkJVMFXJsrzBLRPMnNzTKQ/Co9B10dJ/rrERP/36MSdCSbziUeU4pWWo4+E7ACkA29wJsvqYHjg==","shasum":"cc39b9773c212bf30203d6fb0c64f35981916268","tarball":"https://registry.npmjs.org/@danilogondim/lotide/-/lotide-1.0.1.tgz","fileCount":34,"unpackedSize":26342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRPzVCRA9TVsSAnZWagAA8i0P+wfUC2q6ss+gU8wCeSpw\nij5q4ql3PKN7A61r34hA/1GJnN82d0nukQABp27eYfmFVhJ6ZPHL4xtyO7cg\nozunlYerWEjBEVwAFNDJ2asnElt7yxG67Qduom3l0VQ3//9pBxhhI9Xeg+51\nbvcVA6icOpifSlJRybhKh5+4Ollx+195UMgQtCDzLV6aJTGnM6ebfK6EYFUr\nuzbu25Zn/2vEwnwEyirkBzvBNfjcaZcJguTABCjT/7DGYMI1TZM8tRfEHm9X\nunM2tgHH1bWH6dCK3DCmYKg4vOVqZtCHzoioCCPIs6plVIPFyrblqQrBDM8u\nwNtOsXkW4mr1WfbGctpm1wh9UPG/T3nHd/33CL/2jBKmjewLlvY9FweR8FjA\nT6GK9t9QZbngsHXsuuydkzmgAIOFUedo02+NmN0wb0AS2kyNPEzlJ7yEtYkb\nYJ8z+UNcDhfnPkCug7aSWY47Cr6L4DmPB6SnLFJQuBnqAIaYqVG5Zch8EGyt\njrMmYAy2OT/ytYKtN1ua7uXswdUqpSIBoPRCT02ndFDFIW/INHYRFdK0Mr2b\ntc7I1c1ZPrXQj4ME+kCN0KEXXFG5DR0q+7fNNqt8uDHSYlNSOC+JoHyHvpUC\naxUAlr7sAiN+YPnUBPUg4I6RD+do9nrgdQWf1J/WamtVnTxLafMyMey4NVel\nXT8+\r\n=wgxd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKfpejAuxUakbkooZ4HIMeJzyQIXPuyy6b2FuIahYvXQIgElkbAtEdnk7aAKKoVfcBwGHBMxKGClviDhozGPIBcq8="}]},"maintainers":[{"name":"danilogondim","email":"daniloencarnacao@gmail.com"}],"_npmUser":{"name":"danilogondim","email":"daniloencarnacao@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.1_1598356692998_0.05921511858365602"},"_hasShrinkwrap":false},"1.0.2":{"name":"@danilogondim/lotide","version":"1.0.2","description":"A mini clone of the Lodash library made and published for learning purposes","main":"","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/danilogondim/lotide.git"},"keywords":[],"author":{"name":"Danilo Gondim","email":"daniloencarnacao@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/danilogondim/lotide/issues"},"homepage":"https://github.com/danilogondim/lotide#readme","devDependencies":{"chai":"^4.2.0","mocha":"^8.1.1"},"gitHead":"5612d35c0f29d450448b87d20fed5dee961121b2","_id":"@danilogondim/lotide@1.0.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-d3ZOWvdMVVlaVl9pUlr1AjOPqdBWsPIgBwiLiuw3jWoApYfJPjBW2DP+4qM/ZE4RMPKJJvPEI1bz3JOz9+IRuQ==","shasum":"ffd1a36ea85c4f66eaee3bf935143214203425fa","tarball":"https://registry.npmjs.org/@danilogondim/lotide/-/lotide-1.0.2.tgz","fileCount":34,"unpackedSize":27675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSPeKCRA9TVsSAnZWagAA0bcP/33Y1Oyu2eubcQTsHLe1\nvvGlxPAnp1yT4fydzLTM2YXMGrVHX23ecFMG9Vff7WHRhj204alTUxTKaJWS\nJEbmp+mFYZzQYz+P0Zs18gaNJsjNrn8LORPuOwaoePgG2eYbk9MsDadnAD0r\n9SandyDKZgNP62mtYn4H1RJPGnA0O/DaccnMaD6A44LKu09KBL17v8QXBF3O\nqQe1ttpTNcFJKe728NGya4IUhOZw+QhwVsv0cab2c+O/scOFVKO4mdjtqD8E\nvVQ7GrFS/j8n+Y0qMa2NT67Jf1GBYrJPDyy8825GZnTCsU4/trTGh5Mv7nkk\nORM6NNAW6g8ej3nGbhdC5QnoIu0ALPcaarx3Y9OgQZznYxFiQwUHF9LiekOm\nv7E/IdE+GpfXJr2Td3hybB6+PL9IAnZD+AntKPhRDjzEJYrfJ23pK8+r9wKM\ndQLJT2eFbfUTeWli2t/egSO2p/LetnmqfY2RkjSwog/02TXepnPspnnq7kHd\nMY+tewf5aoxIaqVHdJUbQurjGoqXpVBQtHxCmgPl6/cFqVfvHV0+Ycu7czdQ\n5VIs0HvFJPNPrNwdEzqn+EaSDxnmUNPOKUHNEZOZR1yKYgKOWwU2+igqqtB2\nxgQ2/hqnFx6e9X4UJNk8i62kKn2nmN53+ovyhNKrmGgeGvRdpggwvSHRZJDT\nf+el\r\n=eBr0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrYpd4RBFMMMDdyhoKxqI2Dd372LV3D6E0bac825wgTAIhAIngFFtK4rG3C96J9b1CLPtNwGdFtnAx/UDopz5oV7NQ"}]},"maintainers":[{"name":"danilogondim","email":"daniloencarnacao@gmail.com"}],"_npmUser":{"name":"danilogondim","email":"daniloencarnacao@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.2_1598617482540_0.9867372741624485"},"_hasShrinkwrap":false},"1.0.3":{"name":"@danilogondim/lotide","version":"1.0.3","description":"A mini clone of the Lodash library made and published for learning purposes","main":"","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/danilogondim/lotide.git"},"keywords":[],"author":{"name":"Danilo Gondim","email":"daniloencarnacao@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/danilogondim/lotide/issues"},"homepage":"https://github.com/danilogondim/lotide#readme","devDependencies":{"chai":"^4.2.0","mocha":"^8.1.1"},"gitHead":"289524c9b02b5c053226e00bf3e6ceb7a08d61f3","_id":"@danilogondim/lotide@1.0.3","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HNHSqEWsJbhQq+74ReyHCL7Y2zocBTwP807z87EQ59O65XojtLoWahCnh53OERA7HJMNfRY41e43gG4P/0nQlg==","shasum":"b9bb6829cada9aacfd7e0dda02527c02689eb94f","tarball":"https://registry.npmjs.org/@danilogondim/lotide/-/lotide-1.0.3.tgz","fileCount":34,"unpackedSize":29438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSQTVCRA9TVsSAnZWagAAlWQQAKN1K9jv9tBSNgbo0G4G\nD8CftrI9LwhzkfASr9tPebKzQLIMBWkiwmTjHbmo3PPDj5v33/8Mz+JZIYXA\nAnjzZBL4HoU29eMX2fJTLdLnlp1AR3fy7rAVr+S8mvRvPU2+Hqv2NE8v1TkX\nEElADdOt+Tc52d736JjZh5qjvVwAeSTdgWukaTh02tYp3KA/DxHDJh9/UbKY\nkfq2ckZVxWmONaULIAZVmYjPpsGH3vDYR8hntIVjJOeIxIw5bHrg+nZMnBoA\nCxEA1eiZk9FnsfG+/57iYkh75+bw5zQgz52L9E/ft64X4EVmCyZ/KuELduTH\nOv4DhY3yOhljPArtc/Yn/HBrwghLfzm+pPUQx/5kIBvrLIf+73HquV4QFfgX\nyjPq6clGRlfL7qVfkC+UXk7wfSfEtSJtMFkh129tIld9CRqKxnmZMv96BcpL\nLfOXGXCI0pP//oSs+t5eF5AI+IXY7kY57cCaK7WGQf6Fd86HBZ3DrWEcPG8j\n7z+XlVG8mmnlyA8IL/a9LWnkqZHQ1TGCXjKfCV9h8z26fsMAmQ8qxk6ruR2D\nhskTgFAPa9CoyjAKaVli8ZNsQHmx631kySuSBuAQcM0H4NKlWGXmhEt5i94j\np4MDBcXX732iqfC7h1a+zjzHsSfwincXLXe3N2A2O5AISoeQ571sabWRJZiI\nNLAm\r\n=4fGM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrkD/cpjuRO/Lp2g7TvFvhLt4Yewm4SVL/Du7mM5NrmAiAj4hCF8uwcS16gfTWp4FKS/40PZNSOcI0cTcj90KzTlQ=="}]},"maintainers":[{"name":"danilogondim","email":"daniloencarnacao@gmail.com"}],"_npmUser":{"name":"danilogondim","email":"daniloencarnacao@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.3_1598620885300_0.6204040583447579"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-24T23:11:51.219Z","1.0.0":"2020-08-24T23:11:51.377Z","modified":"2022-04-05T02:41:44.518Z","1.0.1":"2020-08-25T11:58:13.083Z","1.0.2":"2020-08-28T12:24:42.651Z","1.0.3":"2020-08-28T13:21:25.407Z"},"maintainers":[{"name":"danilogondim","email":"daniloencarnacao@gmail.com"}],"description":"A mini clone of the Lodash library made and published for learning purposes","homepage":"https://github.com/danilogondim/lotide#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/danilogondim/lotide.git"},"author":{"name":"Danilo Gondim","email":"daniloencarnacao@gmail.com"},"bugs":{"url":"https://github.com/danilogondim/lotide/issues"},"license":"ISC","readme":"# Lotide\n\nA mini clone of the [Lodash](https://lodash.com) library.\n\n## Purpose\n\n**_BEWARE:_ This library was published for learning purposes. It is _not_ intended for use in production-grade software.**\n\nThis project was created and published by me as part of my learnings at Lighthouse Labs. \n\n## Usage\n\n**Install it:**\n\n`npm install @danilogondim/lotide`\n\n**Require it:**\n\n`const _ = require('@danilogondim/lotide');`\n\n**Call it:**\n\n`const results = _.tail([1, 2, 3]) // => [2, 3]`\n\n## Documentation\n\nThe following functions are currently implemented:\n\n* `assertArraysEqual()`: asserts whether two arrays are equal. Ex:\n```javascript\nassertArraysEqual([1, 2, 3], [1, 2, 3]);\n// => ✅✅✅ Assertion Passed: [ 1, 2, 3 ] === [ 1, 2, 3 ]\nassertArraysEqual([1, 2, 3, 4], [1, 2, 3]);\n// => ❌❌❌ Assertion Failed: [ 1, 2, 3, 4 ] !== [ 1, 2, 3 ]\n```\n* `assertEqual()`: asserts whether two primitive values are equal. Ex:\n```javascript\nassertEqual(\"dog\", \"dog\");\n// => ✅✅✅ Assertion Passed: dog === dog\nassertEqual(\"cat\", \"Cat\");\n// => ❌❌❌ Assertion Failed: cat !== Cat\n```\n* `assertObjectsEqual()`: asserts whether two objects are equal. Ex:\n```javascript\nassertObjectsEqual({ a: \"1\", b: \"2\" }, { b: \"2\", a: \"1\" });\n// => ✅✅✅ Assertion Passed: { a: '1', b: '2' } === { b: '2', a: '1' }\nassertObjectsEqual({ a: \"1\", b: \"2\" }, { a: \"1\", b: \"2\", c: \"3\" });\n// => ❌❌❌ Assertion Failed: { a: '1', b: '2' } !== { a: '1', b: '2', c: '3' }\n```\n* `countLetters()`: takes in a sentence (as a string) and returns a count of each of the letters in that sentence. The return value is an object. Ex: \n```javascript\ncountLetters(\"LHL\")); // => { L: 2, H: 1 }\n```\n* `countOnly()`: takes in a collection of items and returns counts for a specific subset of those items. Ex: \n```javascript\nconst firstNames = [\n      \"Karl\",\n      \"Salima\",\n      \"Fang\",\n      \"Jason\",\n      \"Salima\",\n      \"Fang\"\n    ];\ncountOnly(firstNames, { \"Jason\": true, \"Karima\": true, \"Fang\": true });\n// => { \"Jason\": 1, \"Fang\": 2 }\n```\n* `eqArrays()`: takes in two arrays and returns true or false, based on a perfect match. Ex:\n```javascript\nconsole.log(eqArrays([1, 2, 3], [1, 2, 3]));\n// => true\nconsole.log(eqArrays([1, 2, 3], [3, 2, 1]));\n// => false\n```\n* `eqObjects()`: returns true if both objects have identical keys with identical values. Otherwise, returns false. Ex:\n```javascript\nconst ab = { a: \"1\", b: \"2\" };\nconst ba = { b: \"2\", a: \"1\" };\nconst abc = { a: \"1\", b: \"2\", c: \"3\" };\neqObjects(ab, ba); // => true\neqObjects(ab, abc); // => false\n```\n* `findKey()`: takes in an object and a callback. It scans the object and return the first key for which the callback returns a truthy value. If no key is found, then it returns undefined.Ex:\n```javascript\nconst moviesAndSeries = {\n  \"sci_fi\": { movie: \"E.T the Extra-Terrestrial\", series: \"The 100\" },\n  \"comedy\": { movie: \"Game Night\", series: \"Brooklyn Nine-Nine\" },\n  \"drama\": { movie: \"A Star is Born\", series: \"Dark\" }\n};\nfindKey(moviesAndSeries, x => x.series === \"Dark\");\n// => \"drama\"\n};\nfindKey(moviesAndSeries, x => x.series === \"Lost\");\n// => undefined\n```\n* `findKeyByValue()`: takes in an object and a value. It scans the object and returns the first key which contains the given value. If no key with the given value is found, then it returns undefined. Ex:\n```javascript\nconst bestTVShowsByGenre = {\n  \"sci_fi\": \"The Expanse\",\n  \"comedy\": \"Brooklyn Nine-Nine\",\n  \"drama\": \"The Wire\"\n};\nfindKeyByValue(bestTVShowsByGenre, \"Brooklyn Nine-Nine\");\n// => \"comedy\"\nfindKeyByValue(bestTVShowsByGenre, \"That '70s Show\");\n// => undefined\n```\n* `flatten()`: takes in an array containing nested arrays, and returns a \"flattened\" version of the array. Ex:\n```javascript\nflatten([1, 2, [3, 4], 5, [6]]);\n// => [1, 2, 3, 4, 5, 6]);\n```\n* `head()`: returns the first element of a given array. Ex:\n```javascript\nhead(['Hello', 'Lighthouse', 'Labs']);\n// => 'Hello'\n```\n* `letterPositions()`: returns all the indices (zero-based positions) in the string where each character is found Ex:\n```javascript\nletterPositions(\"hello\");\n// => { h: [0], e: [1], l: [2, 3], o: [4] }\n```\n* `map()`: takes in an array to map and a callback function, and returns a new array based on the results of the callback function. Ex:\n```javascript\nconst words = [\"ground\", \"control\", \"to\", \"major\", \"tom\"];\nmap(words, word => word[0]);\n// => ['g', 'c', 't', 'm', 't']\nmap(words, word => word.length);\n// => [6, 7, 2, 5, 3]\n```\n* `middle()`: takes in an array and return the middle-most element(s) of the given array. Ex:\n```javascript\nmiddle([1, 2, 3, 4, 5]);\n// => [3]\nmiddle([1, 2, 3, 4]);\n// => [2, 3]\n```\n* `tail()`: returns all but the first element of a given array. Ex:\n```javascript\ntail([\"Hello\", \"Lighthouse\", \"Labs\"]);\n// => [\"Lighthouse\", \"Labs\"]\n```\n* `takeUntil()`: returns a slice of a given array with elements taken from the beginning until the callback function returns a truthy value. Ex:\n```javascript\nconst data1 = [1, 2, 5, 7, 2, -1, 2, 4, 5];\ntakeUntil(data1, x => x < 0);\n// => [1, 2, 5, 7, 2]\nconst data2 = [\"I've\", \"been\", \"to\", \"Hollywood\", \",\", \"I've\", \"been\", \"to\", \"Redwood\"];\ntakeUntil(data2, x => x === ',');\n// => ['I\\'ve', 'been', 'to', 'Hollywood']\n```\n* `without()`: takes in a source array and a itemsToRemove array, and returns a new array with only those elements from source that are not present in the itemsToRemove array. Ex:\n```javascript\nwithout([\"1\", \"2\", \"3\", undefined], [undefined]);\n// => [\"1\", \"2\", \"3\"]\nwithout([\"1 2 3\"], [\"1, 2, 3\"]);\n// => [\"1 2 3\"]\nwithout([\"1\", \"2\", \"3\", undefined, NaN], [NaN]);\n// => [\"1\", \"2\", \"3\", undefined]\n```","readmeFilename":"README.md"}