1.0.0 • Published 3 years ago
@oluwasegun-idowu/lotide v1.0.0
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 @oluwasegun-idowu/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...): description => returns the first element of an array. 1,2,3,4 will always return 1middle(...): description => returns the middle part of an array. 1,2,3,4 will return 3,4tail(...): description => returns the last part of an array. 1,2,3,4,5,6 will return 2,3,4,5,6eqArrays(...): description => compares two arrays to each other and return a booleaneqObjects(...): description => compares two objects and return a booleantakeUntil(...): description => returns the number of times it takes to get the first instance of an item(value)without(...): description => returns the elements of an array that is not in the other arrayfindKey(...): description => returns the result of the first occurence of an item in an objectFindKeyByValue(...): description => returns an item if it can be found in an objectcountOnly(...): description => counts the number of times elements of an item are found in the itemassertEqual(...): description => check whether an expected value is equal to the actual value. used for assertionassertArraysEqual(...): description => check whether two arrays are equalassertObjectsEqual(...): description => chwecks whether two objects are equalcountLetters(...): description => count number of times letters in a string occurs
1.0.0
3 years ago