9 lines
203 B
JavaScript
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;
|
|
} |