1.0.0 • Published 4 years ago
@michealap/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 @michealap/lotide
Require it:
const _ = require('@michealap/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: returns first item in an arraymiddle(array)
: take in an array and return the middle-most element(s) of the given array.tail(words)
: returns the "tail" of an array: everything except for the first item (head) of the provided array.assertEqual(actual, expected)
: compares stringseqArrays(firstList, secondList)
: takes in two arrays and returns true or false, based on a perfect matchassertArraysEqual(actual, expected)
: compares arrayseqObjects(object1, object2)
: take in two objects and returns true or false, based on a perfect matchassertObjectsEqual(actual, expected)
: compares objectscountLetters(string)
: returns the count of letters in a given stringletterPositions()
: returns the position/s of a letter in a given stringflatten(array)
: take in an array containing elements including nested arrays of elements, and return a "flattened" version of the array.findKey(object, callback)
: returns first item in an arrayfindKeyByValue(obj, showName)
: returns first item in an arraymap(array, callback)
: returns first item in an arraywithout(source, itemsToRemove)
: returns first item in an arraytakeUntil(array, callback)
: returns first item in an arrayindex(object of functions)
: calls the above functions for testing
1.0.0
4 years ago