1.0.0 • Published 2 years ago
@keilamari/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 @keilamari/lotide
Require it:
const _ = require('@keilamari/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: asserts whether or not actual array is expected arrayassertEqual(actual, expected)
: asserts whether actual is expectedassertObjectsEqual(object1, object2)
: asserts whether actual object is equal to expected objectcountLetters(string)
: counts the letters of a stringcountOnly(allItems, itemsToCount)
: counts only specified items from given parameterseqArrays(array1, array2)
: inspects if two arrays are equaleqObjects(object1, object2)
: inspects if two objects are equalfindKey(object, callback)
: returns the key name of given parametersfindKeyByValue(object, value)
: returns key name by searching by valuehead(array1)
: returns first element of an arrayletterPositions(string)
: returns index positions of letters within a stringmap(array, callback)
: returns new array based on results of callbackmiddle(array)
: returns middle most element(s) of the given arraytail(array1)
: returns every element of array except the first elementtakeUntil(data, callback)
: returns section of given array until the callback parameterswithout(source, itemsToRemove)
: returns array with items removed
1.0.0
2 years ago