1.0.0 • Published 4 years ago
@s-abdale/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 @s-abdale/lotide
Require it:
const _ = require('@s-abdale/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: checks whether an array is equal to the expected outputassertEqual: checks whether a string is equal to the expected outputassertObjectsEqual: checks whether an object is equal to the expected outputcountLetters: counts the frequency of a letter's occurrence in a stringcountOnly: filters an array's contents based on an object, then returns frequency of each value's occurrence in the arrayeqArrays: checks if two arrays are the sameeqObjects: checks if two objects are the samefindKey: checks values in a nested object, then returns the parent keyfindKeyByValue: searches through an object for a value, then returns a keyhead: returns the first value in an arrayletterPositions: returns the index of a letter within a sentencemap: iterates through an array and returns attributes of the array based on varying inputs in the callback functionmiddle: returns the middle value in an arraytail: returns all values in an array except for the headtakeUntil: iterates through an array and prints values, until a given value occurswithout: compares two arrays, and returns the unique values that are in array A but not in array B
1.0.0
4 years ago