1.0.0 • Published 3 years ago
@gbiyekenova/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 @gbiyekenova/lotide
Require it:
const _ = require('@gbiyekenova/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(firstItem)
: return first item in an arraytail(words)
: return tailof an arraymiddle(array)
: return middle part of an arrayeqArrays(array1, array2)
: return a booleanassertEqual(actual, expected)
: checks if assertion is passedassertArraysEqual(arr1, arr2)
: asserts if two arrays are equalassertObjectsEqual(actual, expected)
: asserts if two objects are equalcountLetters(sentence)
: returns an object with count of letters in a stringcountOnly(allItems, itemsToCount)
: asserts number of times a name repeats in an arrayeqObjects(object1, object2)
: asserts key values in objects are equal and returns a booleanfindKey(array)
: returns a key from an onjectfindKeyByValue(object, callback)
: return value of an objectletterPositions(sentence)
: returns an index of a given letter in a stringmap(array, callback)
: asserts that only first element of a string in an array is returnedtakeUntil(array, callback)
: print an array unil a given elementwithout(arr1, arr2)
: removes an element from an array
1.0.0
3 years ago