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 @ahrke/lotide
Require it:
const _ = require('@ahrke/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(Array)
: returns the first item in given arraytail(Array)
: returns all values in array minus the first elementmiddle(Array)
: returns the middle elements of given arrayflatten(Array)
: returns the a flattened version of given array (works with super nested ones too!)countOnly(Array, Object)
: Takes in an array, and an object identifying what value to count from the arrayletterPositions(String)
: returns an object with each letter from given string, as well as their positions inside the stringfindKeyByValue(Object, valueToSearch)
: searches through object for a key with the given valueToSearch. Returns the keyeqArrays(arr1, arr2)
: Takes in two arrays and returns true when both are strictly equal, and false otherwiseeqObjects(obj1, obj2)
: Takes in two objects and returns true when both are strictly equal, and false otherwise