(o: T, extend: OverrideOperationValue)
| 13 | * @see {@link https://orpc.dev/docs/openapi/openapi-specification#customizing-operation-objects Customizing Operation Objects Docs} |
| 14 | */ |
| 15 | export function customOpenAPIOperation<T extends object>(o: T, extend: OverrideOperationValue): T { |
| 16 | return new Proxy(o, { |
| 17 | get(target, prop, receiver) { |
| 18 | if (prop === OPERATION_EXTENDER_SYMBOL) { |
| 19 | return extend |
| 20 | } |
| 21 | |
| 22 | return Reflect.get(target, prop, receiver) |
| 23 | }, |
| 24 | }) |
| 25 | } |
| 26 | |
| 27 | export function getCustomOpenAPIOperation(o: object): OverrideOperationValue | undefined { |
| 28 | return (o as any)[OPERATION_EXTENDER_SYMBOL] as OverrideOperationValue | undefined |
no outgoing calls
no test coverage detected