blacklist
Version:
Returns a shallow copy of an object without blacklisted properties
2 lines (1 loc) • 666 B
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.blacklist=f()}})(function(){var define,module,exports;module={exports:exports={}};module.exports=function blacklist(src){var copy={};var filter=arguments[1];if(typeof filter==="string"){filter={};for(var i=1;i<arguments.length;i++){filter[arguments[i]]=true}}for(var key in src){if(filter[key])continue;copy[key]=src[key]}return copy};return module.exports});