1.0.0 • Published 3 years ago
@dylan_mclovin/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 @dylan_mclovin/lotide
Require it:
const _ = require('@dylan_mclovin/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arrayA, arrayB)
: asserts the two arrays are equalassertEqual(actual, expected)
: compares your expected outcome with your actual outcomeassertObjectsEqual(object1, object2)
: compares two objects to see if they are the samecountLetters(string)
: counts the amount of times each letter shows up in a stringcountOnly(allItems, itemsToCount)
: counts the amount of times a specified item shows up in an arrayeqArrays(array1,array2)
: compares two arrays and checks if they are equaleqObjects(object1, object2)
: compares two objects and checks if they are equalfindKey(object, callback)
: finds the key for a nested object valuefindKeyByValue(object, value)
: finds the key when given the valuehead(array)
: returns the head of the arraymiddle(array)
: returns the middle of the array, one value for an odd length array two values for an even lenght arraytail(array)
: returns the tail end of an arrayletterPositions(sentence)
: returns the index of specified elementmap(array, callback)
: takes in an array and returns a new array with only elements specified by indextakeUntill(array, callback)
: pushes elements into a new array until a specifiecd point the returns the new arraywithout(want, dontWant)
: creates a new array with only the elements you want
1.0.0
3 years ago