better-call 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BetterFetchOption, BetterFetchResponse } from '@better-fetch/fetch';
2
- import { j as Router, Z as UnionToIntersection, b as Endpoint, W as HasRequiredKeys } from './router-DcqXHY8X.cjs';
2
+ import { j as Router, Z as UnionToIntersection, b as Endpoint, W as HasRequiredKeys } from './router-DCy0wnVr.cjs';
3
3
 
4
4
  type HasRequired<T extends {
5
5
  body?: any;
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BetterFetchOption, BetterFetchResponse } from '@better-fetch/fetch';
2
- import { j as Router, Z as UnionToIntersection, b as Endpoint, W as HasRequiredKeys } from './router-DcqXHY8X.js';
2
+ import { j as Router, Z as UnionToIntersection, b as Endpoint, W as HasRequiredKeys } from './router-DCy0wnVr.js';
3
3
 
4
4
  type HasRequired<T extends {
5
5
  body?: any;
package/dist/index.cjs CHANGED
@@ -727,6 +727,12 @@ var createEndpoint2 = (path, options, handler) => {
727
727
  response
728
728
  } : response;
729
729
  };
730
+ internalHandler.wrap = (fn) => {
731
+ const wrappedFn = async (context) => {
732
+ return fn(context, handler);
733
+ };
734
+ return createEndpoint2(path, options, wrappedFn);
735
+ };
730
736
  internalHandler.options = options;
731
737
  internalHandler.path = path;
732
738
  return internalHandler;