@alisav_7/lotide
v1.0.0
Published
Useful methods for javascript
Downloads
3
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 @alisav_7/lotide
Require it:
const _ = require('@alisav_7/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: Logs equal/not equal arraysassertEqual(actual, expected)
: Logs if parameters passed in are equalassertObjectsEqual(actual, expected)
: Logs equal/not equal objectscountLetters(string)
: Returns number of letters in a stringcountOnly(allItems, itemsToCount)
: Counts number of items in an arrayeqArrays(arrOne, arrTwo)
: Returns true/false if arrays are equal/not equaleqObjects(object1, object2)
: Returns true/false if objects are equal/not equalfindKey(object, callback)
: Finds the key of an object that satisfies the callback conditionfindKeyByValue(object, value)
: Finds object key, given the valuehead(actual, expected)
: Returns the head of the arrayletterPositions(sentence)
: Returns index of a letter in a stringmap(array, callback)
: Performs a function on each array elementmiddle(arr)
: Takes middle of arraytail(actual, expected)
: Returns the tail of the arraytakeUntil(array, callback)
: Return data until a callback condition is satisfied