1.0.0 • Published 4 years ago
@jacob1225/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 jacob1225/lotide
Require it:
const _ = require('jacob1225/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual
: confirms that our returned value matches with the expected valueassertArraysEqual
: confirms that two arrays are equal to each otherassertObjectsEqual
: confirms that two objects are equal to each othereqArrays
: confirms that two arrays are equaleqObjects
: confirms that two objects have identical keys with identical valuescountLetters
: counts the occurence of each letter in a stringcountOnly
: looks through an array of strings to count only specified values and returns an object with each key and their countfindKey
: returns the first key that matches a condition specified by a functionfindKeyByValie
: returns the key the matches a specified valuehead
: returns the first value in an arrayletterPositions
: returns an object with the letters of a string as keys and their index as the valuemap
: returns a new array with the results of calling a callback functionmiddle
: returns the middle element of an array if the length is odd, returns an empty array with the length is <=1 and returns the middle elements of an array if length is eventail
: Takes the first element out of an array and returns that arraytakeUntil
: takes an array with a callback function and returns the values in a new array until a truthy value is metwithout
: takes an array and removes a spcecified value from it and returns a new array without aletering the original array
1.0.0
4 years ago