1.0.0 • Published 4 years ago
@gaalit/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 @gaalit/lotide
Require it:
const _ = require('@gaalit/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: function that verifies if two given arrays are equalassertEqual
: function that verifies wheter two values are equal and are of the same data typeassertObjectsEqual
: function that verifies if two given objects are equalcountLetters
: function that outputs the amount of times each letter in a given string appearscountOnly
: function that specifies what string should be counted and then output's it's lengtheqArrays
: function that verifies if two arrays are perfectly equaleqObjects
: function that verifies if two objects are perfectly equalfindKey
: function that filters an object and outputs the first key for which the callback function outputs truefindKeyByValue
: function that filters an object and outputs the first key that contains the given value.head
: function that filters an array and returns the first element of that array (index 0)letterPositions
: function that filters an object and outputs all the indices in the string where each character is found.map
: function that take in an array and performs a specific manipulation on each element and then outputs a new arraymiddle
: function that outputs the middle of a given arraytail
: function that outputs all the elements of an array except for the firs element (index 0)takeUntil
: function that slices an array starting from the beggining up until a specified ending pointwithout
: function that removes desired elements from an array
1.0.0
4 years ago