1.0.0 • Published 2 years ago
@antenehgedamu/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 @antenehgedamu/lotide
Require it:
const _ = require('@antenehgedamu/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
- assertArraysEqual: compares 2 arrays and returns if they are the same
- assertEqual: compares 2 values and returns if they are the same -assertObjectsEqual: compares 2 objects and returns if key value pairs are the same
- countLetters: returns the number of letters in a string
- countOnly counts number of specific letters defined by user in a string
- eqArrays: uesed by assertArraysEqual
- eqObjects: used by assertObjectsEqual
- findKey: returns keys of object
- findKeyByValue: return key of specific value in an object
- head: returns first value in an array
- letterPositions: returns a string as an object with the letters and their indexes as key-value pairs
- map: returns new array of true values based on callback
- middle: returns middle value of an array, if even numbered array returns 2 values
- tail: returns array without index0
- takeUntil: returns array until callback is true
- without: removes values from array
1.0.0
2 years ago