1.0.0 • Published 5 years ago
@kieransharley/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 @kieranSharley/lotide
Require it:
const _ = require('@kieranSharley/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: returns the first letter in a stringtail
: returns everything but the first letter in a stringmiddle
: returns the middle element in an arrayassertArraysEqual
: asserts that two arrays are equalassertEqual
: asserts that two strings are equalassertObjectsEqual
: asserts two objects are equalcountletters
: returns the lett in a string that occurs the mostcountOnly
: checks if a string is in an array, and how many timeseqArrays
: if two arrays are equaleqObjects
: if two objects are equalfinKey
: takes in a string and matches it with an object keyfindKeyByValue
: enter a value and returns the key in an objectletterPositions
returns the index of any letter you enter contained within a stringloopyLighthouse
: returns numbers within a range with word values if they are multiples.map
: takes in an array and a callback function to be acted on the array. returns new arraypigLatin
converts a sentence into the language dpigLatinreverse
reverses a stringtakeUntil
creates a new array until it reaches a value specified.without
returns an array minus the input
1.0.0
5 years ago