17 lines
494 B
JavaScript
17 lines
494 B
JavaScript
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = omit;
|
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
function omit(obj, fields) {
|
|
var clone = (0, _objectSpread2.default)({}, obj);
|
|
if (Array.isArray(fields)) {
|
|
fields.forEach(function (key) {
|
|
delete clone[key];
|
|
});
|
|
}
|
|
return clone;
|
|
} |