Files
swagger-ui/src/core/plugins/configs/helpers.js
2021-08-09 16:30:40 +02:00

13 lines
226 B
JavaScript

import YAML from "js-yaml"
export const parseYamlConfig = (yaml, system) => {
try {
return YAML.load(yaml)
} catch(e) {
if (system) {
system.errActions.newThrownErr( new Error(e) )
}
return {}
}
}