Start of action system re-write
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX.js';
|
||||
|
||||
export default function embedInlineCalculations(inlineCalcObj){
|
||||
const string = inlineCalcObj.text;
|
||||
const calculations = inlineCalcObj.inlineCalculations;
|
||||
if (!string || !calculations) return;
|
||||
let index = 0;
|
||||
inlineCalcObj.value = string.replace(INLINE_CALCULATION_REGEX, substring => {
|
||||
let calc = calculations[index++];
|
||||
return (calc && 'value' in calc) ? calc.value : substring;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user