{"version":3,"file":"hook.cjs","sources":["../../src/hook.ts"],"sourcesContent":["import { Props } from './types'\n\n/**\n * A helper function to more easily create hook\n * functions. Encapsulates some of the boiler\n * plate needed to create the hook structure.\n *\n * @example\n * const useCors = () => hook((func, props) => {\n *   return await func(addCorsHeaders(props))\n * })\n */\nexport function hook<\n  TGivenProps extends Props = Props,\n  TProducedProps extends Props = Props,\n  TReturn = any\n>(\n  fn: (\n    func: (props: TProducedProps) => any\n  ) => (props: TGivenProps) => Promise<TReturn>\n) {\n  return fn\n}\n"],"names":[],"mappings":";;AAYO,SAAS,KAKd,EAGA,EAAA;AACA,EAAO,OAAA,EAAA,CAAA;AACT;;;;"}