1.0.3 • Published 2 years ago
@jay1337/lotide v1.0.3
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 @username/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
: Returns the first value in an arraymiddle
: Returns the middle value/(values if its an even length array) in an arraytail
: Returns the last values (i.e everything but the first) in an arraycountLetters
: Counts the number of letters in a string ignoring whitespacecountOnly
: Returns the number of times an item appears in an array if the item is marked trueeqArrays
: Checks if two arrays are equaleqObjects
: Checks if two objects are equalfindByKeyValue
: Returns the key when passed the keys valuefindKey
: Returns a key when passed a callback to search for keysflatten
: Returns a flattened array when passed an array in an arrayletterPositions
: Returns the position of a letter in a string in relation to the stringmap
: Copy's one array to another given a parametertakeUntil
: Map's an array until it reaches a given parameterwithout
: Returns an array without the values of the other array