1.0.0 • Published 2 years ago
@ibrahim236/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 ibrahim236/lotide
Require it:
const _ = require('ibrahim236/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(...)
: Compares arrays and logs the results as pass/failassertEqual(...)
: It compares two values and returns an assertion for equalityassertObjectsEqual(...)
: It compares two objects and returns a boolean for equalitycountLetters(...)
: Returns the number of occurrences of a lettercountOnly(...)
: countOnly will be given an array and an object. It will return an object containing counts of everything that the input object listed.eqArrays(...)
: compares two arrays for strict equalityeqObjects(...)
: compares two objects for strict equalityfindKey(...)
: finds a specified key in an objectfindKeyByValue(...)
: find key(s) that have a specified valuehead(...)
: Returns the first element of an arrayletterPositions(...)
: Maps each letter to a key and stores its index position(s) in an array from a given stringmap(...)
: maps an array into a new arraymiddle(...)
: Grabs the middle element of an array, in the case of even length arrays, grabs the middle two elementstail(...)
: returns all elements of an array except the first onetakeUntil(...)
: It applies a callback function to each element of the objectwithout(...)
: return a subset of a given array, removing unwanted elements
1.0.0
2 years ago