1.0.0 • Published 2 years ago
@curtiskelowna/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 @curtiskelowna/lotide
Require it:
const _ = require('@curtiskelowna/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function(assertEqual): compares two values and prints out a message telling us if they match or notfunction(head): retrieves the first element from an arrayfunction(tail): retrieves every element except the head (first element) of an arrayfunction(middle): retrieves the middle element(s) of an arrayfunction(assertArraysEqual): compares two arrays and prints out a message telling us if they match or notfunction(assertObjectsEqual): compares two objects and prints out a message telling us if they match or notfunction(countLetters): counts the number of times each letter appears in a stringfunction(countOnly): counts the number of times a specific item appears in an arrayfunction(eqArrays): compares two arrays and returns true or false based on a perfect matchfunction(eqObjects): compares two objects and returns true or false based on a perfect matchfunction(findKey): searches for a key in an object and returns the key's valuefunction(findKeyByValue): searches for a value in an object and returns the keyfunction(letterPositions): returns an object with the index of each letter in a stringfunction(map): returns a new array based on the results of the callback functionfunction(takeUntil): returns a new array with elements from the original array until the callback function returns a truthy valuefunction(without): returns a new array with elements from the original array except for those specified
1.0.0
2 years ago