1.0.0 • Published 3 years ago

@sxj80353317/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years 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 @andysoso1/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertEqual: return true if 2 item are strictly equal
  • assertObjectsEqual: return true if 2 object are strictly equal
  • assertArraysEqual: return true if 2 array are strictly equal countLetters: returns counts of each letter in a string countOnly: takes items and returns counts the occurence of item eqArrays: compares 2 arrays eqObjects: compares 2 objects findKey: scans the object and return the first key for which the callback returns a truthy value findKeyByValue: searches for a key on an object where its value matches a given value flatten: flattens an array of arrays into a one array head: first item ofthe array letterPositions: returns all the indexin of string map: creates a new array with the results of calling a provided on every element in the calling array middle: returns the middle element of an array tail: return item of array except 1st one takeUntil: retrun all item that match until callback without: remove item from array `