@ryguyroberts/lotide
v1.0.1
Published
A student learning project to recreate some of the functions offered by Lodash
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 @rrober01/lotide
Require it:
const _ = require('@rrober01/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
Tail(...)
: Returns values in array other than the first index value 0Middle(...)
: Returns the middle value of an arrayhead(...)
: Returns only the first element in an array at index 0CountLetters(...)
: Count how many times a letter occurs in a stringCountOnly(...)
: Counts only the defined keys in an objectfindKey(...)
: Finds the name of a key in an object based off a value provided in a callbackfindKeyByValue(...)
: Finds the name of a key in an object based off a value providedflatten(...)
: Turns a array with nested arrays into a single level arraytakeUntil(...)
: Input values in an array to a new array, until it reaches a provided valueletterPosition(...)
: Take a string and outputs and object with letters and there index position.without(...)
: Input values into a new array, taking an argument for values to leave out of the new arrayassertArraysEqual(...)
: Asserts two arrays are equalassertEqual(...)
: Assert two values are equalassertObjectsEqual(...)
: Asserts two objects are equaleqArrays(...)
: Compares two arrays to each othereqObjects(...)
: Compares two objects to each other