Repository URL to install this package:
|
Version:
1.2.19 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.omit = omit;
var _exotic = require("exotic");
/**
* Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
*/
function omit(obj, omitKeys) {
const result = {}; // @todo should work on sets?
const keys = (0, _exotic.isObjPure)(omitKeys) ? Object.keys(omitKeys) : omitKeys;
Object.keys(obj).forEach(key => {
if (keys.indexOf(key) === -1) {
result[key] = obj[key];
}
});
return result;
}