mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-10 18:44:19 +00:00
remove node_modules
This commit is contained in:
parent
c7638c8893
commit
60358a145c
444 changed files with 0 additions and 83958 deletions
57
node_modules/before-after-hook/index.js
generated
vendored
57
node_modules/before-after-hook/index.js
generated
vendored
|
@ -1,57 +0,0 @@
|
|||
var register = require('./lib/register')
|
||||
var addHook = require('./lib/add')
|
||||
var removeHook = require('./lib/remove')
|
||||
|
||||
// bind with array of arguments: https://stackoverflow.com/a/21792913
|
||||
var bind = Function.bind
|
||||
var bindable = bind.bind(bind)
|
||||
|
||||
function bindApi (hook, state, name) {
|
||||
var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
|
||||
hook.api = { remove: removeHookRef }
|
||||
hook.remove = removeHookRef
|
||||
|
||||
;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
|
||||
var args = name ? [state, kind, name] : [state, kind]
|
||||
hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
|
||||
})
|
||||
}
|
||||
|
||||
function HookSingular () {
|
||||
var singularHookName = 'h'
|
||||
var singularHookState = {
|
||||
registry: {}
|
||||
}
|
||||
var singularHook = register.bind(null, singularHookState, singularHookName)
|
||||
bindApi(singularHook, singularHookState, singularHookName)
|
||||
return singularHook
|
||||
}
|
||||
|
||||
function HookCollection () {
|
||||
var state = {
|
||||
registry: {}
|
||||
}
|
||||
|
||||
var hook = register.bind(null, state)
|
||||
bindApi(hook, state)
|
||||
|
||||
return hook
|
||||
}
|
||||
|
||||
var collectionHookDeprecationMessageDisplayed = false
|
||||
function Hook () {
|
||||
if (!collectionHookDeprecationMessageDisplayed) {
|
||||
console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
|
||||
collectionHookDeprecationMessageDisplayed = true
|
||||
}
|
||||
return HookCollection()
|
||||
}
|
||||
|
||||
Hook.Singular = HookSingular.bind()
|
||||
Hook.Collection = HookCollection.bind()
|
||||
|
||||
module.exports = Hook
|
||||
// expose constructors as a named property for TypeScript
|
||||
module.exports.Hook = Hook
|
||||
module.exports.Singular = Hook.Singular
|
||||
module.exports.Collection = Hook.Collection
|
Loading…
Add table
Add a link
Reference in a new issue