1.0.1 • Published 6 years ago
@benjaminvincent/lotide v1.0.1
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 @benjaminvincent/lotide
Require it:
const _ = require('@benjaminvincent/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters(sentence): counts occurences of each letter in sentencecountOnly(allItems, itemToCount): counts itemToCount occurences in obj allItemeqArrays(a1, a2): checks a1 equal to a2eqObjects(object1, object2): checks object1 equal to object2findKey(obj, callback): finds a value of key given objfindKeyByValue(obj, value): returns key given a valueflatten(arr): flattens n-dimensional array to 1-dimensionhead(a): returns the first element of aletterPosition(sentence): returns each index of occurence of each letter in sencentmap(array, callBack): maps a callback function output to arraymiddle(arr): returns the middle element of an arraytail(a): returns the tail of atakeUntil(array, callback): copies array up until callbackwithout(arr, toRemove): removes toRemove from arr