1.0.0 • Published 11 months ago

@tolu_woms/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months 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 @tolu_woms/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(head): outputs the first element of an array
  • function2(tail): outputs other elements of an array minus the head
  • function3(middle): outputs the middle (2 middle if even) elements of an array
  • function4(assertArraysEqual): asserts that the expected and actual values of an array are the same
  • function5(assertEqual): asserts that expected and actual values are equal
  • function6(assertObjectEqual): asserts that the expected and actual values of an object are the same
  • function7(countLetters): outputs the number of count a letter appears in a sentence
  • function8(countOnly): outputs the number of times an item occurs in an object
  • function9(eqArrays): outputs true if two arrays are the same and false if not
  • function10(eqObjects): outputs true if two objects are the same and false if not
  • function11(findKey): outputs the key used to callback an object
  • function12(findKeyByValue): outputs the key of an object by using the key's value to access the object
  • function13(flatten): accesses nested arrays to output an array
  • function14(letterPositions: outputs the index position of a letter in a sentence
  • function15(map): outputs a new array using a callback function
  • function16(takeUntil):outputs result array after callback function is executed
  • function17(without): outputs an array less specified item
1.0.0

11 months ago