1.0.0 • Published 3 years ago
@mustafa200/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 mustafa200/lotide
Require it:
const _ = require('mustafa200/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: returns the first element of an arraytail: returns the last element of an arraymiddle: returns the middle element of an arrayassertArraysEqual: a function to compare two arrays with an assertionassertEqual: a function to compare two primitives with an assertionassertObjectsEqual: a function to compare two objectscountLetters: returns the count of the occurence of letters in a stringcountOnly: counts the elemnts of an array or an objecteqArrays: to compare two arrayseqObjects:to compare two objectsfindKey: returns the key of an objectfindKeyByValue: returns a key in an object by looking its valueletterPositions: returns the position of each letter in a giving stringmap: maps an array into a new onetakeUntil; Returns elemnts of an arry until a giving valuewithout; Returns an array with unwanted elemnts removed .
Keywords
LHL Lotide
1.0.0
3 years ago