1.0.0 • Published 4 years ago
@elena1488/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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: retrieves the first element from the arraytail: retrieves every element except the first element of the arraymiddle: returns the middle element of an arrayassertArraysEqual: asserts if two arrays are equalsassertEqual: asserts if two values are equalsassertObjectsEqual: asserts if two objects are equalscountLetters: returns counts of each letter of a stringcountOnly: retunrn counts quantity of similar letters in a stringeqArrays: validates equality of arrayseqObjects: validates equality of objectsfindKey: searches for specific key of an objectfindKeyByValue: searches for a key on an object where its value matches a given valueletterPositions: returns all the indices in the string where each character is foundmap: creates a new array populated with the results of calling a provided function on every element in the calling arraypigLatin: flips the words based on famous logical game pig latinreverse: reverses any string giventakeUntil: returns a slice of the array with elements taken from the beginningwithout: return a subset of a given array, removing unwanted elements.
1.0.0
4 years ago