1.0.0 • Published 4 years ago
@thnxziggy/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 @thnxziggy/lotide
Require it:
const _ = require('@thnxziggy/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: manually created assertion function that compares arrays and checks actual values against expected and returns a pass or failassertEqual: manually created assertion function that checks actual values against expected and returns a pass or failassertObjectsEqual: manually created assertion check for ObjectscountLetters: function that counts the numbers of letters given a stringcountOnly: function that goes through an array and references an object specifying what to counteqArrays: function that takes two arrays and determines if they share identical elements/valueseqObjects: function that takes two objects and determines if they share identical key/value pairsfindKey: function that takes an object and a callback and returns the property given a key. If multiple entries exist it returns the firstfindKeyByValue: function that takes a value and returns the key where it is storedhead: returns the first element of an arrayindex: importing/exporting head/middle/tail functionsiteratingOverObjects: assignment function that shows how to iterate through objectsletterPositions: takes a string and returns an object logging each letter by its own keymap: assignment functionmiddle: function that takes an array and returns the middle element. if the array stores an even amount of elements, it returns the middle twoobjectsNew: assignment function that taught us on object manipulationreverse: stretch activity function that takes a string from the terminal and returns a reverse string (hello to elloh)reversecopy: second attempt at reversing a string.tail: function that returns the last element of an arraytakeUntil: function that itereates through an array and returns a new array of the same elements until the callback is invoked within the arraywithout: function that takes an array and returns only the values specified
1.0.0
4 years ago