2024-08-20 23:25:37 +04:00

9 lines
203 B
JavaScript

export default function omit(obj, fields) {
var clone = Object.assign({}, obj);
if (Array.isArray(fields)) {
fields.forEach(function (key) {
delete clone[key];
});
}
return clone;
}