using yaml CORE_SCHEMA instead of DEFAULT_SCHEMA (#3303)

Co-authored-by: Anusree Subash <anusree@usebruno.com>
This commit is contained in:
anusreesubash 2024-10-14 18:20:18 +05:30 committed by GitHub
parent 3ef7df57e2
commit a880e030eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ const readFile = (files) => {
} catch (jsonError) { } catch (jsonError) {
// not a valid JSOn, try yaml // not a valid JSOn, try yaml
try { try {
const parsedData = jsyaml.load(e.target.result); const parsedData = jsyaml.load(e.target.result, { schema: jsyaml.CORE_SCHEMA });
resolve(parsedData); resolve(parsedData);
} catch (yamlError) { } catch (yamlError) {
console.error('Error parsing the file :', jsonError, yamlError); console.error('Error parsing the file :', jsonError, yamlError);