1.1.0 • Published 3 years ago
@jcpenne/lotide v1.1.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 @jcpenne/lotide
Require it:
const _ = require('@jcpenne/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters
: iterates over a string to count each occurence of each letter.countOnly
: iterates over an array to count only the items specifiedeqArrays
: checks that two arrays are strictly equaleqObjects
: checks that two objects are strictly equalfindKey
: finds a given key of an objectfindKeyByValue
: finds a key with the given value in an objectflatten
: flattens an array with nested arrays within it to just one arrayhead
: slices the first element off of an arrayletterPositions
: finds all given positions of a specified letter within a given stringmap
: iterates over an array and performs a function for each element (manual .map function)middle
: returns the individual, or pair, middle values of an arraytail
: returns all BUT the first element of an arraytakeUntil
: slices an array at a specified point and returns all elements up to that pointwithout
: compares two arrays to determine if they are equal