@omid-g12/lotide
v1.0.0
Published
Does comparisons and/or edits to the input strings, numbers, arrays, or objects.
Downloads
2
Readme
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 @omid-g12/lotide
Require it:
const _ = require('@omid-g12/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual
: assertion for input === expectedassertArraysEqual
: assertion for [input] === [expected]assertObjectEqual
: assertion for {input} === {expected}countLetters
: counts how many times each letter is used in a stringcountOnly
: counts how many of the requested item is in a listeqArrays
: check if [input] === [expected]eqObjects
: check if {input} === {expected}findKey
: finds the key of a item in an object with a nested objectfindKeyByValue
: finds the key of an item based on its valuehead
: returns the first item (head) of an arrayletterPositions
: returns the position of a specific letter in a given stringmap
: maps the requested value from a given arraymiddle
: returns the values between the first and last items (middle) of an arraytail
: returns all items except the head of an arraytakeUntil
: iterated through an array until it reaches the requested elementwithout
: returns an array without the requested element