1.0.1 • Published 4 years ago
@fairlydecent/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 @fairlydecent/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual): prints assertion message for arraysfunction2(assertEqual): prints assertion message for primitive datafunction3(assertObjEqual): prints assertion message for objectsfunction4(countLetters): counts number of each letter in a stringfunction5(countOnly): counts from an object only what is specifiedfunction6(eqArrays): asserts if arrays are equalfunction7(eqObjects): asserts if objects are equalfunction8(findKey): finds a key in an objectfunction9(findKeyByValue): finds a key by a valuefunction10(flatten): flattens a nested arrayfunction11(head): returns the first element in an arrayfunction12(tail): returns everything but the first element of an arrayfunction13(middle): returns the center two elements of an arrayfunction14(letterPositions): returns an object with the index of each letter in a stringfunction15(map): returns a new array based on conditions specifiedfunction16(takeUntil): returns an array of elements until a specified condition is metfunction17(without): returns an array after the removal of a spcified element