1.0.0 • Published 4 years ago
@danek.f/lotide v1.0.0
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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: tests and asserts whether two arrays are equalassertEqual: tests and asserts whether two strings/numbers are equalassertObjectsEqual: tests and asserts whether two objects are equalcountLetters: counts the letters in a stringeqArrays: tests and asserts whether two arrays are equaleqObjects: tests and asserts whether two objects are equalfindKey: takes in an object and a callback, return first key from the object that has a valuefindKeyByValue: finds a key with value specifiedflatten: removes nesting from arrayshead: returns value at index 0 of an arrayletterPositions: returns positions of letters as an objectmap: descriptionmiddle: returns middle value(s) of an arraytail: returns array while removing item at index 0takeUntil: returns all items in an array until a certain element is foundwithout: removes items from source array and returns a filtered array
1.0.0
4 years ago