1.0.0 • Published 4 years ago
lotide-matthew-tran-3 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 @themattran/lotide
Require it:
const _ = require('@themattran/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...): returns first element of arraytail(...): returns all elements of array except the first elementmiddle(...): returns the middle elements of an array (1 element for odd || 2 elements for even # arrays )assertEqual(...): compares two values and returns booleanassertArraysEqual(...): compares two arrays and returns booleaneqArrays(...): compares two arrays and returns booleanassertObjectsEqual(...): compares object instancescountLetters(...): counts letters of stringcountOnly(...): count only strings within parametereqObjects(...): compares objectsfindKeyByValue(...): finds key by value within obhectfindKey(...): finds key within objectflatten(...): flattens matrix into singular arrayletterPositions(...): finds and tracks positions of letters within stringmap(...): returns first index of each element from given string
1.0.0
4 years ago