1.0.0 • Published 3 years ago
@syabdulr/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 @syabdulr/lotide
Require it:
const _ = require('@syabdulr/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: Assert if two arrays are strictly equalassertEqual: Test for strict equalityassertObjectsEqual: Check for object strict equalitycountLetters: Count letters in stringcountOnly: Report how many instances of each string were foundeqArrays: Compare arrays and test for strict equalityeqObjects: Test for Strict Object EqualityfindKey: findKey in objecthead: Return first value in arrayindex: Description of the Lotide LibraryletterPositions: Find index of lettersmap: transform an array by applying a function to each of its elements, without changing the original arraymiddle: Return middle element of an arraytail: Return the all elements but first value in arraytakeUntil: // function will return a slice of the array with elements taken from the beginningwithout: Take two arrays and return a new array with all elements from the first array that are not present in the second array
1.0.0
3 years ago