@mariahhm42/lotide
v1.0.7
Published
first LHL project
Downloads
308
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 @mariahhm42/[email protected]
Require it:
const _ = require('@mariahhm42/[email protected]');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
without
: Returns a new array excluding specified elements from the original array.flatten
: Flattens a nested array into a single-level arraycountOnly
: Counts occurences of specified items in an arraycountLetters
: Returns an object with the count of each letter in a stringletterPositions
: Returns an object with the indices of each letter in a string.findKeyByValue
: Finds the key corresponding to a given value in an object.eqObjects
: Compares two objects for deep equality.findKey
: Finds the first key in an object that satisfies a callback function.map
: Creates a new array by applying a callback function to each element of an array.takeUntil
: Returns a slice of an array up to a specified condition.head
: Returns the first element of an arrayeqArrays
: Compares two arrays for equality.assertArraysEqual
: Asserts whether two arrays are equal.assertEqual
: Asserts whether two primitive values are equalassertObjectEqual
: Asserts whether two objects are equaltail
: Returns all elements of an array except the first one.middle
: Returns the middle element(s) of an array.