Sha256: d83c9c6a7e1c962c71df5e7c1015d958b88bb320999e78d43fbea79f653cb739
Contents?: true
Size: 405 Bytes
Versions: 10
Compression:
Stored size: 405 Bytes
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; module.exports = function removeAndDo(collection, thing, action) { const idx = this[collection].indexOf(thing); const hasThingInCollection = idx >= 0; if(hasThingInCollection) { this[collection].splice(idx, 1); thing[action](this); } return hasThingInCollection; };
Version data entries
10 entries across 6 versions & 3 rubygems