This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Segment array into array of array with defined length | |
* @example const data = [ | |
* {name: "A"}, | |
* {name: "B"}, | |
* {name: "C"} | |
* ]; | |
* | |
* const segmented = segmentArray(data, 2); | |
* console.log(segmented); // [[{name: "A"}, {name: "B"}], [{name: "C"}]] | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Merges two arrays of objects, combining properties from both arrays. | |
* Allows for duplicates and preserves all properties. | |
* | |
* @template T The first type of objects in the arrays | |
* @template U The second type of objects in the arrays | |
* @param array1 First array of objects | |
* @param array2 Second array of objects | |
* @returns Merged array of objects with combined properties | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 80, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": false, | |
"singleQuote": true, | |
"quoteProps": "as-needed", | |
"jsxSingleQuote": false, | |
"trailingComma": "es5", | |
"bracketSpacing": true, |