1.0.1 • Published 3 years ago
@itsyurika/lotide v1.0.1
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 @itsyurika/lotide
Require it:
const _ = require('@itsyurika/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: Asserts strict equality of actual array and expected arrayassertEqual
: Asserts strict equality of actual and expected primitive valueassertObjectsEqual
: Asserts strict equality of actual and expectedcountLetters
: Counts occurances of each alphabet in a given stringcountOnly
: Counts occurances of specific element(s)eqArrays
: Checks strict equality of two arrayseqObjects
: Checks strict equality of two objectsfindKey
: Returns the first key for which the callback returns a truthy value from an objectfindKeyByValue
: Searches for a key on an object that matches a given valueflatten
: Given a single nested array, flattens into a single-level arrayhead
: Retrieves the first element of argument arrayletterPositions
: Returns all the indices of each character in stringmap
: Iterates over given array and applies given callback functionmiddle
: Retrieves middle element of an array, two elements if even number of elementstail
: Retrieves every element except the head of the arraytakeUntil
: Collects items from a provided array until the callback provided returns a truthy valuewithout
: Returns an array after removing unwanted elements