1.0.0 • Published 5 years ago
@loloffs/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 @loloffs/lotide
Require it:
const _ = require('@loloffs/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertEqual): asserts if two values are equal (===) or notfunction2(eqArrays): return true if two arrays are equal and false if notfunction3(assertArraysEqual): same as eqArrays but with added pass/fail commentsfunction1(eqObjects): return true if two objects are equal and false if notfunction1(assertObjectsEqual): same as eqObjects but with added pass/fail commentsfunction1(countLetters): counts how many letters are in a given stringfunction1(findKeyByValue): find key in object by valuefunction1(findKey): find key in object by valuefunction1(head): returns first value in an arrayfunction1(tail): returns all values in array except the first valuefunction1(middle): returns the middle value(s) in an arrayfunction1(takeUntil): print out array until given valuefunction1(without): takes an array, and a second array that includes what to remove from array 1function1(countOnly): counts only desired itemsfunction1(letterPositions): prints out the index of every letter in a stringfunction1(map): calls provided function on every element in provided array
1.0.0
5 years ago