Skip to content

Commit

Permalink
yaml.safeLoad is removed in js-yaml 4
Browse files Browse the repository at this point in the history
  • Loading branch information
xurizaemon committed Jul 21, 2023
1 parent 1c91e18 commit 6c208a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion legacy/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const loadCacheFile = file => {
*/
const loadLandoFile = file => {
try {
return yaml.safeLoad(fs.readFileSync(file));
return yaml.load(fs.readFileSync(file));
} catch (e) {
throw new Error(`There was a problem with parsing ${file}. Ensure it is valid YAML! ${e}`);
}
Expand Down
2 changes: 1 addition & 1 deletion legacy/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ exports.loadFiles = files => _(files)
.filter(source => fs.existsSync(source) || fs.existsSync(source.file))
// If the file is just a string lets map it to an object
.map(source => {
return _.isString(source) ? {file: source, data: yaml.safeLoad(fs.readFileSync(source))} : source;
return _.isString(source) ? {file: source, data: yaml.load(fs.readFileSync(source))} : source;
})
// Add on the root directory for mapping purposes
.map(source => _.merge({}, source, {root: path.dirname(source.file)}))
Expand Down
2 changes: 1 addition & 1 deletion legacy/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = class Yaml {
*/
load(file) {
try {
return yaml.safeLoad(fs.readFileSync(file));
return yaml.load(fs.readFileSync(file));
} catch (e) {
this.log.error('Problem parsing %s with %s', file, e.message);
}
Expand Down

0 comments on commit 6c208a9

Please sign in to comment.