1.0.0 • Published 2 years ago
@youssefragab/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 @youssefragab/lotide
Require it:
const _ = require('@youssefragab/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: returns the first value of an arrayfunction2(tail)
: returns array without the first valuefunction3(middle)
: returns middle values(s) of the arrayfunction4(countLetters)
: returns letter count in a given stringfunction5(countOnly)
: counts how many items to count from an all items arrayfunction6(findKey)
: returns key name given a provided object attributefunction7(findKeyByValue)
: returns key value given a provided object attributefunction8(flatten)
: transforms nested arrays into a simple arrayfunction9(letterPositions)
: returns letter positions of a given letter in a stringfunction10(map)
: takes each value of an array and executes a callback function on themfunction11(takeUntil)
: returns array until it reaches takeUntil value (not included)function12(without)
: returns an array excluded gven "without" valueshead, tail, middle, countLetters, countOnly, findKey, findKeyByValue, flatten, letterPositions, map, takeUntil, without
1.0.0
2 years ago