Support TOSCA functions in Node Filters
[sdc.git] / catalog-ui / src / app / models / yaml-function.ts
index e80d783..e992d6b 100644 (file)
@@ -22,6 +22,7 @@
 import {ToscaFunction} from "./tosca-function";
 import {ToscaFunctionType} from "./tosca-function-type.enum";
 import {ToscaFunctionParameter} from "./tosca-function-parameter";
+import * as jsYaml from 'js-yaml';
 
 export class YamlFunction implements ToscaFunction, ToscaFunctionParameter {
     type = ToscaFunctionType.YAML;
@@ -34,4 +35,12 @@ export class YamlFunction implements ToscaFunction, ToscaFunctionParameter {
         this.value = yamlFunction.value;
     }
 
+    public buildValueObject(): Object {
+        return jsYaml.load(this.value);
+    }
+
+    public buildValueString(): string {
+        return this.value;
+    }
+
 }
\ No newline at end of file