1.0.1 • Published 4 years ago
@wavyadri/lotide v1.0.1
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 @wavyadri/lotide
Require it:
const _ = require('@wavyadri/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(): assert two arraysassertEqual(): assert two literalsassertObjectsEqual(): assert two objectscountLetters(): return occurance of each letter of a stringcountOnly(): count the occurance of a single item in an arrayeqArrays(): test if two arrays are equal or noteqObjects(): test if two objects are equal or notfindKey(): return keys of an objectfindKeyByValue(): return the key corresponding to input valueflatten(): return flattened nested arrayhead(): return the first index element of an arrayletterPositions(): return position of specified letter in a stringmap(): implementation of JS map functionmiddle(): return the most middle element in an odd array, and middle two elements of an even arraytail(): return the array without first elementtakeUntil(): return an array with elements until a specified itemwithout(): return a new array without specified element