1.0.0 • Published 4 years ago
matthewhenryfordlotide 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 @matthew.henry.ford/lotide
Require it:
const _ = require('@matthew.henry.ford/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
isArrEqual()
: Compares two arrays to see if they are equalassertEqual()
: Test function to see if actual input equals expected outputcountLetters()
: Automatically adds a letter key and updates its countcountOnly()
: Takes in a collection of items and returns counts for a specific subset of those itemseqArrays()
: If two arrays are equal it returns true or falseeqObjects()
: Compares the length of two objects and returns true or falsefindKey()
: Searches an object key for a specific parameterfindKeyByValue
: Takes in an object and its values. Returns the first key which contains the value. If no value is found, return undefinedhead()
: Returns the first item in an array, known as the head of an arrayletterPositions()
: Takes a letter from a string and prints out its location in the string. Does this for every letter.map()
: Callback and copy of the regular .map() function. Goes through the array looking for specifications and changing the array if truemiddle()
: Finds the middle of an array.tail()
: Finds the tail or elements that are not the head of the arraytakeUntil()
: Returns a slice of the original array with elements taken from the begging. Will return the elements until a call/predicate returns a truthy value.without()
: Takes in a "source" and "itemsToRemoveArray". Returns the source and excludes anything that is present in the items to remove array.
1.0.0
4 years ago