1.0.1 • Published 4 years ago
@ralphunrau/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 @ralphunrau/lotide
Require it:
const _ = require('@ralphunrau/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(): returns the first element in an arraytail(): returns every element but the first in an arraymiddle(): returns every element but the first and last in an arrayassertEqual(): logs if the two values are equalassertArraysEqual(): logs if the two arrays are equalassertObjectsEqual(): logs if the two objects are equalcountLetters(): counts an amount of letterscountOnly(): counts an amount of specified letterseqArrays(): checks if two arrays are equaleqObjects(): checks if two objects are equalfindKey(): finds key in an objectsfindKeyByValue(): finds key by value of keyflatten(): confuscates passwordsletterPositions(): returns the amount of letters and what position they are in with a given sentancemap(): uses a callback to maptakeUntil(): adds value to array until callbackwithout(): filters array