util-variables.js 428 B

12345678910111213
  1. function mountCodeFromVariable(variable = {name: "", type: "String", value: ""}) {
  2. let variableBarrier = getVariableTypeBarrier(variable.type);
  3. return `${variable.type} ${variable.name} = ${variableBarrier}${variable.value}${variableBarrier}`;
  4. }
  5. function getVariableById(id) {
  6. for (let i = 0; i < variables.length; i++) {
  7. if (variables[i].id == id)
  8. return variables[i];
  9. }
  10. return null;
  11. }