1.0.0 • Published 3 years ago
@syransong/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 @syransong/lotide
Require it:
const _ = require('@syransong/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual
: A function that asserts if two arrays are equal to each otherassertEqual
: A function that asserts if two values are equal to each otherassertObjectsEqual
: A function that asserts if two Objects are equal to each othercountLetters
: A function that that counts the number of letters in a stringcountOnly
: A function that takes in a collection of items and returns the counts for a certain subset of said itemseqArrays
: A function that determines if two arrays are identical to each othereqObjects
: A function that determines if two objects are identical to each otherfindKey
: A function that goes through an object and returns the first key for which the callback returns a 'truthy' valuefindKeybyValue
: A function that goes through an object and searches for the key where its value matches a given valuehead
: A function that returns the value of the zeroth index in an arrayletterPositions
: A function that returns all the indices where a certain letter occurs in a stringmap
: A function that returns a new array based on the results of the callback function providedmiddle
: A function that returns the middle (if array length is odd) element or the 2 middlemost elements (if array length is even)tail
: A function that returns the last element in an arraytakeUntil
: A function that will return a slice of an array with elements taken from the beginning until a certain value is reachedwithout
: A function that removes certain elements in an array
1.0.0
3 years ago