(
value: any,
replacer?: ((this: any, key: string, value: any) => any) | null,
space?: string | number
)
| 2 | * Stringify an OpenAPI object. Same API as JSON.stringify. |
| 3 | */ |
| 4 | export function stringifyOpenAPI( |
| 5 | value: any, |
| 6 | replacer?: ((this: any, key: string, value: any) => any) | null, |
| 7 | space?: string | number |
| 8 | ): string { |
| 9 | return JSON.stringify( |
| 10 | value, |
| 11 | (key, value) => { |
| 12 | // Ignore internal keys |
| 13 | if (key.startsWith('x-gitbook-')) { |
| 14 | return undefined; |
| 15 | } |
| 16 | |
| 17 | if (replacer) { |
| 18 | return replacer(key, value); |
| 19 | } |
| 20 | |
| 21 | return value; |
| 22 | }, |
| 23 | space |
| 24 | ); |
| 25 | } |
no outgoing calls
no test coverage detected