1.0.0 • Published 4 years ago
@alshaikhly/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 @alshaikhly/lotide
Require it:
const _ = require('@alshaikhly/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertEqual)
: checks the actual and expected values from a function and prints a corrolating messagefunction2(AssertEqualArrays)
: checks if the the actual outcome of function with arrays in it is as expected and prints a messagefunction3(AssertObjectEqual)
: checks if the the actual outcome of function with objects in it is as expected and prints a messagefunction4(countLetters)
: counts the number a letter was used in a given stringfunction5(countOnly)
: counts the number an item was repeated in a given arrayfunction6(EqArrays)
: checks if two arrays are equalfunction7(EqObjects)
: checks if two objects are equalfunction8(findKey)
: finds a certain key in an object based on a callback functionfunction9(findKeyByValue)
: takes an object and a value and returns the key for that valuefunction10(flatten)
: flattens the nested arrays and the main array into one arrayfunction11(head)
: returns the first item in an arrayfunction12(tail)
: returns the same array after removing the first item in an arrayfunction13(letterPositions)
: returns all the indexes of a given letter in a stringfunction14(map)
: returns the first letter of every item in an array of stringsfunction15(middle)
: returns the middle index of an odd-indexed array or the two middle indeces of an even-indexed arrayfunction16(takeUntil)
: loops through an array and retuns each item until reaching a condition set by a callback functionfunction17(without)
: takes 2 arrays and returns an array and returns without the items included in the first array
1.0.0
4 years ago