1.0.1 • Published 1 year ago
@conlanschool/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 @conlanschool/lotide
Require it:
const _ = require('@conlanschool/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
: Assertion test for arraysfunction2(assertEqual)
: Assertion test for valuesfunction3(assertObjectsEqual)
: Assertion test for objectsfunction4(countLetters)
: Counts the character in a stringfunction5(countOnly)
: Counts only the specified value in an arrayfunction6(eqArrays)
: Compares arrays to determine if equalfunction7(eqObjects)
: Compares objects to determine if equalfunction8(findKey)
: Finds a key from a callback functionfunction9(findKeyByValue)
: Finds a key from a given valuefunction10(flatten)
: Reduces nested arrays by a levelfunction11(head)
: Returns the first element of an arrayfunction12(letterPositions)
: Creates an objects to record indes values of characters in a stringfunction13(map)
: Transforms an array based on the callback functionfunction14(middle)
: Returns the middle value of an arrayfunction15(tail)
: Returns an array of every element in an array except the firstfunction16(takeUntil)
: Returns an array of values until a condition is metfunction17(without)
: Returns an array with selected items excluded