1.0.0 • Published 3 years ago
@sawrrawr/lotide v1.0.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 @sawrrawr/lotide
Require it:
const _ = require('@sawrrawr/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: returns the first entry in an arraytail
: returns the remaining entries in an array, from index 1 onwardsmiddle
: returns the middle value(s) in an arrayassertArraysEqual
: comparing arrays using an assertion messageassertEqual
: comparing values using an assertion messagecountLetters
: can count how many times a certain letter appears in a string, returns an objecteqArrays
: compares two arrays, returns true or falseeqObjects
: compares two objects, returns true or falsefindKey
: returns the appropriate key using callback functionsfindKeyByValue
: returns the appropriate key by searching for it using its valueflatten
: returns a singular array from an input array that contains nested arraysletterPositions
: returns an array with index positions of where certain letters are located within a stringmap
: performs a function on each element of an arraytakeUntil
: returns the elements of an array starting at index 0 and stopping at a specified valuewithout
: filters through an array to remove specific elements
1.0.0
3 years ago