1.0.0 • Published 2 years ago
@sesi_g/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 @sesi_g/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: a function that returns the first item in an arraytail
: a function that returns the tail end of an arraymiddle
: a function that returns the middle most function of an arraycountLetters
: a function that counts the letters in a string and returns an objectcountOnly
: a function takes an array and an object returns an object with counts of everything that the input object listedeqArrays
: a function which takes in two arrays and returns true or false, based on a perfect matcheqObjects
: a function wich will take in two objects and return true or falsem based on a perfect matchfindKey
: a function that takes an object and a callback and returns the first key for which the callback retuns a truthy valuefindKeyByValue
: a function that takes an object and value and returns the first key which contains the given valueletterPositions
: a function which will return all the indices in the string where each character is foundmap
: a function that maps through an array and returns the first letter of the arraytakeUntil
: a function which will keep collecting items from a an array until the callback provided returns a truthy valuewithout
: a function which will return a subset of a given array, removing unwanted elements
1.0.0
2 years ago