1.0.0 • Published 4 years ago
@sxj80353317/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 @andysoso1/lotide
Require it:
const _ = require('@andysoso1/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual: return true if 2 item are strictly equalassertObjectsEqual: return true if 2 object are strictly equalassertArraysEqual: return true if 2 array are strictly equalcountLetters: returns counts of each letter in a stringcountOnly: takes items and returns counts the occurence of itemeqArrays: compares 2 arrayseqObjects: compares 2 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 valueflatten: flattens an array of arrays into a one arrayhead: first item ofthe arrayletterPositions: returns all the indexin of stringmap: creates a new array with the results of calling a provided on every element in the calling arraymiddle: returns the middle element of an arraytail: return item of array except 1st onetakeUntil: retrun all item that match until callbackwithout: remove item from array `
1.0.0
4 years ago