@esmith80/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 @esmith80/lotide
Require it:
const _ = require('@esmith80/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(array1, array2)
: descriptionassertEqual(actual, expected)
: descriptionassertObjectsEqual(actual, expected)
: descriptioncountLetters(str)
: descriptioncountOnly(allItems, itemsToCount)
: takes in 2 arguments: 1) an arrayallItems
(strings only) and 2) an objectitemsToCount
which tracks counts for a specific subset of those items (object format is key:value pair where key is string to search for and value is trueeqArrays(array1, array2)
: descriptioneqObjects(obj1, obj2)
: descriptionfindKey()
: descriptionfindKeyByValue(obj, string)
: takes 1) object and 2) string - returns a key if the string is found (exact match) in that object, undefined if not foundhead(array)
: descriptionletterPositions(string)
: takes in 1 argumentstring
and returns an object with counts for the occurence of each letter in that stringmap()
: descriptionmiddle()
: descriptiontail()
: descriptiontakeUntil()
: descriptionwithout()
: description
4 years ago