1.0.0 • Published 5 years ago
@bjam091/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 @bjam091/lotide
Require it:
const _ = require('@bjam091/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual
: assert that two values are equal and display the result in the console.logassertArraysEqual
: assert two arrays are equal and display the result in the console.logassertObjectsEqual
: assert two objects are equal and display the result in the console.logcountLetters
: count the number of letters in a stringcountOnly
: count the number of objects in an array and return the number of the specified valueseqArrays
: checks to see if two arrays are the sameeqObjects
: checks to see if two objects are the samefindKey
: finds the key of an objectfindKeyByValue
: finds the key by using the valuesflatten
: flatten nested arrays down to a signle arrayhead
: brings back the first object in an arrayletterPositions
: returns the zero-based position in a string when a specific character is foundmap
: returns a new array based on the results of the callback functionmiddle
: brings back the middle object in an arraytakeUntil
: will return a slice of the array after it hits a specific value to stoptail
: brings back everything but the first item in an arraywithouts
: removes items from the first array, based on the specifications of the second array
1.0.0
5 years ago