Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/utils / dist / omit.js
Size: Mime:
"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