* Get the syntax from a media type.
(mediaType: string)
| 117 | * Get the syntax from a media type. |
| 118 | */ |
| 119 | function getSyntaxFromMediaType(mediaType: string): string { |
| 120 | if (mediaType.includes('json')) { |
| 121 | return 'json'; |
| 122 | } |
| 123 | |
| 124 | if (mediaType.includes('yaml')) { |
| 125 | return 'yaml'; |
| 126 | } |
| 127 | |
| 128 | if (mediaType === 'application/xml') { |
| 129 | return 'xml'; |
| 130 | } |
| 131 | |
| 132 | return 'text'; |
| 133 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…