UNPKG
slack-webhooks-handler
Version:
latest (1.2.2)
1.2.2
1.2.1
1.2.0
1.1.1
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Manage incoming webhooks to send messages to Slack
iniva/slack-webhooks-handler
slack-webhooks-handler
/
src
/
factory.js
16 lines
(11 loc)
•
283 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import
github
from
'./github'
;
const
factory
=
type
=> {
const
webhooks = { github };
if
(!
Object
.
keys
(webhooks).
includes
(
type
)) {
throw
new
Error
(
`Webhooks for [
${
type
}
] are not available`
); }
return
webhooks[
type
]; }
export
default
factory;