1.0.3 • Published 3 years ago
@mkmach/lotide v1.0.3
This project was created and published by me as part of my learnings at Lighthouse Labs.
Usage
Install it:
npm install @mkmach/lotide
Require it:
const _ = require('@mkmach/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Test it
`the lotide scripts have zero dependencies, but can be unit tested with node.js integration.
- run
mocha
Documentation
The following functions are currently implemented:
assertArraysEqual: assertion for two arrays if they are equalassertEqual: assertion for two values if they are equalassertObjectsEqual: assertion for two objects if they are equalcountLetters: returns the the counts of the letters from a stringcountOnly: takes items and returns the counts for those specific itemseqArrays: compares values of two arrayseqObjects: compares values of two objectsfindKey: scans an object and returns the first key that satifies the callback conditionfindKeyByValue: seraches for a key in an object where its value matches the arugmentflatten: takes multiple arrays and flattens into a single arrayhead: returns the first element of an arrayindex: list of the functions in this library as an objectletterPositions: returns the index of each character of a given stringmap: creates a new array with the results of calling a provided funcion on ever element in the called arraymiddle: reutnrs the middle element(s) of an arraytail: returns every element less the first element of the arraytakeUntil: returns a slice of the array with the elements at the beginning of the arraywithout: removes elements from an array