1.0.0 • Published 4 years ago
@andyzhen/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 @andyzhen/lotide
Require it:
const _ = require('@andyzhen/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters(string): counts the number of characters in a string.countOnly(array, item to count): only count given values.findKey(object): returns they key of matched elementfindKeyByValue(object): returns a key given an Object Valueflatten(array):flattens an arrayhead(array): gets the first element of an arrayletterPosition(string)return all indicies where the character is found on a given string/map(array, function): returns a new array with the results of calling a provided function on every element in that calling array.middle(array): gets the middle elementtails(array): gets all but first element of an arraytakeUntil(array,callback): returns an array of sliced elements from the beginning until a given value is reached.without(array,values to exclude): creates an array exluding given values.
1.0.0
4 years ago