forked from kriipke/helm-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.js
More file actions
24 lines (22 loc) · 694 Bytes
/
lib.js
File metadata and controls
24 lines (22 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
window.loadGetYaml = () => {
const go = new Go();
return fetch('dist/lib.wasm')
.then((response) => response.arrayBuffer())
.then((buffer) => WebAssembly.instantiate(buffer, go.importObject))
.then((result) => {
go.run(result.instance);
const getYaml = (templateYaml, valuesYaml) => {
let returnValueJson;
try {
returnValueJson = GetYaml(templateYaml, valuesYaml);
const returnValue = JSON.parse(returnValueJson);
return returnValue;
} catch (error) {
throw new Error(
`unable to parse returnValueJson: ${returnValueJson}`
);
}
};
return getYaml;
});
};