1.0.0 • Published 4 years ago
@ameslady/lotide-project 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 @ameslady/lotide
Require it:
const _ = require('@ameslady/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected): prints pass or fail assertions based on the strict equality of two arraysassertEqual(actual, expected): compares the actual value to the expected value, pass or failassertObjectsEqual(actual, expected): prints pass or fail assertions based on the equality of two objectscountLetters(sentence): takes a sentence (as a string) and returns a count of each of the letters in that sentence.countOnly(allItems, itemsToCount): takes an array and object and returns an object containing counts of everything that the input object listed.eqArrays(arr1, arr2): function that takes in two arrays and returns true or false, based on a perfect matcheqObjects(obj1, obj2): compares object data to determine if they are equalfindKey(object, callback): scans the object and return the first key for which the callback returns a truthy value.findKeyByValue(object, value): scans the object and returns the first key that contains the given value.head(array): returns the the head of an arrayletterPositions(sentence): returns all the indices (zero-based positions) in the string where each character is foundmap(array, callbac): iterates through an array and returns new array based on conditionsmiddle(array): takes in an array and returns the middle-most element(s)tail(array): returns the tail of an array (every element but the head)takeUntil(array, callback): returns a slice of the array with elements taken from the beginning.without(source, itemsToRemove): removes any specified unwanted elements from an aray (should modify source array)
1.0.0
4 years ago