1.0.0 • Published 5 years ago
@bcerki/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 @bcerki/lotide
Require it:
const _ = require('@bcerki/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: Check if two arrays are equal and return a console messageassertEqual: Check if two primative values are equal and return a console messageassertObjectEqual: Check if two objects are equal and return a console messagecountLetters: Return an object that displays how many times each letter of a string appearscountOnly: Count items in an array only if they also appear in a given objecteqArrays: Check if two arrays are equal and return a booleaneqObjects: Check if two arrays are equal and return a booleanfindKey: Returns the first key that gives a truthy valuefindKeyByValue: Returns the key of a given valueflatten: Change an array that includes nested arrays into a non-nested arrayhead: Return the first value in an arrayletterPositions: Returns the indices of letters in a stringmap: Return a new array after running it through a functionmiddle: Return the middle value(s) of an arraytail: Return the last value in an arraytakeUntil: Return a string up until a specified pointwithout: Return a new array with elements removed
1.0.0
5 years ago