fd22b0bf58
V2 (Laravel re-make)
23 lines
482 B
JavaScript
23 lines
482 B
JavaScript
'use strict';
|
|
|
|
var variadic = require('./variadic');
|
|
|
|
/**
|
|
* Delete keys helper
|
|
*
|
|
* Delete one or multiple keys from an object
|
|
*
|
|
* @param obj
|
|
* @param keys
|
|
* @returns {void}
|
|
*/
|
|
module.exports = function deleteKeys(obj) {
|
|
for (var _len = arguments.length, keys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
keys[_key - 1] = arguments[_key];
|
|
}
|
|
|
|
variadic(keys).forEach(function (key) {
|
|
// eslint-disable-next-line
|
|
delete obj[key];
|
|
});
|
|
}; |