Skip to content

Commit 6a469b7

Browse files
committed
fix(yaml): support non standard yaml as a fallback
1 parent c736e62 commit 6a469b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/parsers/yaml.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ export default {
4242
try {
4343
return yaml.load(data, { schema: JSON_SCHEMA });
4444
} catch (e: any) {
45-
throw new ParserError(e?.message || "Parser Error", file.url);
45+
try {
46+
// fallback to non JSON_SCHEMA
47+
return yaml.load(data);
48+
} catch (e: any) {
49+
throw new ParserError(e?.message || "Parser Error", file.url);
50+
}
4651
}
4752
} else {
4853
// data is already a JavaScript value (object, array, number, null, NaN, etc.)

0 commit comments

Comments
 (0)