1.0.0 • Published 5 years ago

@yungcomputer/lotide v1.0.0

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(countLetters): counts letters in a given string
  • function2(countOnly): counts and returns only the values specified in a list
  • function3(findKey): finds the given key in an object
  • function4(findKeyByValue): finds the key in an object using given value
  • function5(flatten): changes an array with sub arrays to one single array
  • function6(head): returns the head (first element) of a list
  • function7(letterPositions): returns the positions of the letters in a string
  • function8(map): returns the first letter of each string instance in an array
  • function9(middle): returns the middle value of an array and the middle two values of an array if the array length is an even number
  • function10(min): returns the smallest value in a list
  • function11(asertArrraysEqual): assertion to determine if two arrays are equal or not
  • function12(assertEqual): assertion test if to given parameters are equal
  • function13(assertObjectsEqual): assertion test if two objects are equal
  • function14(eqArrays): determines if two arrays are the same
  • function15(eqObjects): determines if two objects are the same
  • function16(tail): returns the last item of an array
  • function17(takeUntil): prints out a list until parameter given
  • function18(without): returns an array with given parameter taken out of the original array