@pheyboer/lotide
v1.0.1
Published
A Replica Directory: Lotide
Downloads
13
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 @pheyboer/lotide
Require it:
const _ = require('@pheyboer/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual:
: Function to compare if two arrays are equalassertEqual
: Function to compare if two values are equalassertObjectsEqual
: Function to compare if two objects are equalcountLetters
: Function to count each of the letters in a stringcountOnly
: Function to count how many times specific items appear in an arrayeqArrays
: Function to check if two arrays are equaleqObjects
: Function to check if two objects are equalfindKey
: Function to search through keys of an object and return the first key defined by a callback functionfindKeyByValue
: Function to search for the first key in an Object by a given valueflatten
: Function to flatten a nested array into single level arrayhead
: Function that returns first element of an arrayletterPositions
: Function to return an object that maps each letter of a string to an array, identifying its indiciesmap
: Fucntion to return an array based on results of the callback functionmiddle
: Function to find middle element of an arraytail
: Function to return new array containing all elements except first one of inital arraytakeUntil
: Function to create new array as a slice of original arraywithout
: Function to create a new array, removing specific elements