This file contains hidden or 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
| const flattenArray = function(arr, res){ | |
| res = res || []; | |
| arr.forEach((val) => { | |
| if(Array.isArray(val)){ | |
| flattenArray(val, res); | |
| } else { | |
| res.push(val); | |
| } | |
| }); | |
| return res; |
This file contains hidden or 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
| // example: style="width:{{math 70 '+' 5 '*' numProfiles '+' '%'}}" | |
| // Handlebars.registerHelper("math", BasicMathOperations); | |
| function BasicMathOperations() { | |
| var args = Array.prototype.slice.call(arguments); | |
| var options = args.pop(); | |
| function performOperation(lvalue, operator, rvalue){ | |
| lvalue = parseFloat(lvalue) || lvalue; //? | |
| rvalue = parseFloat(rvalue) || rvalue; //? | |
| return { |