1.0.0 • Published 5 years ago
@vladyslav1/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 @VladyslavKutsevolov/lotide
Require it:
const _ = require('/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(array1, array2)- returns Assertion Passed or Assertion Failed on nested arraysassertEqual(array1, array2)- return Assertion Passed or Assertion Failed on primitive valuesassertObjectsEqual(object1, object12)- returns Assertion Passed or Assertion Failed on nested objectscountLetters(string)- count letters in a stringcountOnly(array, itemsCount)- count letters in arrayeqArrays(array1, array2)- returns true if arrays are equal, accepts deep nested arrayseqObjects(object1, object2)- returns true if objects are equal, accepts deep nested objectsfindKeyByValue(object, valueToFind)- returns keys if value exist or undfined if notflatten(array)- flat deep nested arrayhead(array)- return first value of the arrayletterPositions(string)- return an object with letters as keys and their indexes as valuesmap(array)- simple implementationmapfuntion from ES6middle(array)- return middle value of array if array length is odd or two values in the middle in array length is eventail(array)- The function will return a "slice of the array with elements taken from the beginning." It should keep going until the callback/predicate returns a truthy value.takeUntil(array, callback)- will parse through array based on function, and return a new array of filtered items.without(array, itemsToRemove)- It should return a new array with only those elements from source that are not present in the itemsToRemove array.
1.0.0
5 years ago