1.0.1 • Published 4 years ago
@francispv/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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function head()
: returns an array without the first elementfunction tail()
: returns an array without the last elementfunction middle()
: returns an array with the middle number or the two middle numbers in case the array have an odd number of elementsfunction flatten()
: returns a new array with all sub-array elements concatenated into it up to the specified depthfunction indexPosition()
: return the index of the character that you ask forfunction map()
: recreate the map functionfunction takeUntil()
: returns an array of number till you reach a certain numberfunction without()
: returns an array withtout a numberfunction findKeyByValue()
: returns the key by it's valuefunction findKey()
: returns a keyfunction eqArrays()
: assert two arraysfucntion eqObjects()
: assert two objectsfunction countOnly()
: returns the count of a certain numberfunction countLetters()
: returns the count of a certain letterfunction assertObjectsEquals ()
: assert two objectsfunction assertArrayEquals()
: assert two arrays