@programming_code/lotide

1.0.0 • Public • Published

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: This function takes two arrays as input and prints assertion failed if two arrays are not the same and passed if not.
  • assertEqual: This function takes two arguments as input and pritns assertion passed if two arguments are the same and assertion failed if not.
  • assertObjectsEqual: This function takes two objects as input and prints assertion passed if two objects are the same and assertion failed if not.
  • countLetters: This function takes a string and returns the object that contains each letters as key and the number of key repeatation.
  • countOnly: This function counts the number of the items that are passed by user and return the object.
  • eqArrays: This function returns true if two arrays are the same and false if not.
  • eqObjects: This function returns true if two objects are the same and false if not.
  • findKey: This function returns a key when the arugment function returns true with the object.
  • findKeyByValue: This function returns the first key which contains the given value.
  • head: This function takes an array and returns the first element from the array.
  • letterPositions: This function takes a string and returns letters with positions in an object type.
  • map: This function takes an array and function to map the array. It returns a mapped array.
  • middle: This function takes an array and returns the middle element from the array.
  • tail: This function takes an array and excludes the first element.
  • takeUntil: This function returns the array where its elements are deleted when the callback function returns false.
  • without: This function returns a new array that includes the elements from both first and the second arrays, but any repetitive elements are deleted.

Readme

Keywords

none

Package Sidebar

Install

npm i @programming_code/lotide

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

23.7 kB

Total Files

25

Last publish

Collaborators

  • programming_code