1.0.2 • Published 1 year ago
@britt4444/lotide v1.0.2
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 @britt4444/lotide
Require it:
const _ = require('@britt4444/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: asserts strict equality between 2 arraysassertEqual
: asserts strict equality between 2 valuesassertObjectsEqual
: asserts strict equality between 2 objectscountLetters
: returns an object that counts all letters from a string inputcountOnly
: returns an object of counted letters from a string as requested by specifying objecteqArrays
: returns true/false strictly comparing 2 arrayseqObjects
: returns true/false strictly comparing key/value pairs of 2 objectsfindKey
: returns a key (if it exists) in an object based on truthy callback valuefindKeyByValue
: returns first object key in which a search value is foundflatten
: takes in array that contains nested arrays and returns a flattened versionhead
: returns the first value of an arrayletterPositions
: returns object that lists all indices of each character from input stringmap
: returns new array based on results of a callback functionmiddle
: returns middle-most elements of an arraytail
: returns all but the first value of an arraytakeUntil
: returns a slice of an array up until callback condition is metwithout
: returns a subset of a given array, removing unwanted items