@arjunkumar97/lotide
v1.0.0
Published
A clone of Lodash consisting of small functions to exercise programming skills.
Downloads
5
Readme
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 @arjunkumar97/lotide
Require it:
const _ = require('@arjunkumar97/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: checks if two arrays are equalassertEqual(...)
: checks if two primitive data types are equalassertObjectEqual(...)
: checks if two objects are equalcountLetters(...)
: counts the number of times each alphabet is present within in a stringcountOnly(...)
: takes in a set of items and returns the count of a specific item within the seteqArrays(...)
: compares two arrays and returns true or false based on a perfect matcheqObjects(...)
: compares two objects and returns true or false based on a perfect matchfindKey(...)
: scans an object and return the first key for which the callback returns a truthy valuefindKeyByValue(...)
: scan the object and return the first key which contains the given valueflatten(...)
: unifies arrays within an array into a single arrayhead(...)
: returns the first element of the given arrayletterPositions(...)
: returns the indexes of where each character in the string are presentmap(...)
: takes in an array and a callback function and returns a new array based on the results of the callbackmiddle(...)
: returns the middle element of an arraytail(...)
: returns an array without the first elementtakeUntil(...)
: returns a slice of the array with elements taken from the beginningwithout(...)
: * removes specific elements from an array