1.0.0 • Published 4 years ago
@alasam/lotide v1.0.0
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 @alasam/lotide
Require it:
const _ = require('@alasam/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(...)
: descriptionfunction2(...)
: descriptionfunction3(...)
: descriptionassertArraysEqual
: Compares 2 arrays as parameters and returns a pass if true, and a fail if falesassertEqual
: Compares 2 primitive data and returns a pass if true and false if failsassertObjectsEqual
: Compares 2 objects and returns a pass if true and false if failscountLetters
: Takes in a string as the parameter and logs and counts each character in the string and stores info in an objectcountOnly
: Takes in 2 objects, one with a list of items, and the second with a list of items and if they are true/false, then outputs only the items that were to be includedeqArrays
: Checks and compares 2 arrays, if they are identicle it will return as true, if not falseeqObjects
: Checks and compares 2 objects, if they are identicle it will return as true, if not falsefindKey
: Takes an object and uses a callback function to find matching values and return first key with said matchign values.findKeyByValue
: Finds a value in an object and returns the key it is in.head
: Returns head of the arrayletterPositions
: Looks at every letter in a string and logs its position in an object.map
: Looks at every letter in a string and logs its position in an object.middle
: Returns middle item/items in an arraytail
: Returns everything in order, without the head of the arraytakeUntil
: Adds data from array until a certain condition is met from the callback functionwithout
: Pulls two arrays, the array to be modified, and the array with what to remove
1.0.0
4 years ago