1.0.0 • Published 1 year ago
@graydonritchie/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 @graydonritchie/lotide
Require it:
const _ = require('@graydonritchie/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: Returns the first item in an Arraytail
: Returnes all items in an array after the first itemmiddle
: Returnes the middle one or two items of an arrayassertArraysEqual
: returns a message based on whether two arrays are the sameassertEqual
: checks the output of another function agains an expected outputassertObjectEqual
: returns a message based on whether two objectss are the samecountLetters
: counts the instances of each letter ina an inputcountOnly
: counts values in an object based on inputeqArray
: compares two arrays to see if they are equaleqObjects
: compares two objects to see if they are equalfindKey
: returns key from object basked on its value - seach specified at function callfindKeyByValue
: returns key from object basked on its value - seach specified at function callflatten
: takes an array with nested arrays and returns one singular array with all valuesmap
: descriptionletterPositions
: returns all indexes where a letter appears from an inputtakeUntil
: returns items fomr an input array up to a specified pointwithout
: compares two arrays and returns items that are not present in both
Author
Graydon Ritchie
description
constains a library of functions that can be ported out
1.0.0
1 year ago