1.0.0 • Published 4 years ago

@beakwan/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 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 @beakwan/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(assertArraysEqual): Console logs an assertion message if two arrays are equal or not
  • function2(assertEqual): Console logs an assertion message if two primitive values are equal or not
  • function3(assertObjectsEqual): Console logs an assertion message if two objects are equal or not
  • function4(countLetters): Returns an object containing a count of all letters in a given string
  • function5(countOnly): Returns an object containing a count of specified letters in a given string
  • function6(eqArrays): Returns a boolean based on the equality of two given arrays
  • function7(eqObjects): Returns a boolean based on the equality of two given objects
  • function8(findKey): Returns the first key of a given object for which the given callback function returns truthy
  • function9(findKeyByValue): Returns the first key of a given object that contains a given value
  • function10(head): Returns the first value of a given array
  • function11(letterPositions): Returns an object containing the letters of a given string with their indices as values
  • function12(map): Returns a new array of values that have each been altered based on a given callback function
  • function13(middle): Returns the middle or middle two values of a given array
  • function14(tail): Returns all but the first item in a given array
  • function15(takeUntil): Returns an array of items from a given array until a given callback is fulfilled
  • function16(without): Returns an array of items based on a given array, removing items listed in a second given array
1.0.0

4 years ago