Skip to content

Commit

Permalink
Update syml.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed May 19, 2019
1 parent 1ea1536 commit 16485ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/berry-parsers/sources/syml.ts
@@ -1,7 +1,7 @@
// @ts-ignore
import {load} from 'js-yaml';
import {safeLoad} from 'js-yaml';

import {parse} from './grammars/syml';
import {parse} from './grammars/syml';

const simpleStringPattern = /^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/;

Expand Down Expand Up @@ -90,7 +90,7 @@ export function stringifySyml(value: any) {
export function parseSyml(source: string) {
try {
try {
return load(source) as {[key: string]: any};
return safeLoad(source) as {[key: string]: any};
} catch (error) {
return parse(source.endsWith(`\n`) ? source : `${source}\n`);
}
Expand Down

0 comments on commit 16485ed

Please sign in to comment.