Skip to content

Commit

Permalink
refactor: Upgrade json-refs to v3 (#7763)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbarthelet committed May 26, 2020
1 parent 4724cb8 commit 97e99fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/classes/YamlParser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

const path = require('path');
const YAML = require('js-yaml');
const resolve = require('json-refs').resolveRefs;

Expand All @@ -10,10 +9,6 @@ class YamlParser {
}

parse(yamlFilePath) {
let parentDir = yamlFilePath.split(path.sep);
parentDir.pop();
parentDir = parentDir.join('/');

const root = this.serverless.utils.readFileSync(yamlFilePath);
const options = {
filter: ['relative', 'remote'],
Expand All @@ -22,7 +17,7 @@ class YamlParser {
callback(null, YAML.load(res.text));
},
},
relativeBase: parentDir,
location: yamlFilePath,
};
return resolve(root, options).then(res => res.resolved);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"is-wsl": "^2.2.0",
"js-yaml": "^3.13.1",
"json-cycle": "^1.3.0",
"json-refs": "^2.1.7",
"json-refs": "^3.0.15",
"jwt-decode": "^2.2.0",
"lodash": "^4.17.15",
"memoizee": "^0.4.14",
Expand Down

0 comments on commit 97e99fc

Please sign in to comment.