1.0.0 • Published 2 years ago
@jkalambay/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 @jkalambay/lotide
Require it:
const _ = require('@jkalambay/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(input)
: returns the head of an input stringtail(input)
: returns the tail of an input stringmiddle(arr)
: returns the center most value(s) of an arrayeqArrays(arr1, arr2)
: determines equality between two arraysassertArraysEqual(arr1, arr2)
: leverages eqArrays function and logs an assertion to the consoleassertEqual(actual, expected)
: compares a testing value with expected outcome to determine equalityassertObjectsEqual(obj1, obj2)
: determines equality between two objectscountLetters(input)
: tracks the count of each character within an input stringcountOnly(allItems, itemsToCount)
: tracks the count of specific characters in an inputeqObject(obj1, obj2)
: detemines equality between two objectsfindKey(object, callback)
: scans an object and returns the first key which the callback returns a truthy valuefindKeyByValue(object, value)
: scans an object and returns a the first key which contains a given valueletterPositions(sentence)
: tracks all characters in a string and records their indexmap(array, callback)
: performs a given callback function on each item in an arraytakeUntil(array, callback)
: collects each item of an array until the call back function returns a truthy valuewithout(startArr, toRemoveArr)
: filters out values in the startArr that are found in toRemoveArr
1.0.0
2 years ago