Files
gitbook/packages/react-openapi/src/utils.ts
T
Brett Jephson e9149036f6 RND-3387: synchronize response tabs (#2457)
Co-authored-by: Samy Pessé <samypesse@gmail.com>
2024-09-12 11:01:29 +01:00

14 lines
365 B
TypeScript

import { OpenAPIV3 } from 'openapi-types';
export function noReference<T>(input: T | OpenAPIV3.ReferenceObject): T {
if (typeof input === 'object' && !!input && '$ref' in input) {
throw new Error('Reference found');
}
return input;
}
export function createStateKey(key: string, scope?: string) {
return scope ? `${scope}_${key}` : key;
}