1.0.1 • Published 4 years ago
@abdulmajeeds/lotide v1.0.1
Lotide
A mini clone of the Lodash library.
Purpose
BEWARE: This library was published for learning purposes. It is not intended for use in production-grade software.
This project was created and published by me as part of my learnings at Lighthouse Labs.
Usage
Install it:
npm install
Require it:
const _ = require('@abdulmajeeds/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(...): eqArrays are used in this function to check for a match between two arrays.assertEqual(...): Checks if 2 values are equal.assertObjectsEqual(...): Checks if 2 objects are equal.countLetters(...): A fucntions that returns the count of letters in a string.countOnly(...): A function that takes an array of names and an object of names to count. Returns a new object with the specified number of names.eqArrays(...): A function that compares two arrays and returns true or false depending on whether they are identical.eqObjects(...): A comparison function that compares two objects to check if they have the same keys and values.findKey(...): A function that takes an object and a callback as arguments and returns the first key for which the callback delivers a truthy value. It returns undefined if no key is discovered.findKeyByValue(...): It accepts an object and a value, and then returns the key for that value.head(...): The entry in the 0th index of the provided array is returned.lettersPosition(...): A function that takes a character string as input. After that, it returns an object containing an array for each character found.maps(...): iterates through an array and returns an array of callback values.middle(...): This function returns the array's middle element. Returns the two middle elements if the array length is even.tail(...): A function that returns an array without the first index itemtakeUntil(...): This function will continue to collect items from an array until the specified callback produces a true value.without(...): This function removes unnecessary elements from an array and returns a subset of it.