1.0.0 • Published 1 year ago
@cat_mitchell/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 @cat_mitchell/lotide
Require it:
const _ = require('@cat_mitchell/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: returns the first element in an arrayfunction2(tail)
: returns all the elements in an array except the firstfunction3(middle)
: takes in an array and returns the middle most elementsfunction4(assertArraysEqual)
: compares two arrays to see if they are the same and gives an assertion passed or assertion failesfunction5(assertEqual)
: compares actual and expected and prints out if assertion passed or failedfunction6(eqArrays)
: compares two arrays and returns a true or falsefunction7(assertObjectsEqual)
: will take in two objects and compare them and return an actual and expected resultfunction8(countLetters)
: takes in a sentence as a string and returns a count of each of the letters in that sentencefunction9(countOnly)
: takes in an array and an object and returns an object with the counts of everything the input object listedfunction10(eqObjets)
: compares two objects and returns a true or falsefunction11(findKeyByValue)
: takes in an object and a value and returns the first key which contains the given valuefunction12(letterPositions)
: returns all the indices in a string where each character is foundfunction13(map)
: returns a new array based on the callback functionfunction14(without)
: compares two arrays and returns a new array with only the elements from the first array that are not present in the secondfunction15(takeUntil)
: returns a slice of the array with element taken from the beginningfunction16(findKey)
: takes in an object and a callback, scans the object and returns the first key which returns a truthy value
1.0.0
1 year ago