1.0.0 • Published 2 years ago
@bluedev773/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 @bluedev773/lotide
Require it:
const _ = require('@bluedev773/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arrOne, arrTwo)
: determines if two arrays are equalassertEqual(actual, expected)
: determines if two operands are equalassertObjectsEqual(objOne, objTwo)
: determines if two objects are equalcountLetters(string)
: counts letters in a stringcountOnly(arr, itemsToCount)
: counts specified items in arrayfindKey(object, callback)
: return key specified by callback functionfindKeyByValue(object, value)
: return key specified by valueflatten(arr)
: remove nested arrays and return all elements as a single arrayhead(arr)
: return first element of arrayletterPositions(string)
: return object that holds each unique character of the string as a key and an array of indexes to the characters in the stringmap(arr, callback)
: creates a new array populated with the results of calling a provided function on every element in the calling arraymiddle(arr)
: returns middle of arraytail(arr)
: returns tail of arraytakeUntil(arr, callback)
: returns original array until callback requirement is metwithout(arr, remove)
: returns array with specified element removed
1.0.0
2 years ago