@codenamecid/lotide
v1.0.0
Published
These files are intended to replicate some of JavaScripts basic testing functions.
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 @codenamecid/lotide
Require it:
const _ = require('@codenamecid/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertEqual)
: a console.assert like functionfunction2(head)
: a head functionfunction3(tail)
: a tail like functionfunction4(eqArrays)
:allows comparison of arraysfunction5(assertArraysEqual)
: allows comparison of arraysfunction6(without)
: remove unwanted itemsfunction7(middle)
: take in an array and return the middle-most element(s) of the given array.function8(countOnly)
: take in a collection of items and return counts for a specific subset of those items.function9(countLetters)
:take in a sentence (as a string) and then return a count of each of the letters.function10(letterPositions)
: return all the indices in the string where each character is found.function11(findKeyByValue)
: takes object and a value. Returns the first key which contains the given value.function12(eqObjects)
: allows comparison of objects.function13(assertObjectsEqual)
: help us easily test functions that return objects.