{"_id":"@andrewli12138/lotide","_rev":"4-3c790edefc64ea3f6396182c9eff7e9d","name":"@andrewli12138/lotide","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@andrewli12138/lotide","version":"1.0.0","description":"this is a student project for building a mini library to mimic Lodash","main":"assertArraysEqual.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"license":"ISC","bugs":{"url":"https://github.com/Andrew-Li-12138/lotide/issues"},"homepage":"https://github.com/Andrew-Li-12138/lotide#readme","devDependencies":{"chai":"^4.3.7","mocha":"^9.2.2"},"gitHead":"90f88b84adffa5aa6da66ecc22eab9161a295800","_id":"@andrewli12138/lotide@1.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-VuxsYK/BoZ6EAPHviZBjDxiWsHvCqaovou80R7Fr9GhdJR3XuQp+yDpy3q0l17LoioXs7r+D8VhSv+efEzrVnA==","shasum":"49c0dbccd80c12de79369981669ddd5603d7210c","tarball":"https://registry.npmjs.org/@andrewli12138/lotide/-/lotide-1.0.0.tgz","fileCount":26,"unpackedSize":23996,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBT5+3x2KfgbHMkCDxNir43DSya3LenQs5mXTE0kmp1xAiEAsU7BysOL1hwZ0uCmL3mJV1IpIoV5xHiw6gXb5Ga+eQ0="}]},"_npmUser":{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.0_1686020614170_0.5968705110842998"},"_hasShrinkwrap":false},"1.0.1":{"name":"@andrewli12138/lotide","version":"1.0.1","description":"this is a student project for building a mini library to mimic Lodash","main":"assertArraysEqual.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"license":"ISC","bugs":{"url":"https://github.com/Andrew-Li-12138/lotide/issues"},"homepage":"https://github.com/Andrew-Li-12138/lotide#readme","devDependencies":{"chai":"^4.3.7","mocha":"^9.2.2"},"gitHead":"f050c2ad7a0a03f90d2d4c13bde94d737a7705a6","_id":"@andrewli12138/lotide@1.0.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-FYMVhsvzPOyzo58gqsPjYXEpJI1/mj3pb0nKFIR7l5iTyMz5BcTnGO4bcMghK+O3cax4mMvZ5ApQNczUxcIV9g==","shasum":"135387aee029c1f837917bc8cbfd3124c4700e3d","tarball":"https://registry.npmjs.org/@andrewli12138/lotide/-/lotide-1.0.1.tgz","fileCount":37,"unpackedSize":23649,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHd9YbWwmVYzZR9M/45LIKSIZIGsP47c73ve8FG+ZwiAIgErplL5N2bPSfWlgvk0gq52NSWUJYoBigl0mobGRR7Pw="}]},"_npmUser":{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.1_1686082958485_0.7290897030996419"},"_hasShrinkwrap":false},"1.0.2":{"name":"@andrewli12138/lotide","version":"1.0.2","description":"this is a student project for building a mini library to mimic Lodash","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"license":"ISC","bugs":{"url":"https://github.com/Andrew-Li-12138/lotide/issues"},"homepage":"https://github.com/Andrew-Li-12138/lotide#readme","devDependencies":{"chai":"^4.3.7","mocha":"^9.2.2"},"gitHead":"bdb9ed42a415e8242bbc13782df9ceef294afb6a","_id":"@andrewli12138/lotide@1.0.2","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-vJRKGiNxJ7wpKhs8PTHnjCHyCnk49UkU+axwU9ROxG9wjsSdAPPQaSQpZj2h5fnFi0OlovS5h00Ddy+s4i23jg==","shasum":"91ed20a6a2519de0d2941d583f5696fec467fab1","tarball":"https://registry.npmjs.org/@andrewli12138/lotide/-/lotide-1.0.2.tgz","fileCount":37,"unpackedSize":29260,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC3CIZvBuGEo94sRQ9a6b3ATstUJZ3bv0rwfIusswAHBAiEA1OzN5ba6OYx3uL0C293LO1oTZpZGqMMlhswg0YPiHkY="}]},"_npmUser":{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.2_1686172334869_0.40258741110265794"},"_hasShrinkwrap":false},"1.0.3":{"name":"@andrewli12138/lotide","version":"1.0.3","description":"this is a student project for building a mini library to mimic Lodash","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"license":"ISC","bugs":{"url":"https://github.com/Andrew-Li-12138/lotide/issues"},"homepage":"https://github.com/Andrew-Li-12138/lotide#readme","devDependencies":{"chai":"^4.3.7","mocha":"^9.2.2"},"gitHead":"713376597cdb9e43fe7aa134525fdd8d08eafec2","_id":"@andrewli12138/lotide@1.0.3","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-X0Iu4bGtsN6sAJLCsgTazU7L38n1ldT20MTxvtwrbB4HfChScm1YhT5lJUbZSY6J1G/TEFkmO0K4xnqNT4PNfg==","shasum":"fac95a209f502524132e8bd3ec74bfac9986f84c","tarball":"https://registry.npmjs.org/@andrewli12138/lotide/-/lotide-1.0.3.tgz","fileCount":37,"unpackedSize":29260,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIDoYxOK45oEn9v7BHNrqHGZudrYXFwQUrkJvZU6qonAiEAga6rsQ+Ag53zbmZGeIBvUaM3IoRrqRubsZ7Vvw59JdA="}]},"_npmUser":{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.3_1686187223100_0.2919869365847618"},"_hasShrinkwrap":false},"1.0.4":{"name":"@andrewli12138/lotide","version":"1.0.4","description":"this is a student project for building a mini library to mimic Lodash","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"license":"ISC","bugs":{"url":"https://github.com/Andrew-Li-12138/lotide/issues"},"homepage":"https://github.com/Andrew-Li-12138/lotide#readme","devDependencies":{"chai":"^4.3.7","mocha":"^9.2.2"},"gitHead":"5987dbd64a7778479892c52561373fd0261ffdb4","_id":"@andrewli12138/lotide@1.0.4","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-oppEWLr+LfjNYLzrcv4+MXX5PfrbDZgSlsc0sMLfCrxju7rkzlkUlwddlQFYpnWs/WoVxbePipNdK1j0sD/1UA==","shasum":"07784e2540e4066458c811e9d0b64d82211829e6","tarball":"https://registry.npmjs.org/@andrewli12138/lotide/-/lotide-1.0.4.tgz","fileCount":37,"unpackedSize":29259,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFWRBbvlxYp5ukMhrbeJRcvrdFTqF9zl5Ph8nBZ1UfCAiEAi+Q91iU7i84J483yNMxV+remYdJrmX47nXEFbp/vw9U="}]},"_npmUser":{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.4_1686187785563_0.1645381255486893"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-06T03:03:34.120Z","1.0.0":"2023-06-06T03:03:34.321Z","modified":"2023-06-08T01:29:45.887Z","1.0.1":"2023-06-06T20:22:38.651Z","1.0.2":"2023-06-07T21:12:15.058Z","1.0.3":"2023-06-08T01:20:23.294Z","1.0.4":"2023-06-08T01:29:45.773Z"},"maintainers":[{"name":"andrewli12138","email":"andrew.li.12138@gmail.com"}],"description":"this is a student project for building a mini library to mimic Lodash","homepage":"https://github.com/Andrew-Li-12138/lotide#readme","repository":{"type":"git","url":"git+https://github.com/Andrew-Li-12138/lotide.git"},"author":{"name":"Andrew Li"},"bugs":{"url":"https://github.com/Andrew-Li-12138/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 @andrewli12138/lotide`\n\n**Require it:**\n\n`const _ = require('@andrewli12138/lotide');`\n\n**Call it:**\n\n`const results = _.tail([1, 2, 3]) // => [2, 3]`\n\n## Documentation\n\n## Available Functions\nThe following functions are currently implemented:\n\n* head(...): retrieve the first element from the array\n* tail(...): retrieve every element except the head (first element) of the array\n* middle(...): return an array with only the middle element(s) of the provided array. For arrays with odd number of elements, an array containing a single middle element should be returned. For arrays with an even number of elements, an array containing the two elements in the middle should be returned\n* assertArraysEqual(...):compare arrays and prints out a colourful successful or failure message including easy to read emojis \n* assertEqual(...): compares two primative values and prints out a colourful successful or failure message including easy to read emojis\n* assertObjectsEqual(...): compare objects and prints out a colourful successful or failure message including easy to read emojis \n* countLetters(...): take in a sentence (as a string) and then return a count of each of the letters in that sentence\n* countOnly(...): take in a collection of items and return counts for a specific subset of those items\n* eqArrays(...):compare arrays and return true when it's equal and false when it's not\n* eqObjects(...): compare objects and return true when they are equal, false when they are not\n* findKey(...): takes in an object and a callback. It should scan the object and return the first key for which the callback returns a truthy value. If no key is found, then it should return undefined.\n* findKeyByValue(...): search for a key on an object where its value matches a given value\n* flatten(...): given an array with other arrays inside, it can flatten it into a single-level array\n* letterPositions(...): take in a sentence (as a string) and return all the indices (zero-based positions) in the string where each character is\n* map(...): take in an array to map, a callback, return a new array based on the results of the callback function\n* takeUntil(...): take an array and callback function, return a slice of the array with elements taken from the beginning, keep going until the callback returns a truthy value\n* without(...): take in a source array and a itemsToRemove array, return a new array with only those elements from source that are not present in the itemsToRemove array\n\n## Usage\n\nHere are some examples of how to use the functions:\n\n### function head(...)\n\nconst arr = [1, 2, 3, 4, 5];\nconsole.log(head(arr)); // Output: 1\n\n### function tail(...)\n\nconst arr = [1, 2, 3, 4, 5];\nconsole.log(tail(arr)); // Output: [2, 3, 4, 5]\n\n### function middle(...)\n\nconst arr1 = [1, 2, 3];\nconsole.log(middle(arr1)); // Output: [2]\n\nconst arr2 = [1, 2, 3, 4];\nconsole.log(middle(arr2)); // Output: [2, 3]\n\nconst arr3 = [1, 2];\nconsole.log(middle(arr3)); // Output: []\n\nconst arr4 = [1];\nconsole.log(middle(arr4)); // Output: []\n\n### assertArraysEqual(...)\n\nconst arr1 = [1, 2, 3];\nconst arr2 = [1, 2, 3];\nassertArraysEqual(arr1, arr2); // Output: ✅✅ Assertion Passed: [ 1, 2, 3 ] === [ 1, 2, 3 ]\n\nconst arr3 = [1, 2, 3];\nconst arr4 = [1, 2, 4];\nassertArraysEqual(arr3, arr4); // Output: ❌❌ Assertion Failed: [ 1, 2, 3 ] !== [ 1, 2, 4 ]\n\n### assertEqual(...)\n\nassertEqual(5, 5); // Output: ✅✅ Assertion Passed: 5 === 5\n\nassertEqual(5, 10); // Output: ❌❌ Assertion Failed: 5 !== 10\n\n### assertObjectsEqual(...)\n\nconst obj1 = { name: 'John', age: 30 };\nconst obj2 = { name: 'John', age: 30 };\nassertObjectsEqual(obj1, obj2); // Output:  ✅✅ Assertion Passed: { name: 'John', age: 30 } === { name: 'John', age: 30 }\n\nconst obj3 = { name: 'John', age: 30 };\nconst obj4 = { name: 'John', age: 25 };\nassertObjectsEqual(obj3, obj4); // Output: ❌❌ Assertion Failed: { name: 'John', age: 30 } !== { name: 'John', age: 25 }\n\n### countLetters(...)\n\nconst sentence = 'Hello World';\nconsole.log(countLetters(sentence));\n// Output: { H: 1, e: 1, l: 3, o: 2, W: 1, r: 1, d: 1 }\n\n### countOnly(...)\nconst allItems = ['apple', 'banana', 'cherry', 'apple', 'banana'];\nconst itemsToCount = { apple: true, cherry: true };\nconsole.log(countOnly(allItems, itemsToCount));\n// Output: { apple: 2, cherry: 1 }\n\n### eqArrays(...)\nconst arr1 = [1, 2, 3];\nconst arr2 = [1, 2, 3];\nconsole.log(eqArrays(arr1, arr2)); // Output: true\n\nconst arr3 = [1, 2, 3];\nconst arr4 = [1, 2, 4];\nconsole.log(eqArrays(arr3, arr4)); // Output: false\n\n### eqObjects(...)\nconst obj1 = { name: 'John', age: 30 };\nconst obj2 = { name: 'John', age: 30 };\nconsole.log(eqObjects(obj1, obj2)); // Output: true\n\nconst obj3 = { name: 'John', age: 30 };\nconst obj4 = { name: 'John', age: 25 };\nconsole.log(eqObjects(obj3, obj4)); // Output: false\n\n### findKey(...)\nconst obj = {\n  key1: 'value1',\n  key2: 'value2',\n  key3: 'value3',\n  key4: 'value4'\n};\n\nconst result = findKey(obj, (value) => value === 'value3');\nconsole.log(result); // Output: key3\n\n### findKeyByValue(...)\n\nconst obj = {\n  key1: 'value1',\n  key2: 'value2',\n  key3: 'value3',\n  key4: 'value4'\n};\n\nconst result = findKeyByValue(obj, 'value3');\nconsole.log(result); // Output: key3\n\n### flatten(...)\n\nconst nestedArray = [1, [2, 3], [4, 5], 6];\nconsole.log(flatten(nestedArray)); // Output: [1, 2, 3, 4, 5, 6]\n\n### letterPositions(...)\n\nconst sentence = 'hello';\nconsole.log(letterPositions(sentence));\n// Output: { h: [0], e: [1], l: [2, 3], o: [4] }\n\n### map(...) //Lotide Version\n\nconst arr = [1, 2, 3];\nconst result = map(arr, (num) => num * 2);\nconsole.log(result); // Output: [2, 4, 6]\n\n### takeUntil(...)\n\nconst arr = [1, 2, 3, 4, 5];\nconst result = takeUntil(arr, (num) => num === 3);\nconsole.log(result); // Output: [1, 2]\n\n### without(...)\n\nconst source = [1, 2, 3, 4, 5];\nconst itemsToRemove = [2, 4];\nconst result = without(source, itemsToRemove);\nconsole.log(result); // Output: [1, 3, 5]\n\n\n\n\n\n","readmeFilename":"README.md"}