1.0.0 • Published 4 years ago
@luke-501/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 @luke-501/lotide
Require it:
const _ = require('@luke-501/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arr1, arr2)
: Assert that 2 arrays are equalassertEqual(actual, expected)
: Assert that 2 values are equalassertObjectsEqual(actual, expected)
: Assert that 2 objects are equalcountLetters(sentence)
: Count how many times each letter appears in a sentencecountOnly(allItems, itemsToCount)
: Counting things in an arrayeqArrays(arr1, arr2)
: Assert that 2 arrays are equaleqObjects(object1, object2)
: Assert that 2 objects are equalfindKey(object, callback)
: Find a keyfindKeyByValue(obj, value)
: Find key by valuehead(array)
: Find the head of an arrayletterPositions(sentence)
: Find where each letter appears in a sentencemap(array, callback)
: Put the first letters of each word in an arraymiddle(array)
: Find the middle of an arraytail(array)
: Find the tail of an arraytakeUntil(array, callback)
: Find a segment of an array, up until a condition is metwithout(source, itemsToRemove)
: Remove some items from an array
1.0.0
4 years ago