1.0.1 • Published 3 years ago
@josepwil/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 @josepwil/lotide
Require it:
const _ = require('@josepwil/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
: asserts if arrays are equalfunction2(assertEqual)
: asserts if two values are equalfunction3(assertObjectsEqual)
: asserts if two objects are equalfunction4(countLetters)
: counts number of invidual letters in a string and returns totals for each letterfunction5(countOnly)
: receives an array and items to search and tallies each occurance of items to search in the arrayfunction6(eqArrays)
: determines if two array are equalfunction7(eqObjects)
: determines if two objects are equalfunction8(findKey)
: receives object/callback, searches through object and returns key where callback evaluates to truthyfunction9(findKeyByValue)
: receives object/value, searches through object and returns key that has matching valuefunction10(flatten)
: flattens nested arrays into one arrayfunction11(head)
: returns first element of an arrayfunction12(letterPositions)
: receives sentence, returns where index values of where each letter existd in sentencefunction13(map)
: receives array/callback, manipulates data in array by applying callback to each element and maps manipulated data into new arrayfunction14(middle)
: returns middle element in an arrayfunction15(tail)
: returns all but first element of an arrayfunction16(takeUntil)
: receives array/callback, loops through array until callback is truthy and returns values in array up to that pointfunction17(without)
: receives sourceArray and items to remove, returns array with items removed