1.0.1 • Published 8 months ago

@stormblend/lotide v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

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 @stormblend/lotide

Require it:

const _ = require('@username/lotide');

Call it:

const results = _.tail([1, 2, 3]) // => [2, 3]

Documentation

The following functions are currently implemented:

head(...): Find the head of an array.

tail(...): Find the tail elements of an array.

middle(...): Find the middle element(s) of an array.

assertEqual(...): Assert two values are strictly equal.

eqArrays(...): Check if two arrays are equal.

assertArraysEqual(...): Assert two arrays are equal.

eqObjects(...): Check if two objects are equal.

assertObjectsEqual(...): Assert two objects are equal.

map(...): Perform the same set of operations on each element of an array.

findKey(...): Find the key in an object for a value that satisfies a predicate.

findKeyByValue(...): Find the key in an object, given its value.

countOnly(...): Count occurences of only the specified items in an array.

countLetters(...): Count occurences of the specified letter in a string.

letterPositions(...): Find the indices in a string where a particular character appears.

takeUntil(...): Return all elements of an array before the first element that satisfies a predicate.

without(...): Return the first array after removing from itall elements that also appear in the second array.

1.0.1

8 months ago

1.0.0

8 months ago