项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

преди 4 години
123456789101112131415
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. module.exports = function removeAndDo(collection, thing, action) {
  7. const idx = this[collection].indexOf(thing);
  8. const hasThingInCollection = idx >= 0;
  9. if(hasThingInCollection) {
  10. this[collection].splice(idx, 1);
  11. thing[action](this);
  12. }
  13. return hasThingInCollection;
  14. };