1.0.0 • Published 6 years ago
@marta-luiz/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 @marta-luiz/lotide
Require it:
const _ = require('@marta-luiz/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(array1, array2): asserts equal array typesassertEqual(actual, expected): asserts two valuesassertObjectEqual(actual, expected): asserts two objects typescountLetters(string): counts the number of letters in the stringcountOnly(allItems, itemsToCount): counts the specified itemseqArrays(array1, array2): determines if two arrays are identicaleqObjects(object1, object2): determines if two objects are identicalfindKey(object, callback): return keys based on property valuefindKeyByValue(object, value): returns key in object by valueflatten(array): flattens input arrayhead(array): returns the firt value of the arrayletterPositions(sentence): returns the index of given letter in a sentencemap(array, callback): returns a new array based on the callback functionmiddle(array): find the middle value of an arraytail(array): finds all but the first value of an arraywithout(source, itemsToRemove): removes items from array
1.0.0
6 years ago