This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/@octokit/webhooks/dist-src/event-handler/index.js
T

28 lines
723 B
JavaScript

import { createLogger } from "../create-logger.js";
import {
receiverOn as on,
receiverOnAny as onAny,
receiverOnError as onError
} from "./on.js";
import { receiverHandle as receive } from "./receive.js";
import { removeListener } from "./remove-listener.js";
function createEventHandler(options) {
const state = {
hooks: {},
log: createLogger(options && options.log)
};
if (options && options.transform) {
state.transform = options.transform;
}
return {
on: on.bind(null, state),
onAny: onAny.bind(null, state),
onError: onError.bind(null, state),
removeListener: removeListener.bind(null, state),
receive: receive.bind(null, state)
};
}
export {
createEventHandler
};