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 / module / omit.js
Size: Mime:
/**
 * @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-377567046
 */
import { isObjPure } from 'exotic';
/**
 * Returns a new object with the key/value pairs from `obj`
 * that are not in the array `omitKeys`.
 */
export const omit = (obj, omitKeys) => {
    const result = {};
    // @todo should work on sets?
    const keys = 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