1.0.1 • Published 2 years ago
@dustingrof/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. It is some of my very first programming using javascript.
Usage
Install it:
npm install @dustingrof/lotide
Require it:
const _ = require('@dustingrof/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head()
: get first item in an arraytail()
: get last item in an arraymiddle()
: get middle item/items in an arraycountLetters()
: count the letters in a stringcountOnly()
: count only specific thingsfindKey()
: find the key in an objectfindKeyByValue()
: find key by valueletterPositions()
: find the position of a letter in a stringmap()
: a simple version of maptakeUntil()
: take the first part of an array up untilwithout()
: return an array without certain itemsassertArraysEqual()
: assert if arrays sure arrays are equalassertEqual()
: compare two strings and assert if they are equaleqObjects()
: check if objects are equaleqArrays()
: return true or false if arrays are equal