1.0.0 • Published 6 years ago
@lucaswong17/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 @lucaswong17/lotide
Require it:
const _ = require('@lucaswong17/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters: A function that counts the amount a single letter in a stringcountOnly: A function that takes two arrays as parameters and counts specific letters in 1st arrayhead: A function that returns the first element of an arraytail: A function that returns everypart of the array except the first indexmiddle: A function that returns the middle number/numbers of an arrayeqArrays: A function that returns true/false depending if the given arrays are stictly equaleqObjects: A function that returns true/false depending if the given objects are equal(non-strict)findKey: A function that takes a stopping conditon callback function and loops through an objectfindKeyByValue: A function that finds a key of an objects property by its valueflatten: A function that takes away layers of a nested arrayletterPositions: A function that returns the index of each letter in a given stringmap: A map like function that loops through an array and takes a callback functiontakeUntil: A function that loops through an array an stops when a callback functions says to stopwithout: A function that removes determined elements from a given array
1.0.0
6 years ago