@bebopskull/lotide
v1.0.0
Published
prototype of library inpsired from Lodash, for educational purposses
Downloads
2
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 @bebopskull/lotide
Require it:
const _ = require('@bebopskull/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arr1, arr2)
: assert equivalence of Arrays,assertEqual(a,b)
: assert equivalence of vualues,assertObjectsEqual(objA, objB)
: assert equality of objects,countOnly(a)
: count how many times a single value is present in an array,countLetters(stringA)
: count how many times a character is rpesent on a string,eqArrays(arr1, arr2)
: test equivalence through arrays,eqObjects(obj1,obj2)
: test equivalence through objects,findKey(key)
: find a key in an object,findKeyByValue(value)
: find a key in an object by its value,head(arr)
: select the first element of an array,tail(arr)
: select the elments of an array without from index 1,letterPositions(string)
: return the position of a character in an array,map(array)
: executer operations through elements of an array and create a shallow copy of the results in a new array,middle(array)
: return the middle elements of an array,takeUntil(array)
: select the elements of an array until a given value,without(array)
: filters the arra, creatign a shallow copy of it omiting the given values.