1.0.0 • Published 1 year ago

@ashwinihegde28/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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 @ashwinihegde28/lotide

Require it:

const _ = require('ashwinihegde28/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: Checks if our assertion of arrays are equal
  • assertEqual: Checks if our assertion of statements are equal
  • assertObjectsEqual: Checks if our assertion of objects are equal
  • countLetters: Counts the letters in a string
  • countOnly: Counts items in an array and adds it to an object
  • eqArrays: Checks our array parameters are equal
  • eqObjects: Checks to make sure our objects are equal
  • findKey: Finds the beginning letter of a string
  • findKeyByValue: Search for a key on an object where its value matches a given value
  • flatten: Flattens an array
  • head: Gets the first element of array
  • letterPositions: Return all indices in the string where each character is found
  • map: Return a new array based on the results of the callback function
  • middle: Grabs the middle of an array
  • tail: Grabs all but the first element of array
  • takeUntil: Takes all the values out of an array or string until specified condition
  • without: Creates an array excluding all given values
1.0.0

1 year ago