Sha256: 7f4e54d891584f85055be74ab3d3fa674c2eefde4ecc5c645076650ebc29296b
Contents?: true
Size: 745 Bytes
Versions: 10
Compression:
Stored size: 745 Bytes
Contents
/*! * object.omit <https://github.com/jonschlinkert/object.omit> * * Copyright (c) 2014 Jon Schlinkert, contributors. * Licensed under the MIT License */ 'use strict'; var isObject = require('isobject'); var forOwn = require('for-own'); module.exports = function omit(obj, props) { if (obj == null || !isObject(obj)) { return {}; } // Exit as early as possible if (props == null || (Array.isArray(props) && props.length === 0)) { return obj; } if (typeof props === 'string') { props = [].slice.call(arguments, 1); } var o = {}; if (!Object.keys(obj).length) { return o; } forOwn(obj, function (value, key) { if (props.indexOf(key) === -1) { o[key] = value; } }); return o; };
Version data entries
10 entries across 10 versions & 1 rubygems