1.0.0 • Published 4 years ago
@t.do/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 @t.do/lotide
Require it:
const _ = require('@t.do/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: A function that asserts if two arrays are equalsassertEqual
: A function that asserts if two values are equalsassertObjectsEqual
: A function that asserts if two objects are equalscountLetters
: A function that returns the count of each letter of a stringcountOnly
: A function that takes items and returns counts for a specfic subset of those itemseqArrays
: A function that compares two arrayseqObjects
: A function that compares two objectsfindKey
: A function that searches an object and returns the first key from which the callback returns a truthy valuefindKeyByValue
: A function that searches for a key in an object and returns the matching value of a given valueflatten
: A function that flattens nested arrays into one arrayhead
: A function that returns the first element in an arrayindex
: A list of all the function in an objectletterPositions
: A function that returns an array with the indexs of a string of where they were foundmap
: A function that creates a new array that returns the results by calling a callback functionmiddle
: A function that returns the middle element(s) of an arraytail
: A function that that returns every element of an array except the first one(first element)takeUntil
: A function that returns a slice of the array with elements taken from the beginningwithout
: A function that removes elements from an array
1.0.0
4 years ago