1.0.0 • Published 3 years ago
@conradw/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 @conradw/lotide
Require it:
const _ = require('@conradw/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: compare array, prints to consoleassertEqual(...)
: compare primitive data, prints to consoleassertObjectsEqual(...)
: compare object, -> booleancountLetters(...)
: counts number of each letters in a string, -> objectcountOnly(...)
: counts specified occurences of data in an array, -> objecteqArrays(...)
: compare array, -> booleaneqObjects(...)
: compare object, -> booleanfindKey(...)
: find key given specified property of key, -> stringfindKeyByValue(...)
: find key given key's value, -> stringhead(...)
: returns first element of array, -> dataletterPositions(...)
: find indexes of each letter appearance in a string, -> objectmap(...)
: transform an array given a function, -> arraymiddle(...)
: find middle element(s) of an aray, -> arraytail(...)
: return array without the first element, -> arraytakeUntil(...)
: return array truncated at the first instance of specified function, -> arraywithout(...)
: remove elements from an array that matches second array, -> array
1.0.0
3 years ago