1.0.1 • Published 3 years ago
@jhein1892/lotide v1.0.1
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 @jhein1892/lotide
Require it:
const _ = require('@jhein1892/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: will find the value at index 0tail
: Will return values for everything but index 0middle
: Will return the middle values for an array. E.g 1,2,3 will return '2'assertArrayEqual
: Will assert if two arrays are the exact sameassertEqual
: will determine if two strings are the sameassertObjectEqual
: will assert if two objects are the samecountLetters
: Will count the number of letters in a string, not includeing spacescountOnly
: Will count only the values that are specifiedeqArrays
: Will determine whether two arrays are the sameeqObjects
: will determine whether two objects are equivalentfindKey
: Will find the value within a keyfindKeyByValue
: Will find a key using a value and an objectflatten
: Will take a nested array and return a single level arrayletterPositions
: Will find the index positions of a given letter within a stringmap
: Will apply a given set of instructions to each element in an arraymin
: will return the smallest value in an arraytakeUntil
: Will return all values until a given value us reachedwithout
: Will return an array with the given values excluded from it.