1.0.1 • Published 4 years ago
@flora.manda/lotide v1.0.1
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 @flora.manda/lotide
Require it:
const _ = require('@flora.manda/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: function to find head of an arraytail(...)
: function to find tail of an arraymiddle(...)
: function to find middle element of an arrayassertArraysEqual(...)
: function to compare two arraysassertEqual(...)
: function to compare two values that is not an array or objectassertObjectsEqual(...)
: function to compare two objectscountLetters(...)
: function to find the number of character instances in a stringcountOnly(...)
: function to count number of instances a string appears in an arrayeqArrays(...)
: function that returns a boolean if two arrays are equal or noteqObjects(...)
: function that returns a boolean if two objects are equal or notfindKey(...)
: function that finds the key in an object based on a second arg (a callback)findKeyByValue(...)
: function that finds the key in an object based on a second arg (a value)flatten(...)
: function that flattens an arrayletterPositions(...)
: function that finds the position of a string and return value in an objectmap(...)
: function that returns a modified array based on a call back functiontakeUntil(...)
: function that returns an array with elements up until a certain point declared by a callbackwithout(...)
: function that returns an array without certain elements based on the second arg (what items to remove)
1.0.1
4 years ago