1.0.0 • Published 6 years ago
@willow123red/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 @willow123red/lotide
Require it:
const _ = require('@willow123red/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(current, expected): check if an array is equal to what is expectedassertEqual(current, expected): compare if an outcome is as expected when passing an argumentassertObjectsEqual(object1, object2): compare if two objects are equalcountLetters(string): count the number of times a character appears in a stringcountOnly(allItems, itemsToCount): count number of particular item in a group of itemseqArrays(arr1, arr2): Check if two arrays are equaleqObjects(obj1, obj2): Compares two objects keys and valuesfindKey(obj, call): Find key in an objectfindKeyByValue(obj, name): find a key in object by valueflatten(previous): Flatten a nested arrayhead(arr): Return the head index of an arrayindex(): Index of libraryletterPositions(string): Find index of characters in a stringmap(array, callback): Return a new array based on a callbackmiddle(array: Find the middle index/indexes in an odd or even numbered arraytail(array): Find the tail indexes of an arraytakeUntil(array, callback): Iterate through an array until reaching a callback itemwithout(array, callback): Remove items from an array based on a callback item
1.0.0
6 years ago