openapi-merge-cli
Advanced tools
Comparing version 1.1.20 to 1.1.23
@@ -58,2 +58,7 @@ "use strict"; | ||
} | ||
function readFileAsString(filePath) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield readFilePromise(filePath)).toString('utf-8'); | ||
}); | ||
} | ||
class JsonOrYamlParseError extends Error { | ||
@@ -64,5 +69,4 @@ constructor(jsonError, yamlError) { | ||
} | ||
function readYamlOrJSON(filePath) { | ||
function readYamlOrJSON(fileContents) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const fileContents = (yield readFilePromise(filePath)).toString('utf-8'); | ||
let jsonError; | ||
@@ -90,7 +94,8 @@ try { | ||
logger.log(`## Loading input ${inputIndex}: ${fullPath}`); | ||
return (yield readYamlOrJSON(fullPath)); | ||
return (yield readYamlOrJSON(yield readFileAsString(fullPath))); | ||
} | ||
else { | ||
logger.log(`## Loading input ${inputIndex} from URL: ${input.inputURL}`); | ||
return yield isomorphic_fetch_1.default(input.inputURL).then(rsp => rsp.json()); | ||
const inputContents = yield isomorphic_fetch_1.default(input.inputURL).then(rsp => rsp.text()); | ||
return (yield readYamlOrJSON(inputContents)); | ||
} | ||
@@ -97,0 +102,0 @@ }); |
{ | ||
"name": "openapi-merge-cli", | ||
"version": "1.1.20", | ||
"version": "1.1.23", | ||
"description": "A cli tool for the openapi-merge library.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27261
491