1.0.0 • Published 1 year ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(head): returns the first element in an array
  • function2(tail): returns all the elements in an array except the first
  • function3(middle): takes in an array and returns the middle most elements
  • function4(assertArraysEqual): compares two arrays to see if they are the same and gives an assertion passed or assertion failes
  • function5(assertEqual): compares actual and expected and prints out if assertion passed or failed
  • function6(eqArrays): compares two arrays and returns a true or false
  • function7(assertObjectsEqual): will take in two objects and compare them and return an actual and expected result
  • function8(countLetters): takes in a sentence as a string and returns a count of each of the letters in that sentence
  • function9(countOnly): takes in an array and an object and returns an object with the counts of everything the input object listed
  • function10(eqObjets): compares two objects and returns a true or false
  • function11(findKeyByValue): takes in an object and a value and returns the first key which contains the given value
  • function12(letterPositions): returns all the indices in a string where each character is found
  • function13(map): returns a new array based on the callback function
  • function14(without): compares two arrays and returns a new array with only the elements from the first array that are not present in the second
  • function15(takeUntil): returns a slice of the array with element taken from the beginning
  • function16(findKey): takes in an object and a callback, scans the object and returns the first key which returns a truthy value
1.0.0

1 year ago