@fayesadev/lotide
v1.0.0
Published
Consists of a variety of functions that pass and modify strings, arrays and/or objects. Includes testing and assertion functions.
Downloads
1
Readme
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 @fayesadev/lotide
Require it:
const _ = require('@fayesadev/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
- assertEqual: Assert if two values are equal
- head: Returns the first item in an array
- tail: Returns an array with the first item removed
- eqArrays: Checks if two arrays are equal
- assertArraysEqual: Asserts if two arrays are equal
- without: Returns a new array without the items passed without modifying the original array
- middle: Returns the middle elements of an array
- countOnly: Counts how many times an item appears in an array
- countLetters: Counts how many times each letter appears in a string
- letterPositions: Returns the index of each letter in a string
- findKeybyValue: Returns the key of a passed value
- eqObjects: Checks if two objects are equal
- assertObjectsEqual: Asserts if two objects are equal
- map: Maps an array
- takeUntil:Returns a new array of items in a given array until the given condition is satisfied
- findKey: Finds key in an object based on a given condition
- Test Directory