mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 19:04:20 +00:00
vendor node_modules for release
This commit is contained in:
parent
6ecc92f5ad
commit
83407ce885
446 changed files with 83961 additions and 2 deletions
28
node_modules/before-after-hook/lib/register.js
generated
vendored
Normal file
28
node_modules/before-after-hook/lib/register.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
module.exports = register
|
||||
|
||||
function register (state, name, method, options) {
|
||||
if (typeof method !== 'function') {
|
||||
throw new Error('method for before hook must be a function')
|
||||
}
|
||||
|
||||
if (!options) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (Array.isArray(name)) {
|
||||
return name.reverse().reduce(function (callback, name) {
|
||||
return register.bind(null, state, name, callback, options)
|
||||
}, method)()
|
||||
}
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
if (!state.registry[name]) {
|
||||
return method(options)
|
||||
}
|
||||
|
||||
return (state.registry[name]).reduce(function (method, registered) {
|
||||
return registered.hook.bind(null, method, options)
|
||||
}, method)()
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue