Repository URL to install this package:
|
Version:
1.0.10 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-377567046
*/
const exotic_1 = require("exotic");
/**
* Returns a new object with the key/value pairs from `obj`
* that are not in the array `omitKeys`.
*/
exports.omit = (obj, omitKeys) => {
const result = {};
// @todo should work on sets?
const keys = exotic_1.isObjPure(omitKeys) ? Object.keys(omitKeys) : omitKeys;
Object.keys(obj).forEach(key => {
if (keys.includes(key) === false) {
result[key] = obj[key];
}
});
return result;
};
//# sourceMappingURL=omit.js.map