1.0.0 • Published 5 years ago
@jeffreyscript/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 @jeffreyscript/lotide
Require it:
const _ = require('@jeffreyscript/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: this function return the first element of an array .tail: this function return rest of array except the first element .middle: this function return the most middle elements in an array .takeUntil: this function takes an array and a callback function, it change the array according to callback .without: this function filter out elment in first array that appears on second array .map: this function takes in array and a callback, the array is altered according to callback .letterPositions: this function print all letter's positions in a sentence .flatten: this function pass in an array, print out all elements in that array, including elements in nested array.findKeyByValue: this function takes in an object and an property value of the object, print the corresponding property key .findKey: this function takes in an object and an callback, it print out property name according to callback .eqObjects: this function checks if two objects are absolutely equal to each other .eqArrays: this function checks if two arrays are absolutely equal to each other,countOnly: this function takes in a string and an array, and return the count of that string in the array if that string is present in the array .countLetter: this function count the letter of a string .assertObjectsEqual:this function print out message based on whether two objects are equal to each other .assertArraysEqual: this function print out message based on whther two arrays are equal to each other .assertEqual: this function print out message based on whether two primitive type data are equal to each other .index: this is an file collection of all legitimate functions ready to be required by users .
1.0.0
5 years ago