@coconuttt/lotide
v1.0.1
Published
a clone of lodash library for learning purpose of the bootcamp
Downloads
6
Readme
A Lodash library dumber clone
Status
🦖 - codes are king of the jungle (max improvement of my abilities)
👾 - codes need a bit of touch up to be fab
🔥 - codes are in crisis or I don't know why but it runs
Function Files
- head - return the 1st element of an array | 🦖
- middle - return an array of the middle value of an array |
- tail - return everything behind the head | 👾
- map - self-implemented map (return an array results) | 👾
- takeUntil - slice the array until meet the condition to stop and return an array of those elements | 🦖
- without - return a new array with unwanted elements are removed (not support nested array as an elements)| 🦖
- countOnly - return an obj with the numbers of appearances of the letter in the string | 🦖
- countLetters - return an obj of the appearance of the letter in the string | 👾
- letterPositions - return an obj of the position of letters in the string | 👾
- findKey - using callback to improve
- findKeyByValue - return the key that match the value in the obj | 🦖
- eqArrays - check === of 2 arrays (not support nested array as an elements) and return true/false | 👾
- eqObjects - check === of 2 objects and return true/false | 🔥 not return correct output
Test Files
Assert functions
- assertEqual - console.log the message of test cases for 2 values | 🦖
- assertArraysEqual - console.log the message of test cases for 2 arrays | 🦖
- assertObjectsEqual - console.log the message of test cases for 2 objectst | 🦖
Test cases
To run all 'chai' tests:
npm test
To run specific test:npm test test\test_file_name
17. headTest - test cases for head
- middleTest - test cases for middle
- tailTest - test cases for tail
- mapTest - test cases for map
- takeUntilTest - test cases for takeUntil
- withoutTest - test cases for without
- countOnlyTest - test cases for countOnly
- countLettersTest - test cases for countLetters
- letterPositionTest - test cases for letterPosition
- findKeyTest - test cases for findKey
- findKeyByValueTest - test cases for findKeyByValue
- eqArraysTest - test cases for eqArray
- eqObjectsTest - test cases for eqObjects
- assertArraysEqualTest - test cases for assertArraysEqual
- assertObjectsEqualTest - test cases for assertObjectsEqual
For exporting all Lotide functions
- index - files to return an object contains entire Lotide functions