1.0.0 • Published 3 years ago
@ktam1/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 @ktam1/lotide
Require it:
const _ = require('@ktam1/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: assertion for equality between 2 arraysassertEqual(...)
: assertion for equality between 2 primtiivesassertObjectsEqual(...)
: assertion for equality between 2 objectscountLetters(...)
: returns an object with counts for each letter in the inputcountOnly(...)
: returns an object with counts for the specified itemseqArrays(...)
: returns boolean for equality between 2 arrayseqObjects(...)
: returns boolean for equality between 2 objectsfindKey(...)
: retrieves a key by specified callbackfindKeyByValue(...)
: retrieves a key by its valueflatten(...)
: flattens nested array into a 1D arrayhead(...)
: retrieves head (1st element) of arrayletterPositions(...)
: returns an array of the positions of the letters in the inputmap(...)
: performs callback on each element in the array and returns an arraymiddle(...)
: retrieves the middle element(s) of arraytail(...)
: retrieves tail (all elements except head) of arraytakeUntil(...)
: retrieves elements in an array up until a specified pointwithout(...)
: returns an array without the specified items in input array
1.0.0
3 years ago