1.0.0 • Published 3 years ago
@lemmonk/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 @lemmonk/lotide
Require it:
const _ = require('@lemmonk/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(_.assertEqual)
: tests a functions return value given primitive value.function2(_.assertArrayEqual)
: tests a functions return value given an array.function3(_.assertObjectEqual)
: tests a functions return value given an object.function4(_.eqArrays)
: returns true if a given array is equal to an expected array.function5(_.eqObjects)
: returns true of a given object is equal to an expected object.function6(_.head
: returns the first element of array, if applicaable.function7(_.middle)
: returns the middle element(s) of an array, if applicable.function8(_.tail)
: returns all but the first element(s) of an array, if applicable.function9(_.countLetters)
: returns how many times each letter appears within a given string.function10(_.letterPositions)
: returns the index of each letter in a given string.function12(_.findKey)
: returns the first object key matching a given value.function13(_.findKeyByValue)
: returns an objects key given an objects value.function14(_.flatten)
: returns a single array from an array with nested arrays.function15(_.map)
: returns the first letter of each element in an array.function16(_.takeUntil)
: returns an array of values until a given value is met.function17(_.without)
: returns a new array from a given array without a specified value.function18(_.index)
: exports all of this libraries functions.
1.0.0
3 years ago