1.0.0 • Published 3 years ago
@b-waterman/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 @b-waterman/lotide
Require it:
const _ = require('@b-waterman/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: function that asserts whether two arrays are equalassertEqual: A function that asserts whether two values are equalassertObjectEqual: A function that asserts whether two objects are equalcountLetters: A function that returns the total number letters of a given stringcountOnly: A function that receives a string and only returns the total of the selected items within iteqArrays: A function that compares two arrayseqObjects: A function that compares two objectsfindKey: A function that takes in an object and returns the first key to return truthyfindKeyByValue: A function that returns the key with the matching valuehead: A function that returns the first element of an arrayletterPositions: A function that returns the indices of each character in a given stringmap: A function that calls a function on every element in an array and returns a new array of the resultmiddle: A function that returns the middle element of a given arraytail: A function that retrieves the elements of the original array and returns a new array, excluding the first elementtakeUntil: A function that slices a given array and returns a new array with elements from the beginningwithout: A function that removes selected elements from an array
1.0.0
3 years ago