1.0.1 • Published 3 years ago
@habib.codes/lotide v1.0.1
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 @habib.codes/lotide
Require it:
const _ = require('@habib.codes/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(a, b)
: assert test of deep equality between two arraysassertEqual(actual, expected)
: asserts strict equality between two valuesassertObjectsEqual(actual, expected)
: assert test of deep equality between two objectscountLetters(string)
: counts the total number of each letter's occurance in a stringcountOnly(allItems, itemsToCount)
: counts the total number of times an item appears in an arrayeqArrays(a, b)
: asserts deep equality between two arrayseqObjects(object1, object2)
: asserts deep equality between two objectsfindKey(object, callback)
: finds and returns keys from object based on condition of callbackfindKeyByValue(object, value)
: finds key by value passed in to second parameterhead(array)
: returns an array's element at index zeroletterPositions(string)
: returns the position of letters in a string based on their indexed locationmap(array, callback)
: uses a callback to map and return values to input arraymiddle(array)
: finds the exact middle value in an unsorted arraytail(array)
: returns all elements after index zerotakeUntil(array, callback)
: creates a new array from all values upto the value that satisfies the callback conditionwithout(source, itemsToRecover)
: returns a subset of a given array, removing unwanted elements
Description
A Mini-Lodash library that simplifies 16 functions as well as automating robut tests.
Author
{ "author": "Zai habib.codes@gmail.com" }
Version
"1.0.1"