@jordy_ntambwe/lotide
v1.0.4
Published
A clone of the lodash JavaScript library to practice creating various types of functions
Downloads
1
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 @jordy_ntambwe/lotide
Require it:
const _ = require('@jordy_ntambwe/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: If two arrays are equalsassertEqual(...)
: If two values are equalsassertObjectsEqual(...)
: If two objects are equalscountLetters(...)
: Returns counts of each letter of a stringcountOnly(...)
: Takes items and returns counts for a specific subset of those itemseqArrays(...)
: Compares two arrayseqObjects(...)
: Compares two objectsfindKey(...)
: Scans the object and return the first key for which the callback returns a truthy valuefindKeyByValue(...)
: Searches for a key on an object where its value matches a given valuehead(...)
: Retrieves the first element from the arrayindex(...)
: List of all the functions in an objectletterPositions(...)
: Returns all the indices in the string where each character is foundmap(...)
: Creates a new array with the results of calling a provided function on every element in the calling arraymiddle(...)
: Returns the middle element of an arraytail(...)
: Retrieves every element except for the first element of the arraytakeUntil(...)
: Returns a slice of the array with elements taken from the beginningwithout(...)
: Removes elements from an array