1.0.0 • Published 4 years ago
lotide-my-library 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 @lotide-my-library/lotide
Require it:
const _ = require('@lotide-my-library/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
:tests the equality of two arraysfunction2(head)
:returns the first element of arrayfunction3(tail)
:returns the array elements without first elementfunction4(middle)
:returns the middle element of arrayfunction5(assertEqual)
:tests the equality of two given valuesfunction6(assertObjectsEqual)
:tests the equality of two objectsfunction7(countLetters)
:returns the number of letter of stringfunction8(countOnly)
:returns an objec with the number of occurences of items marked as true in the arrayfunction9(eqArrays)
:deep comparison of weather 2 arrays are equalfunction10(eqObjects)
:deep comparison of weather 2 object are equalfunction11(findKey)
:takes in an object and callback and returns the first key that meets the criteria specified in callbackfunction12(findKeyByValue)
:takes in an object and a value. It should scan the object and return the first key which contains the given valuefunction13(letterPositions)
: takes in a string and returns all indices of letter positions in the string.function14(map)
: takes in an array and a callback and returns a new array based on the results of the callback on each item in the arrayfunction15(takeUntil)
:takes in an array and callback and returns a slice of the array based on the criteria specified in the callbackfunction16(without)
:return a subset of a given array, removing unwanted elements
1.0.0
4 years ago