@emilyemcmahon/lotide
v1.0.1
Published
a mini clone of the lodash library
Downloads
5
Readme
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 @emilyemcmahon/lotide
Require it:
const _ = require('@emilyemcmahon/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: a function that combines the functions eqArrays and assertEqualassertEqual(...)
: a function that takes in two values and assert if they are true equalsassertObjectsEqual(...)
: a function that takes in two obejcts and returns if they are true equalscountLetters(...)
: a function that takes in a string and returns the count of each letter containedcountOnly(...)
: a funcyion that counts how many matches there are between an object and an arrayeqArrays(...)
: a function that takes in two arrays and asserts if they are true equalseqObjects(...)
: a function that takes in two objects and asserts if they are true equalsfindKey(...)
: a function which takes in an objects and a callback, and returns first key with truthy valuefindKeyByValue(...)
: a function that takes in an object and value, scans through the object and returns key with given valueflatten(...)
: a function that flattens arrays with nested elements into one arrayhead(...)
: a function that returns the first element in an arrayletterPositions(...)
: a function that will return all positions in of each letter in a stringmap(...)
: a function that pushes variables into a new arraymiddle(...)
: a function that finds the middle in an array and returns just the middletail(...)
: a function that returns everything but [0] in an arraytakeUntil(...)
: a function that will keep collecting from given array until callback returns truthy valuewithout(...)
: returns a subset of a given array, removing unwanted elements