github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/before-after-hook/lib/remove.js (about)

     1  module.exports = removeHook;
     2  
     3  function removeHook(state, name, method) {
     4    if (!state.registry[name]) {
     5      return;
     6    }
     7  
     8    var index = state.registry[name]
     9      .map(function (registered) {
    10        return registered.orig;
    11      })
    12      .indexOf(method);
    13  
    14    if (index === -1) {
    15      return;
    16    }
    17  
    18    state.registry[name].splice(index, 1);
    19  }