1.0.0 • Published 1 year ago
@jagan-creator/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 @Jagan-creator/lotide
Require it:
const _ = require('@Jagan-creator/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: function that outputs the first indexed item in an arraytail
: function that output the tail of an arraymiddle
: function that returns the middle item of an array or the two most middle itemsassertArraysEqual
: assertion that checks to see if two arrays ar equal to each otherassertEqual
: assertion that checks to see if two items are equal to each otherassertObjectsEqual
: assertion that checks to see if two objects are equal to each othercountLetters
: function that outputs the number of letters in a stringcountOnly
: function that takes in a set of items and returns the count for that specific subset of itemseqArrays
: function that checks to see if two arrays are equaleqObjects
: function that checks to see if two objects are equalfindKey
: function that looks through an object and returns the first truthy itemfindKeyByValue
: function that looks through and object until it matches a specified input valueflatten
: function that takes in nested arrays and changes them into a single-line arrayletterPositions
: function that tells us where the specified letters are within an array based on their index positionmap
: function that will output a new array with each of the specified index items of that arraytakeUntil
: function that returns a partial array of the inital array once it has identified the given argumentwithout
: functions that removes items from the given array if they do not match the second input array
1.0.0
1 year ago