Explorar el Código

feature: add func replace

M Gilang Januar hace 2 años
padre
commit
a92f3ffcf3
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/utils/referenceData/mustacheReplacer.js

+ 5 - 0
src/utils/referenceData/mustacheReplacer.js

@@ -114,6 +114,11 @@ export const functions = {
 
     return jsonpath.query(data, exps);
   },
+  replace(value, search, replace) {
+    if (!value) return value;
+
+    return value.replace(search, replace);
+  },
 };
 
 export function extractStrFunction(str) {