@apideck/portman
Version:
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
21 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripResponseExamples = void 0;
var tslib_1 = require("tslib");
var legacy_1 = tslib_1.__importDefault(require("neotraverse/legacy"));
var stripResponseExamples = function (portmanCollection) {
if (!(portmanCollection === null || portmanCollection === void 0 ? void 0 : portmanCollection.item))
return portmanCollection;
(0, legacy_1.default)(portmanCollection.item).forEach(function (node) {
var _a, _b;
if (((_a = this === null || this === void 0 ? void 0 : this.parent) === null || _a === void 0 ? void 0 : _a.key) === 'item' && (node === null || node === void 0 ? void 0 : node.response)) {
node.response = [];
}
if (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.isRoot) === true && (node === null || node === void 0 ? void 0 : node.response)) {
node.response = [];
}
});
return portmanCollection;
};
exports.stripResponseExamples = stripResponseExamples;
//# sourceMappingURL=stripResponseExamples.js.map