@kyle.lindsay33/lotide
v1.0.3
Published
mini clone of the lodash library, published for learning purposes
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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(eqArrays)
: Asserts that two arrays are equalfunction2(assertArraysEqual)
: Asserts that two arrays are perfectly equal using eqArraysfunction4(eqObjects)
: Asserts that two objects are equalfunction5(assertObjectsEqual)
: Asserts that two objects are perfectly equal using eqObjectsfunction6(countLetters)
: Counts number of letters in a given stringfunction7(countOnly)
: Returns count of specified items from an array using an objectfunction8(findKey)
: Returns first key in an object that is truthyfunction9(findKeyByValue)
: Returns key matching inputted valuefunction10(flatten)
: Takes a multi-nested array and flattens it to a single arrayfunction11(head)
: Takes an array and returns first element of said arrayfunction12(letterPositions)
: checks indices of specified letter in a given stringfunction13(map)
: iterates over each element in an array and executes a callback function for each elementfunction14(middle)
: returns the middle element of an arrayfunction15(tail)
: returns the tail end of an array, skips the first indexfunction16(takeUntil)
: takes element from an array until a callback returns truthyfunction17(without)
: takes source and items to remove parameters, removing items from source that are also in items to remove