1.0.0 • Published 3 years ago
@morriganh/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 @morriganh/lotide
Require it:
const _ = require('@morriganh/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual): asserts to console if two arrays are equalfunction2(assertEqual): asserts to console if two primitive values are equalfunction3(assertObjectsEqual): asserts to console if tow objects are equalfunction3(countLetters): keeps a tally of how many times each letter appears in a stringfunction3(countOnly): keeps a tally of how many times requested values appear in an arrayfunction3(eqArrays): determines if two arrays are equalfunction3(eqObjects): determines if two objects are equalfunction3(findKey): returns the first key in an object that meets a given criteriafunction3(findKeyByValue): when given a value, returns a key that has that value from an objectfunction3(flatten): flattens a two-dimensional array into a one-dimensional arrayfunction3(head): returns the first element of an arrayfunction3(letterPositions): stores every index of each letter in a string into an objectfunction3(map): performs some transformation on each element of an array and returns a new arrayfunction3(middle): returns the central values from an arrayfunction3(tail): returns all but the first element of an arrayfunction3(takeUntil): returns the beginning of a given array, up until a given criteria is metfunction3(without): returns a new array with specified values removed from an origional array
1.0.0
3 years ago