@mosszion/lotide
v1.0.1
Published
A package which contains a combination of different functions
Downloads
11
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 @mozzion/lotide
Require it:
const _ = require('@mosszion/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetter = function(str)
: descriptionassertArraysEqual = function(arr1, arr2)
: checks if two arrays are equalassertEqual = function(actual, expected)
: checks two primitives equallityassertObjectsEqual = function(actual, expected)
: checks two objects equallitycountOnly = function(actual, expected)
: counts specific items onlyeqArrays = function(firstArray, secondArray)
: two input arrays checked for equalityeqObjects = function(object1, object2)
: two input objects checked for equalityfindKey = function(object, callback)
: uses callback to find key of an object's valuefindKeyByValue = function(object, value)
: given an object and a value, returns key of the value from the Objectflatten = function(arr)
: given an array or nested array, returns a single flat arrayhead = function(list)
: given an array, returns the first element of the arrayhead = function(list)
: given an array, returns the first element of the arrayindex file
: contains all of the functions of our codesgiven an arrayletterPositions = function(sentence)
: returns index of a letter selectedmap = function (array, callback)
: takes an array and callback, and returns another array after went through callbackmiddle = function(ary)
: takes an array and returns another array with the middle elementstail = function(ary)
: takes an array and returns the elements except the first elementtakeUntil = function(array, callback)
: takes an array and a callback , and returns a slice of arraywithout = function(array1, array2)
: takes two arrays and returns a small array which is not common for both arrays