1.0.0 • Published 4 years ago
@t.pirozzini/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 @t.pirozzini/lotide
Require it:
const _ = require('@t.pirozzini/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual(actual, expected)): asserts arraysfunction2(assertEqual(actual, expected)): asserts valuesfunction3(assertObjectsEqual(actual, expected)): asserts objectsfunction4(countLetters(str)): counts letters in a stringfunction5(countOnly(allItems, itemsToCount)): counts objectsfunction6(eqArrays(arr1, arr2)): compares arraysfunction7(eqObjects(obj1, obj2)): compares objectsfunction8(findKeyByValue(object, value)): returns object key valuefunction9(findKey(object, callback)): return first key of objectfunction10(head(arr)): returns first element of an arrayfunction11(letterPositions(sentence)): returns index of charactersfunction12(map(arr, callback)): applies callback to each elementfunction13(middle(arr)): returns middle element in an arrayfunction14(tail(arr)): returns the array without the first elementfunction15(takeUntil(array, callback)): returns elementss until callback elementfunction16(withoutfunction(source, itemsToRemove)): returns an array without the filtered items
1.0.0
4 years ago