1.0.0 • Published 4 years ago
@imiah/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. There is still some testing and refactoring required but the implemetations all still work.
Usage
Install it:
npm install @imiah/lotide
Require it:
const _ = require('@imiah/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: Asserts whether two arrays are equalassertEqual(actual, expected)
: Asserts if two primitive values are equalassertObjectEquals(actual, expected)
: Asserts if 2 objects are equalcountLetters(word)
: Returns the frequency of each lettercountOnly(allItems, itemsToCount)
: Counts how frequency of values passed in itemsToCounteqArrays(arr1, arr2)
: Tests if two arrays are equaleqObjects(object1, object2)
: Tests if two objects are equalfindKey(object, callback)
: Returns first key of value put in callbackfindKeyByValue(obj, val)
: Returns key of the object valuehead(arr)
: Returns first value of an arrayletterPositions(sentence)
: Returns indices of string where each character is.map(actual, expected)
: Returns a new array with callback to original arraymiddle(array)
: Returns the middle element(s) of an array.tail(array)
: Returns the all elements of array proceeding the head.takeUntil(array, callback)
: Returns array of elements until callback condition is met.without(input, takeout)
: Returns array taking out the filtered items mentioned in callback
1.0.0
4 years ago