refactor: Upgrade json-refs to v3 (#7763)

This commit is contained in:
Frédéric Barthelet 2020-05-26 10:13:56 +02:00 committed by GitHub
parent 4724cb8eeb
commit 97e99fc8f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -1,6 +1,5 @@
'use strict';
const path = require('path');
const YAML = require('js-yaml');
const resolve = require('json-refs').resolveRefs;
@ -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'],
@ -22,7 +17,7 @@ class YamlParser {
callback(null, YAML.load(res.text));
},
},
relativeBase: parentDir,
location: yamlFilePath,
};
return resolve(root, options).then(res => res.resolved);
}

View File

@ -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",