1.0.0 • Published 4 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(assertEqual): checks the actual and expected values from a function and prints a corrolating message
  • function2(AssertEqualArrays): checks if the the actual outcome of function with arrays in it is as expected and prints a message
  • function3(AssertObjectEqual): checks if the the actual outcome of function with objects in it is as expected and prints a message
  • function4(countLetters): counts the number a letter was used in a given string
  • function5(countOnly): counts the number an item was repeated in a given array
  • function6(EqArrays): checks if two arrays are equal
  • function7(EqObjects): checks if two objects are equal
  • function8(findKey): finds a certain key in an object based on a callback function
  • function9(findKeyByValue): takes an object and a value and returns the key for that value
  • function10(flatten): flattens the nested arrays and the main array into one array
  • function11(head): returns the first item in an array
  • function12(tail): returns the same array after removing the first item in an array
  • function13(letterPositions): returns all the indexes of a given letter in a string
  • function14(map): returns the first letter of every item in an array of strings
  • function15(middle): returns the middle index of an odd-indexed array or the two middle indeces of an even-indexed array
  • function16(takeUntil): loops through an array and retuns each item until reaching a condition set by a callback function
  • function17(without): takes 2 arrays and returns an array and returns without the items included in the first array