1.0.0 • Published 3 years ago
@mostafanaghipoor/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 @mostafanaghipoor/lotide
Require it:
const _ = require('@mostafanaghipoor/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are implemented currently:
function1(head): gets the first element of arrayfunction2(tail): gets the last element of arrayfunction3(middle): gets the middle element of arrayfunction3(assertArraysEq): asserts if 2 arrays are equalfunction3(assertEqual): asserts if two values are equalfunction3(assertObjectsEqual): asserts if 2 objects are equalfunction3(countLetters): counts each letter of stringfunction3(countOnly): takes elements of arrays and counts their amountfunction3(eqArrays): compares 2 arraysfunction3(eqObjects): compares 2 objectsfunction3(findKey): returns first element key that meets the condition of callback functionfunction3(findKeyByValue): returns element key that meets specified valuefunction3(letterPositions): returns all indices where specific is element foundfunction3(map): returns new array with results of callback functionfunction3(takeUntil): returns slice of an array with elements taken from the beginningfunction3(without): removes element from an array
1.0.0
3 years ago