{"_id":"@emilyyimin/lotide","_rev":"5-369b6edda55187d75228bad50a73c5c8","name":"@emilyyimin/lotide","dist-tags":{"latest":"1.1.4"},"versions":{"1.0.0":{"name":"@emilyyimin/lotide","version":"1.0.0","description":"A mini clone of the [Lodash](https://lodash.com) library.","main":"assertArraysEqual.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"60b7854ce383f206508d0ed63e6723be8f02c426","_id":"@emilyyimin/lotide@1.0.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-8NfQj6Ya5JYYgpH7OYuTdex77PFiDrQ3MnCmrGcMT9OItWQPt2O0zScQJPTYAkKgW5NnvTfqNibeWZqX+rVUZw==","shasum":"7e566f8f5e16774e30ea4869adf89619486a21c3","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.0.0.tgz","fileCount":32,"unpackedSize":33326,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgd36KvJCYeaPYGdvyNe7hcIQIU9Cdzd+L5f1crlwZVQIgCpHFSBxhMbHppfcuEaFnc4zvaPueC0c1pfmRCveGKxM="}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.0_1684031725306_0.48389731536700387"},"_hasShrinkwrap":false},"1.0.1":{"name":"@emilyyimin/lotide","version":"1.0.1","description":"A mini clone of the [Lodash](https://lodash.com) library.","main":"assertArraysEqual.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"60b7854ce383f206508d0ed63e6723be8f02c426","_id":"@emilyyimin/lotide@1.0.1","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-97VoOvLDPBFhIJTtZtHUCvGM0D5CZaXwBdM9/5Q3AHXqMdniLtyY9/M8PUD+/eqNodK/yh+a+EntM+P7DuC27Q==","shasum":"29ee58cb39a42208fb10a60556944afc3c4a6f1e","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.0.1.tgz","fileCount":37,"unpackedSize":39615,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgqMAmCmnGst2h+SbKmOpM+TCGYHquTWVv0Zbpb5aqIAiEA/NwJbDSPjq6MVpsmPMZe9CZMv6gup5ctrasmXPXqd5c="}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.0.1_1684165836772_0.8672819266322735"},"_hasShrinkwrap":false},"1.1.1":{"name":"@emilyyimin/lotide","version":"1.1.1","description":"A lightweight JavaScript utility library.","main":"assertArraysEqual.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"9c766b4e79c9243709bf26770fcbddcc0f24161b","_id":"@emilyyimin/lotide@1.1.1","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UhTsCx+tbeTjXwQjkujy/HNpeU+HyWh4uteeBwGTEf3ve4uPH4FXGUqmMtkXW8yS+wCJl5d7s9drH2+NPXCjEA==","shasum":"2d823dff024f751280e8d531ec9456d0a8891e61","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.1.1.tgz","fileCount":38,"unpackedSize":47017,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCZ9ejwWzYkupEaVW+N2+j1/12cWDGKiuD//wJlMtfeQIhAOYWlDXM3Z0LWjhIyuBRuSZGKNmY4BL7ojIS/gBzNn+e"}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.1.1_1685067438982_0.6298934140158066"},"_hasShrinkwrap":false},"1.1.2":{"name":"@emilyyimin/lotide","version":"1.1.2","description":"A lightweight JavaScript utility library.","main":"assertArraysEqual.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"9c766b4e79c9243709bf26770fcbddcc0f24161b","_id":"@emilyyimin/lotide@1.1.2","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-O0db9pXJtiEY0Z2e49ThyZCjjBQc6owWnGvWIwXZxUWENouIp1lP6Li4Ld6kCrICdkALrBkO8yRgYACpKNN4yg==","shasum":"118972c7a8fe4f67b7e0b21cba90ed751e73cca6","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.1.2.tgz","fileCount":34,"unpackedSize":31730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZKbQNfM16F5ctDWO/lwkQtdmAV+6OgiKKOGC9IfOPpAiAYs0utv9iTGU6Hp7vvu3CcBMNGXQpdrojY7CHncSMhEA=="}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.1.2_1685313056898_0.8888256984451004"},"_hasShrinkwrap":false},"1.1.3":{"name":"@emilyyimin/lotide","version":"1.1.3","description":"A lightweight JavaScript utility library.","main":"index.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"9c766b4e79c9243709bf26770fcbddcc0f24161b","_id":"@emilyyimin/lotide@1.1.3","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-5aUOwu3kVBAB5/N/NWFWaaBE6VlgAaOT0f3TxbDXsRzpa4T28uu7N4JvPr6Icy0Tv4bvZ5vPEXHa9BLAQcYVUw==","shasum":"52060a4f3dddf1219bd2d9fbb956d78f0fdcfd81","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.1.3.tgz","fileCount":34,"unpackedSize":31718,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeEp9ys5RtV/YLDdjfqFI3/U2ZIosjwrLG5tmpWquv8wIhAMaRlsCGMh0+hiw9PCdhRdfii4jlAL6PHP5vMUN/Wk1N"}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.1.3_1685313807259_0.4602370541634153"},"_hasShrinkwrap":false},"1.1.4":{"name":"@emilyyimin/lotide","version":"1.1.4","description":"A lightweight JavaScript utility library.","main":"index.js","directories":{"test":"test"},"dependencies":{"chai":"^4.3.7"},"devDependencies":{"mocha":"^9.2.2"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"homepage":"https://github.com/yiminmin/lotide#readme","gitHead":"9c766b4e79c9243709bf26770fcbddcc0f24161b","_id":"@emilyyimin/lotide@1.1.4","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Es/XKtBIjz86i2po5V9lD0iF32DSRtxYsDawZfHwSdlF9torJfhPVc5cIp2wxxkQ59UH5k90JVZfBQyQs/ORcw==","shasum":"906ed3a1661d5f61c305b8e97e8964b99afbedab","tarball":"https://registry.npmjs.org/@emilyyimin/lotide/-/lotide-1.1.4.tgz","fileCount":35,"unpackedSize":34016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDhbACVft9ehRq7vrAZdn5Dvt0+/reGF5+oF7CBp8L6CAiEAkTbKvQ8Jg1KSND70TnjacfBPB8yyjwmH7b6I1AVbido="}]},"_npmUser":{"name":"emilyyimin","email":"emilyyimin@gmail.com"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotide_1.1.4_1685314301203_0.3230538660303828"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-14T02:35:25.240Z","1.0.0":"2023-05-14T02:35:25.460Z","modified":"2023-05-28T22:51:41.493Z","1.0.1":"2023-05-15T15:50:36.974Z","1.1.1":"2023-05-26T02:17:19.210Z","1.1.2":"2023-05-28T22:30:57.109Z","1.1.3":"2023-05-28T22:43:27.472Z","1.1.4":"2023-05-28T22:51:41.395Z"},"maintainers":[{"name":"emilyyimin","email":"emilyyimin@gmail.com"}],"description":"A lightweight JavaScript utility library.","homepage":"https://github.com/yiminmin/lotide#readme","repository":{"type":"git","url":"git+https://github.com/yiminmin/lotide.git"},"bugs":{"url":"https://github.com/yiminmin/lotide/issues"},"license":"ISC","readme":"# Lotide\n\nA lightweight JavaScript utility library.\n\n## Installation\n\n```bash\nnpm install --save @emilyyimin/lotide\n```\n\n## Require it\n\n```bash\nconst _ = require('@emilyyimin/lotide');\n```\n\n## Call it\n\n```bash\nconst result = _.head([1, 2, 3]); // result: 1\n```\n\n## API Reference\n\n### `assertEqual(actual, expected)`\n\nThis function takes two arguments - the actual value and the expected value - and compares them using strict equality (`===`). If the values are equal, it logs a message indicating that the assertion passed; otherwise, it logs a message indicating that the assertion failed.\n\n#### Usage\n\n```javascript\nconst { assertEqual } = require('lotide');\n\nassertEqual(1, 1); // logs: ✅✅✅Assertion Passed: 1 === 1\nassertEqual('test', 'notest'); // logs: 🛑🛑🛑Assertion Failed: test !== notest\n```\n\n### `head(array)`\n\nThis function takes an array as an argument and returns the first element of the array.\n\n#### Usage\n\n```javascript\nconst { head } = require('lotide');\n\nconsole.log(head([1, 2, 3])); // logs: 1\n```\n\n### `tail(array)`\n\nThis function takes an array as an argument and returns a new array that includes everything but the first element of the input array.\n\n#### Usage\n\n```javascript\nconst { tail } = require('lotide');\n\nconsole.log(tail([1, 2, 3])); // logs: [2, 3]\n```\n\n### `eqArrays(arr1, arr2)`\n\nThis function takes two arrays and checks if they are deeply equal, i.e., if they have the same length and identical elements at each index, including sub-arrays. If they are deeply equal, the function returns `true`; otherwise, it returns `false`.\n\n#### Usage\n\n```javascript\nconst { eqArrays } = require('lotide');\n\nconsole.log(eqArrays([1, 2, 3], [1, 2, 3])); // logs: true\nconsole.log(eqArrays([1, [2, 3]], [1, [2, 4]])); // logs: false\n```\n\n### `assertArraysEqual(arr1, arr2)`\n\nThis function takes two arrays and checks if they are deeply equal by using `eqArrays`. If they are equal, it logs a message indicating that the assertion passed; otherwise, it logs a message indicating that the assertion failed.\n\n#### Usage\n\n```javascript\nconst { assertArraysEqual } = require('lotide');\n\nassertArraysEqual([1, 2, 3], [1, 2, 3]); // logs: ✅ Assertion Passed: [1,2,3] === [1,2,3]\nassertArraysEqual([1, 2, 3], [1, 2, 4]); // logs: ❌ Assertion Failed: [1,2,3] !== [1,2,4]\n```\n\n### `without(source, itemsToRemove)`\n\nThis function takes a source array and an array of items to remove. It returns a new array which includes only the items from the source array that are not present in the itemsToRemove array.\n\n#### Usage\n\n```javascript\nconst { without } = require('lotide');\n\nconsole.log(without([1, 2, 3], [2])); // logs: [1, 3]\n```\n\n### `flatten(arr)`\n\nThis function takes a nested array (an array containing other arrays) and returns a new array with all the elements flattened.\n\n#### Usage\n\n```javascript\nconst { flatten } = require('lotide');\n\nconsole.log(flatten([1, [2, 3], 4])); // logs: [1, 2, 3, 4]\n```\n\n### `middle(array)`\n\nThis function takes an array and returns a new array containing the middle element(s) of the given array. If the length of the array is even, it returns two middle elements. If the length is odd, it returns one middle element. If the length of the array is less than 3, it returns an empty array.\n\n#### Usage\n\n```javascript\nconst { middle } = require('lotide');\n\nconsole.log(middle([1, 2, 3, 4])); // logs: [2, 3]\nconsole.log(middle([1, 2, 3, 4, 5])); // logs: [3]\n```\n\n### `countOnly(allItems, itemsToCount)`\n\nThis function takes an array of items and an object specifying which items should be counted. It returns an object containing counts of each item in the array that is present in the itemsToCount object with a truthy value.\n\n#### Usage\n\n```javascript\nconst { countOnly } = require('lotide');\n\nconsole.log(\n  countOnly(['apple', 'banana', 'apple', 'orange', 'banana'], {\n    apple: true,\n    banana: false,\n  })\n); // logs: { \"apple\": 2 }\n```\n\n### `letterPositions(sentence)`\n\nThis function takes a sentence (as a string) and returns an object. The keys of the object are the letters in the sentence, and the value for each key is an array of positions at which the letter appears in the sentence.\n\n#### Usage\n\n```javascript\nconst { letterPositions } = require('lotide');\n\nconsole.log(letterPositions('hello')); // logs: { h: [0], e: [1], l: [2, 3], o: [4] }\n```\n\n### `countLetters(sentence)`\n\nThis function takes a sentence (as a string) and returns an object. The keys of the object are the letters in the sentence, and the value for each key is the number of times the letter appears in the sentence.\n\n#### Usage\n\n```javascript\nconst { countLetters } = require('lotide');\n\nconsole.log(countLetters('hello')); // logs: { h: 1, e: 1, l: 2, o: 1 }\n```\n\n### `findKeyByValue(obj, value)`\n\nThis function takes an object and a value. It returns the first key in the object that corresponds to the given value. If no key corresponds to the given value, it returns undefined.\n\n#### Usage\n\n```javascript\nconst { findKeyByValue } = require('lotide');\n\nconsole.log(findKeyByValue({ a: 1, b: 2, c: 3 }, 2)); // logs: b\n```\n\nSure, let's extend the README.md file with descriptions of the new functions:\n\n````markdown\n## Functions\n\n### eqObjects\n\n`eqObjects` is a function to deeply compare two objects or arrays. It's useful for checking if two objects have the same keys and values.\n\n```javascript\nconst eqObjects = require('./eqObjects');\nlet result = eqObjects({ a: '1', b: 2 }, { b: 2, a: '1' }); // true\n```\n````\n\n### assertObjectsEqual\n\n`assertObjectsEqual` function takes in two objects and prints an appropriate message to the console indicating whether the objects are deeply equal.\n\n```javascript\nconst assertObjectsEqual = require('./assertObjectsEqual');\nassertObjectsEqual({ a: '1', b: 2 }, { b: 2, a: '1' }); // Prints: ✅✅✅ Assertion Passed: { a: '1', b: 2 } === { b: 2, a: '1' }\n```\n\n### map\n\n`map` function works just like `Array.prototype.map()`. It takes an array and a callback function as parameters, applies the callback function to each element of the array, and returns a new array with the results.\n\n```javascript\nconst map = require('./map');\nlet nums = [1, 2, 3, 4];\nlet squares = map(nums, (num) => num * num); // [1, 4, 9, 16]\n```\n\n### takeUntil\n\n`takeUntil` function creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns true. The predicate is invoked with two arguments: (value, index).\n\n```javascript\nconst takeUntil = require('./takeUntil');\nlet nums = [1, 2, 3, 4];\nlet lessThanThree = takeUntil(nums, (x) => x >= 3); // [1, 2]\n```\n\n### findKey\n\n`findKey` function returns the first key in the object that passes a truth test. If no key passes the test, it returns `undefined`.\n\n```javascript\nconst findKey = require('./findKey');\nlet obj = { a: 1, b: 2, c: 3 };\nlet key = findKey(obj, (x) => x > 2); // 'c'\n```\n\n```\n\nMake sure to replace the paths in the `require` statements with the actual paths to your files if they're different.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n```\n","readmeFilename":"README.md"}