@@ -2,7 +2,7 @@ import YAML from "js-yaml"
|
||||
|
||||
export const parseYamlConfig = (yaml, system) => {
|
||||
try {
|
||||
return YAML.safeLoad(yaml)
|
||||
return YAML.load(yaml)
|
||||
} catch(e) {
|
||||
if (system) {
|
||||
system.errActions.newThrownErr( new Error(e) )
|
||||
|
||||
@@ -62,7 +62,7 @@ export const parseToJson = (str) => ({specActions, specSelectors, errActions}) =
|
||||
try {
|
||||
str = str || specStr()
|
||||
errActions.clear({ source: "parser" })
|
||||
json = YAML.safeLoad(str)
|
||||
json = YAML.load(str)
|
||||
} catch(e) {
|
||||
// TODO: push error to state
|
||||
console.error(e)
|
||||
|
||||
@@ -648,7 +648,7 @@ const getYamlSampleSchema = (schema, config, contentType, exampleOverride) => {
|
||||
const jsonExample = getStringifiedSampleForSchema(schema, config, contentType, exampleOverride)
|
||||
let yamlString
|
||||
try {
|
||||
yamlString = YAML.safeDump(YAML.safeLoad(jsonExample), {
|
||||
yamlString = YAML.dump(YAML.load(jsonExample), {
|
||||
|
||||
lineWidth: -1 // don't generate line folds
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user