my-idlers/node_modules/collect.js/dist/helpers/deleteKeys.js
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

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];
});
};