mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +00:00
Expose OpenAPI helper shouldIgnoreEntity (#2903)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@gitbook/openapi-parser': patch
|
||||
---
|
||||
|
||||
Expose helper `shouldIgnoreEntity`
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { OpenAPIV3 } from '@scalar/openapi-types';
|
||||
|
||||
/**
|
||||
* Check if an entity should be ignored
|
||||
*/
|
||||
export function shouldIgnoreEntity(
|
||||
data:
|
||||
| undefined
|
||||
| Pick<OpenAPIV3.TagObject, 'x-internal' | 'x-gitbook-ignore'>
|
||||
| Pick<OpenAPIV3.OperationObject, 'x-internal' | 'x-gitbook-ignore'>
|
||||
) {
|
||||
return data?.['x-internal'] === true || data?.['x-gitbook-ignore'] === true;
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
export { parseOpenAPI } from './parse';
|
||||
|
||||
export type * from '@scalar/openapi-types';
|
||||
export type * from './types';
|
||||
export * from './error';
|
||||
export * from './traverse';
|
||||
export { dereference } from '@scalar/openapi-parser';
|
||||
export type { AnyObject } from '@scalar/openapi-parser';
|
||||
export type * from '@scalar/openapi-types';
|
||||
export * from './error';
|
||||
export * from './helpers/shouldIgnoreEntity';
|
||||
export * from './traverse';
|
||||
export type * from './types';
|
||||
|
||||
Reference in New Issue
Block a user