npm.io
1.0.0 • Published 5 years ago

@cookie-cpu/lotide

Licence
ISC
Version
1.0.0
Deps
0
Size
32 kB
Vulns
0
Weekly
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 @cookie-cpu/lotide

Require it:

const _ = require('@cookie-cpu/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • eqArrays(): Compares 2 arrays and returns true if equal

  • eqObjects(): Compares 2 objects and returns true if equal

  • countLetters(): Takes in a string and returns an object listing each letters occurence

  • findKey(): Searches an object for a key using a callback function

  • findKeyByValue(): Searches an object and returns the key based on the given value

  • head(): Takes an array and returns the first element of the array

  • middle(): Takes an array and returns the values in the middle index of the array

  • tail(): Takes an array and splits the first element from the rest

  • without(): Takes an array and a list of elements to remove and iterates through the array removing those items

  • function1(...): description

  • function2(...): description

  • function3(...): description

Keywords