@rylanbaun/lotide
v1.0.0
Published
lotide directory (mimics lodash), built for my own education
Downloads
6
Readme
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 @rylanbaun/lotide
Require it:
const _ = require('@rylanbaun/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: returns the head of an arrayfunction2(tail)
: returns the tail of an arrayfunction3(middle)
: returns the middle value of an arrayfunction4(assertArraysEqual)
: asserts if two arrays are the samefunction5(assertObjectsEqual)
: asserts if two objects are the samefunction6(assertEqual)
: asserts if two values are equalfunction7(countLetters)
: counts the number of times a letter appears in a given stringfunction8(countOnly)
: counts the number of times a given value appears in an arrayfunction9(eqArrays)
: checks if two arrays are equal, returns true/falsefunction10(eqObjects)
: checks if two objectss are equal, returns true/falsefunction11(findKey)
: returns the key whos value meets the requirments of a callback functionfunction12(findKeyByValue)
: returns the key whos value matches that providedfunction13(flatten)
: flattens nested arraysfunction14(letterPositions)
: returns an array of the indices for each letter within a given stringfunction15(map)
: returns a new array with values that have been altered/filtered by a given conditionfunction16(without)
: returns an array with items filtered out, given in another arrayfunction17(takeUntil)
: maps an array until a condition is met