@mickey.abraham/lotide
v1.0.0
Published
Will need mocha and chai to run tests
Downloads
1
Readme
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 @mickey.abraham/lotide
Require it:
const _ = require('mickey.abraham/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 array.function2(tail)
: returns every element in an array except the first.function3(middle)
: returns every element in an array except the first & last.function4(assertArraysEqual)
: an assertion test to test if two arrays are the exact same.function5(eqArrays)
: checks to see if two arrays have the exact same length and elements.function6(assertEqual)
: an assertion test to test if the actual output and expected output of a function are the same.function7(assertObjectsEqual)
: an assertion test to test if two objects are the exact same.function8(countLetters)
: returns the amount of times a letter appears in a word.function9(eqObjects)
: tests to see if the keys in two objects are the same.function10(countOnly)
: returns how many times one element appears in array.function11(findKey)
: returns the first key in an object that holds a searched value.function12(letterPositions)
: returns the indexs of each letter in a inputed word in an object.function13(findKeyByValue)
: takes in an object and value, which will then be scanned and return the key that holds said value.function14(map)
: returns a new array based of the results of the callback function.function15(takeUntil)
: returns a new array which will hold all the elements in the inputed array until the callback function is truthy.function16(without)
: returns a new array that will hold elements from an inputed array without unwanted elements.