1.0.0 • Published 3 years ago
@lucas_johannson/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 to check if two arrays are identicalassertEqual
: Tests that two literals are equalassertObjectsEqual
: Tests to check if two objects are identicalcountLetters
: gives the occurances of letters in a stringcountOnly
: returns the occurances of a single itemeqArrays
: Tests if two arrays are equaleqObjects
: Tests if two objects are equalfindKey
: returns the keys of an objectfindKeyByValue
: Returns the key corresponding to a value in an objecthead
: Returns the first element in an arrayindex
: object for holding all the function calls of this libraryletterPosition
: Returns the position of a specified letter in a stringmap
: implementation of JS's map function on MDNmiddle
: Returns the middle elment(s) of an arraytail
: Returns a new array omiting the first elementtakeUntil
: returns an array with elements until a specified itemwithout
: removes a specified item from an array
1.0.0
3 years ago