1.0.1 • Published 3 years ago
@jchanpark/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 @jchanpark/lotide
Require it:
const _ = require('@jchanpark/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: To trim items off in an array except the first itemfunction2(tail)
: To trim the first item off in an arrayfunction3(middle)
: To retrieve an item(two items in an even array) in the middle in an arrayfunction4(eqArrays)
: To check an equality in their length and in each element between two arraysfunction5(assertEqual)
: To compare two parameters for their equalityfunction6(assertArraysEqual)
: To compare two arrays and assert their equalityfunction7(assertObjectsEqual)
: To check an equality between two objects and their elementsfunction8(countLetters)
: To count the number of letters in a stringfunction9(countOnly)
: To count specfic values only in an arrayfunction10(eqObjects)
: To check an equality between two objectsfunction11(findKey)
: To find elements in an objects according to a given callbackfunction12(findKeyByValue)
: To find keys in an object acoording to a valuefunction13(letterPositions)
: To assert if the index of a letter within a word equal to a specific indexfunction14(map)
: To manipulate an array based on a callbackfunction15(takeUntil)
: To take array elements until the a condition met by a callbackfunction16(without)
: To remove elements in an array from another array