1.0.0 • Published 4 years ago
@beakwan/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 @beakwan/lotide
Require it:
const _ = require('@beakwan/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual): Console logs an assertion message if two arrays are equal or notfunction2(assertEqual): Console logs an assertion message if two primitive values are equal or notfunction3(assertObjectsEqual): Console logs an assertion message if two objects are equal or notfunction4(countLetters): Returns an object containing a count of all letters in a given stringfunction5(countOnly): Returns an object containing a count of specified letters in a given stringfunction6(eqArrays): Returns a boolean based on the equality of two given arraysfunction7(eqObjects): Returns a boolean based on the equality of two given objectsfunction8(findKey): Returns the first key of a given object for which the given callback function returns truthyfunction9(findKeyByValue): Returns the first key of a given object that contains a given valuefunction10(head): Returns the first value of a given arrayfunction11(letterPositions): Returns an object containing the letters of a given string with their indices as valuesfunction12(map): Returns a new array of values that have each been altered based on a given callback functionfunction13(middle): Returns the middle or middle two values of a given arrayfunction14(tail): Returns all but the first item in a given arrayfunction15(takeUntil): Returns an array of items from a given array until a given callback is fulfilledfunction16(without): Returns an array of items based on a given array, removing items listed in a second given array
1.0.0
4 years ago