1.0.0 • Published 5 years ago
@krissyl/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 @krissyl/lotide
Require it:
const _ = require('@krissyl/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: returns the first element of an arraytail(...)
: cuts the first element out of an arraymiddle(...)
: returns the middle element(s) of an arrayassertArraysEqual(...)
: asserts whether or not two arrays are equalassertEqual(...)
: asserts whether or not two values are equalassertObjectsEqual(...)
: asserts whether or not two objects are equalcountLetters(...)
: counts the number of instances of a letter in a stringcountOnly(...)
: counts only the number of instances of a single element in an arrayeqArrays(...)
: compares two arrays to see if they are equaleqObjects(...)
: compares two objects to see if they are equalfindKeyByValue(...)
: will return a key name when given a valuefindKey(...)
: finds a given key in an objectflatten(...)
: takes a group of nested arrays and concatenates them into one single arrayletterPositions(...)
: gives the position of occurances of letters in a stringmap(...)
: description applies a function to each element in an arraytakeUntil(...)
: prints the items in an array until a declared value occurswithout(...)
: prints all values in an array except the one declared
1.0.0
5 years ago