@ajama12/lotide
v1.0.0
Published
Lotide assignment for LHL
Downloads
3
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('@ajama12/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual
: Checks if 2 values are equalassertArraysEqual
: Checks if 2 arrays are equalassertObjectsEqual
: Checks if 2 objects are equalhead
: Returns first element in arraytail
: Returns array without the first elementmiddle
: Returns element(s) in the middle of the arraywithout
: Returns subset of a given array, removes unwanted elementsflatten
: Takes array with nested arrays and returns a single flattened arraycountLetters
: Returns counts of each character within a given stringletterPositions
: Returns the position that each character of a string is incountOnly
: Returns count of specific subset of itemseqArrays
: Checks if 2 arrays are equaleqObjects
: Checks if objects are identicalfindKey
: Returns the first key that the callback function returns a truthy value forfindKeyByValue
: Returns first key with a specific valuemap
: Returns array based on result of callback functiontakeUntil
: Takes a slice from the beginning of array