Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions lib/grunt/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,9 @@ file.readYAML = function(filepath, options, yamlOptions) {
var result;
grunt.verbose.write('Parsing ' + filepath + '...');
try {
// use the recommended way of reading YAML files
// https://github.com/nodeca/js-yaml#safeload-string---options-
if (yamlOptions.unsafeLoad) {
result = YAML.load(src);
} else {
result = YAML.safeLoad(src);
}
// Since js-yaml 4, `safeLoad()` was removed and `load()` became the standard safe loader.
result = YAML.load(src);

grunt.verbose.ok();
return result;
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"grunt-legacy-log": "~3.0.0",
"grunt-legacy-util": "~2.0.1",
"iconv-lite": "~0.6.3",
"js-yaml": "^3.15.0",
"js-yaml": "5.4.2",
"minimatch": "^3.1.5",
"nopt": "^5.0.0"
},
Expand Down