Skip to content

Commit

Permalink
[INTERNAL] Adopt js-yaml API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Feb 9, 2021
1 parent fed8c36 commit 22eeeb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/projectPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,8 @@ class ProjectPreprocessor {
let configs;

try {
// Using loadAll with DEFAULT_SAFE_SCHEMA instead of safeLoadAll to pass "filename".
// safeLoadAll doesn't handle its parameters properly.
// See https://github.com/nodeca/js-yaml/issues/456 and https://github.com/nodeca/js-yaml/pull/381
configs = jsyaml.loadAll(configFile, undefined, {
filename: configPath,
schema: jsyaml.DEFAULT_SAFE_SCHEMA
filename: configPath
});
} catch (err) {
if (err.name === "YAMLException") {
Expand Down
2 changes: 1 addition & 1 deletion lib/translators/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");
const fs = require("graceful-fs");
const {promisify} = require("util");
const readFile = promisify(fs.readFile);
const parseYaml = require("js-yaml").safeLoad;
const parseYaml = require("js-yaml").load;

function resolveProjectPaths(project) {
project.path = path.resolve(project.path);
Expand Down

0 comments on commit 22eeeb9

Please sign in to comment.