1.0.0 • Published 5 years ago
@ian.c.cameron/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 @ian.c.cameron/lotide
Require it:
const _ = require('@ian.c.cameron/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:returns an array without the first itemmiddle:returns the item, or two items, in the middle of an arrayassertArrayEqual:outputs a message about if two given arrays are equivelentassertEqual:outputs a message about if two given primatives are equalassertObjectsEqual:outputs a message about if two given objects are equivelentcountLetters:returns an objects containing the count of each letter in a stringcountOnly:returns an object with the number of occurances of the given strings in a sentanceeqArrays:when passed two arrays it returns true if they are equivilent, and false if they arn'teqObjects:when passed two objects it returns true if they are equivilent, and false if they arn'tfindKeyByValue:searches an object for a value, and returns the first key with that valuefindKey:flatten:turns a multi-dimentional array into a one dimentional arrayletterPositions:returns an object with the positions of each letter in a stringmap:performs a passed function on all the items in an arraytakeUntil:returns the part of an array before a passed function is satisfied by a valuewithout:takes an array, and returns all the values not in another passed arraymin:returns the lowest value in an array
1.0.0
5 years ago