1.0.0 • Published 4 years ago
@momotrq94/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 @username/lotide
Require it:
const _ = require('@momotrq94/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: given an array returns first elementtail: given an array returns everything but first elementmiddle: given an array returns middle of the arrayassertArraysEqual: assertion for checking two arrays are equalassertEqual: assertion for numbers and strings to check if they are equaleqArrays: returns true if two arrays and equal and false if they are notcountLetters: counts the number of a times a letter appears in a stringeqObjects: given two objects determines if the two objects are equalfindKeyByValue: given an object and value returns the first key with that valueflatten: given an inifite number of nested arrays flattens to return one array with all the valuesletterPositions: given a string and letter returns the positions of the where that letter occured in the stringtakeUntil: given an array and a callback function returns an array where the array is copied until the condition is reachedwithout: given an array and a value returns that array without that value
1.0.0
4 years ago