lotide-hydrajin
v1.0.0
Published
A mini clone of the lodash JavaScipt library for LHL bootcamp
Downloads
2
Readme
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 @hydrajin/lotide
Require it:
const _ = require('@hydrajin/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: Return the head or the first element of an arraytail
: Return the tail or all elements of the array but the head (first element)middle
: Return the middle 2 array elements of an EVEN array or the middle values of an ODD array- `assertArraysEqual: Check if two arrays have the EXACT same values
- `assertEqual: Check if the actual result equals the expected result
asserObjectsEqual
: Checks 2 objects to see if the key and value pairs matchcountLetters
: Counts the EACH letter of of a sentence and returns the count as an objectcountOnly
: Returns an object containing counts of a given array and object- `findKey: Return the first key for which a callback returns a truthy value
findKeyByValue
: Return a match of a given key within an objectmap
: Returns a new array based on the results of a callback funtionletterPositions
: Returns the index of the string letterwithout
: Returns an new array from a provided source and itemsToRemove arraytakeUntil
: Returns a slice of the array with elements from the beginning until a callback/predicate returns a truthy valueeqAarray
: Check if 2 arrays return true or false based on a perfect matcheqObjects
: Check if 2 objects return true or false bassed on perfect matchtakeUntil
: Returns a slice of the array with elements from the beginning until a callback/predicate returns a truthy value