1.0.0 • Published 4 years ago
@jalayna/lotide v1.0.0
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 @jalayna
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
without
: returns new array of only wanted itemstakeUntil
: returns part of the array until callback returns a truthy valuetail
: recreates tail of given array onto new arraymiddle
: finds and returns middle of arraymap
: create our own version of mapletterPositions
: finds index of letterhead
: return first element of an arrayfindKeyByValue
: returns key by it's valuefindKey
: return the first key for which the callback returns a truthy valueeqObjects
: takes in two objects compares if identical. Only handle primitive typeseqArrays
: compares if two arrays are identicalcountOnly
: counts items in array that repeatcountLetters
: counts how many times each letter appears in the string givenassertObjectsEqual
: takes in actual and expected as arguments and logs whether assertion passed or faildassertEqual
: takes in actual and expected and logs if identicalassertArraysEqual
: takes two arrays and ensures they are equal and logs ittailTest
: tests if tail function worksmiddleTest
: tests if middle function worksheadTest
: tests if head function workseqArraysTest
: tests if eqArray function worksasserEqualTest
: tests is assertEqual function worksassertArraysEqualTest
: tests if assertArraysEqual function works
1.0.0
4 years ago