fork of hey-api/openapi-ts because I need some additional things
1import type { Context, PluginInstance } from '@hey-api/shared';
2
3import type { Config } from './types';
4
5export function getTypedConfig(
6 plugin: Pick<PluginInstance, 'context'> | Pick<Context, 'config'>,
7): Config {
8 if ('context' in plugin) {
9 return plugin.context.config as Config;
10 }
11 return plugin.config as Config;
12}