AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { isNil } from '@activepieces/core-utils'
import { FastifyBaseLogger } from 'fastify'
export const hooksFactory = {
create<T>(defaultHooks: (log: FastifyBaseLogger) => T) {
let hooksCreator: (log: FastifyBaseLogger) => T
return {
set(newHooksCreator: (log: FastifyBaseLogger) => T): void {
hooksCreator = newHooksCreator
},
get(log: FastifyBaseLogger): T {
if (isNil(hooksCreator)) {
return defaultHooks(log)
}
return hooksCreator(log)
},
}
},
}