lubi25_lotide
v1.0.1
Published
A mini clone of the Lodash library
Downloads
3
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 @lubi25_lotide
Require it:
const _ = require('@lubi25_lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: Asserts whether two arrays are equalassertEqual
: Asserts if values match and prints whether the assertion passes or failsassertObjectsEqual
: Compares functions that return as objectscountLetters
: Counts how many times a letter appears in the a given stringcountOnly
: Takes in a collection of items and return counts for a specific subset of those itemseqArrays
: Compares two arrays for a perfect matcheqObjects
: Compares two objects for a perfect matchfindKey
: Scans an object and returns the first key for which the callback returns a truthy valuefindKeyByValue
: Scans an object and returns the first key which contains the given valueflatten
: Returns a 'flattened' version of given arrayshead
: Retrieves the first element from an arrayletterPositions
: Returns all the indices in a string where each character is foundmiddle
: Retrieves the middle element from an arraytail
: Retrieves the last element from an arraytakeUntil
: Returns a slice of an array with elements taken from the beginning until the callback/predicate returns a truthy valuewithout
: Returns a new array with only those elements fromsource
that are not present in theitemsToRemove
array