1.0.0 • Published 3 years ago
@ejdokter/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 @ejdokter/lotide
Require it:
const _ = require('@ejdokter/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
: Compares two arrays and logs a pass or fail statementfunction2(assertEqual)
: compares an actual value and an expected value and logs a pass or fail statementfunction3(assertObjectsEqual)
: compares two objects and logs a pass or fail statementfunction1(countLetter)
: takes in a string and returns an object with how many times each letter appears in the stringfunction1(countOnly)
: function will take in a list from an array and an item to count in that array and return the amount of times that item appears in the arrayfunction1(eqArrays)
: eqArrays function that takes in 2 arrays and returns true or falsefunction1(eqObjects)
: compares two objects and returns true if they are the same and false if they are notfunction1(findKey)
: function that takes in an object and returns the key of the callback functionfunction1(findKeyByValue)
: function takes in an object and a value and returns the key that the value is located atfunction1(flatten)
: takes in an array and if there are multiple arrays inside the array it will take them out and return one array with all valuesfunction1(head)
: function that takes in an array and returns the first value of that arrayfunction1(letterPositions)
: function takes in a string and will return the index's of the letter defined at the endfunction1(map)
: takes in an array and a callback and executes the callback on the items in the arrayfunction1(middle)
: takes an array and returns the value in the centerfunction1(tail)
: takes an array and returns all but the first indexfunction1(takeUntil)
: function will take an array and a callback and will create a new array with everything before the callbackfunction1(without)
: function will produce a new array from the source with the itemsToRemove removed from it
1.0.0
3 years ago