1.0.1 • Published 5 years ago
@rbbenett/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 @rbbenett
Require it:
const _ = require('@rbbenett/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: Determine if two arrays are equal and return back true or false depending on resultassertEqual: Determine if two parameters are equal and return a statement back depending on if they are true or falseassertObjectsEqual: Determine if two Objects are equal by their keys and if they are both arrays and return back a statement on whether they are true or falsecountLetters: Loop through a string and return a count of total letters in the stringcountOnly: Loop through an array and return only items that meet a set parametereqArray: Determine whether or not two arrays are of equal length and return a true or false statementeqObjects: Determine if two objects in array are equal and return back a true or false statementfindKey: Sort through an object and determine if it has a defined keyfindKeyByValue: Sort through an object and find a key by a defined valueflatten: Sort through an array containing nested arrays and return a single arrayhead: Determine the first value in an array and return itletterPositions: Iterate through a string a return back an array defining where each letter occurs in that stringmap: Iterate through an array and return only items of that array that are defined by a callback functiontail: Iterate through an array and return all value that occur after the first index in the arraytakeUntil: Iterate through an array and return all values until a callback function has been metwithout: Iterate through an array and remove all values that match and return a new array containing those values.