1.0.0 • Published 2 years ago
@renjii/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 @renjii/lotide
Require it:
const _ = require('@renjii/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
- head:
Outputs the first thing in an array
- tail:
Outputs everything except the first thing in an array
- middle:
Outputs the middle of an array
- assertArraysEqual:
Asserts if 2 arrays are equal
- assertEqual:
Assters if the actual input equals the expected output
- assertObjectsEqual:
Asserts if 2 objects are equal
- countLetters:
Counts the number of letters in a string, skipping spaces
- countOnly:
Only counts the number of occurances of a specific item in an array
- eqArrays:
Determines if 2 arrays are equal
- eqObjects:
Determines if 2 objects are equal
- findKey:
Locates a desired key in an object
- findKeyByValue:
Locates a desired key by its value
- flatten:
Flattens arrays within arrays
- letterPositions
Finds the index of a letter
- map:
Transforms an array based on behaviour of callback
- takeUntil:
Loops through an array until a callback is met
- without:
Returns an array without specified aspect
1.0.0
2 years ago