1.0.1 • Published 5 years ago
@jettscythe/lotide v1.0.1
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 @jettscythe/lotide
Require it:
const _ = require('@jettscythe/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arr1, arr2): asserts arrays are equalassertEqual(arg1, arg2): asserts basic data types are equalassertObjectsEqual(obj1, obj2): asserts objects are equalcountLetter(str): counts each letter in a stringcountOnly(allItems, itemsToCount): counts only specified items from allItemseqArrays(arr1, arr2): confirms arrays are equaleqObjects(obj1, obj2): confirms objects are equalfindKey(object, callback): returns the first key for which the callback returns a truthy value, else returns undefinedfindKeyByValue(obj, val): finds key in object based on val argflatten(arr): merges nested arrays into parenthead(arr): returns value of content at arr0letterPositions(sentence): finds index of letters in arg sentencemap(array, callback): returns new array based on results of callback functionmiddle(arr): returns the middle of an arraytail(arr): returns arr without arr0takeUntil(array, callback): Takes all the values out of an array or string until callback is hitwithout(source, itemsToRemove): creates an array without itemsToRemove