amis-rpc-design/node_modules/rc-util/lib/omit.js
2023-10-07 19:42:30 +08:00

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;
}