@nicholas-ewasiuk/lotide
v1.3.0
Published
w1 lodash style implementation
Downloads
4
Readme
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 @nicholas-ewasiuk/lotide
Require it:
const _ = require('@nicholas-ewasiuk/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: returns first item in array.tail(...)
: returns all items except first in array.middle(...)
: returns middle item(s) in array.countLetters(...)
: counts number of letters in a string.assertObjectsEqual(...)
: asserts expected output equals actual output for objects.assertArraysEqual(...)
: asserts expected output equals actual output for arrays.assertEqual(...)
: asserts expected output equals actual output for primitives.countOnly(...)
: counts frequency of selected strings in an array.eqArrays(...)
: checks if array values are equivalent.eqObjects(...)
: checks if object keys are equivalent.findKey(...)
: finds key containing specified number.findKeyByValue(...)
: finds key containing specified value.letterPositions(...)
: counts number of occurences for each letter in an array.map(...)
: returns array containing first letter of each string in input array of strings.takeUntil(...)
: returns copy of array up to specified index.without(...)
: returns array with selected items removed.