1.0.0 • Published 3 years ago
@john_ngo/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 @john_ngo/lotide
Require it:
const _ = require('@john_ngo/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters(sentence): counts letters in a sentencecountOnly(allItems, itemsToCount): counts specified itemseqArrays(actual, expected): compares two arrayseqObjects(object1, object2): compares two objectsfindKey(object, callback): finds a key that matches a functionfindKeyByValue(object, value): finds a key that matches a valueflatten(array): flattens an arrayhead(array): first element in an arrayletterPositions(sentence): finds positions of letters in a sentencemap(array, callback): creates a new array populated with the results of calling a provided function on every element in the calling arraymiddle(array): return middle of an arraytail(array): returns last element of an arraytakeUntil(array, callback): creates a new array populated with elements until callback returns truewithout(source, itemsToRemove): creates an array copy that does not include a specified item
1.0.0
3 years ago