1.0.0 • Published 4 years ago
@djar84/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 @djar84/lotide
Require it:
const _ = require('@djar84/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: Assertion test for eqArraysassertEqual(...)
: Compares if two values are equalassertObjectsEqual(...)
: Assertion test for eqObjectscountLetters(...)
: Counts the amount of individual letters that are in a given stringcountOnly(...)
: When passed an array, it counts the number of times the inputed element shows upeqArrays(...)
: Compares two arrays to check if they are equaleqObjects(...)
: Comapres two objects to check if they are equalfindKey(...)
: Finds a particular key within an objectfineKeyByValue(...)
: Finds an object key, based on the inputed valuehead(...)
: When given an array of elements, head returns the first element of the arrayindex(...)
: Index which exports all functions as an objectletterPositions(...)
: When given a string, returns the character position or positions in an arraymap(...)
: When given an array of strings, returns the first character of each string, an a new arraymiddle(...)
: When given an array, it will return the middle element(if odd amount in array) or elements (if even). Returns empty if two or less elements in array passedtail(...)
: Removes the first element of an array and returns the remainder elements as an arraytakeUntil(...)
: When given an array, it will return a new array with the same elements until a chose pointwihtout(...)
: Removes an element of choice from and array, and returns new array
1.0.0
4 years ago