1.0.0 • Published 2 years ago
@k-henningson/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 @k-henningson/lotide
Require it:
const _ = require('@k-henningson/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
: Function to assert that two arrays are equalfunction2(assertEqual)
: Function to help us test our code, comparing primitive typesfunction3(assertObjectsEqual)
: Function that takes in two objects and console.logs an appropriate messagefunction4(countLetters)
: Function that takes in a sentence (as a string) and returns a count of each of the letters in that sentencefunction5(countOnly)
: Function that takes in a collection of items and returns a count for the specific subset of those itemsfunction6(eqArrays)
: Function that can compare two arrays for a perfect matchfunction7(eqObjects)
: Function that takes in two objects and returns true or false, based on a perfect matchfunction8(findKey)
: Function that takes in an object and a callback, returning the first key for which the callback returns truthyfunction9(findKeyByValue)
: Function that takes in an object and a value, and returns the first key containing the valuefunction10(head)
: Function that retrieves the first element from the arrayfunction11(letterPositions)
: Function that returns all the indices in the string where each character is foundfunction12(map)
: Function that creates a new array populated with the results of calling a provided function on each element in the arrayfunction13(middle)
: Function that returns an array with only the middle element(s)function14(tail)
: Function that retrieves every element except the first element of the arrayfunction15(takeUntil)
: Function that will keep collecting items from an array until the callback returns a truthy valuefunction16(without)
: Function that filters our data by removing unwanted items
1.0.0
2 years ago