@apideck/portman
Version:
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
17 lines • 659 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.omitKeys = void 0;
var omitKeys = function (obj, keys) {
return obj !== Object(obj)
? obj
: Array.isArray(obj)
? obj.map(function (item) { return (0, exports.omitKeys)(item, keys); })
: Object.keys(obj)
.filter(function (k) { return !keys.includes(k); })
.reduce(function (acc, x) {
var _a;
return Object.assign(acc, (_a = {}, _a[x] = (0, exports.omitKeys)(obj[x], keys), _a));
}, {});
};
exports.omitKeys = omitKeys;
//# sourceMappingURL=omitKeys.js.map