@pflugs/lotide
v1.0.0
Published
Lotide library (mock Lodash) assignment for Lighthouse Labs
Downloads
4
Readme
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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: Retreives the first element of the arraytail(...)
: Retreives everything except first element of the array.assertEqual(...)
: Helps to test our code. Compares primitive types suchs as numbers or strings.assertArraysEqual(...)
: Asserts if two arrays are equal.assertObjectsEqual(...)
: Asserts if two objects are equal.eqArrays(...)
: Takes two arrays and returns true or false depending on if they match.without(...)
: Removes desired items from an arrayby compairing.takeUntil(...)
: Returns an array of only desired elements.map(...)
: A new array is returned with the results of the callback function.letterPositions(...)
: Returns all of the locations (indexes) in the string of where characters are found.findKeyByValue(...)
: Searches for a specified key in an object.eqObjects(...)
: Returns true if both compared objects are identical, or it will return false.countOnly(...)
: Counts specified elements such as strings.countLetters(...)
: Takes a sentance (string) and returns a count of each letter in the sentance.