1.0.0 • Published 11 months ago
@tolu_woms/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 @tolu_woms/lotide
Require it:
const _ = require('@tolu_woms/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: outputs the first element of an arrayfunction2(tail)
: outputs other elements of an array minus the headfunction3(middle)
: outputs the middle (2 middle if even) elements of an arrayfunction4(assertArraysEqual)
: asserts that the expected and actual values of an array are the samefunction5(assertEqual)
: asserts that expected and actual values are equalfunction6(assertObjectEqual)
: asserts that the expected and actual values of an object are the samefunction7(countLetters)
: outputs the number of count a letter appears in a sentencefunction8(countOnly)
: outputs the number of times an item occurs in an objectfunction9(eqArrays)
: outputs true if two arrays are the same and false if notfunction10(eqObjects)
: outputs true if two objects are the same and false if notfunction11(findKey)
: outputs the key used to callback an objectfunction12(findKeyByValue)
: outputs the key of an object by using the key's value to access the objectfunction13(flatten)
: accesses nested arrays to output an arrayfunction14(letterPositions
: outputs the index position of a letter in a sentencefunction15(map)
: outputs a new array using a callback functionfunction16(takeUntil)
:outputs result array after callback function is executedfunction17(without)
: outputs an array less specified item
1.0.0
11 months ago