(jsonString: string)
| 184 | } |
| 185 | |
| 186 | export function unprettifyJsonString(jsonString: string): string { |
| 187 | // Convert all comments to /* */ style |
| 188 | let noWhiteSpace = jsonString.replace(/\/\/(.*)/g, "/*$1*/"); |
| 189 | noWhiteSpace = noWhiteSpace.replace(/\/\*((.|\n|\r)*)\*\//g, "/*$1*/"); |
| 190 | |
| 191 | // Unprettify JSON by removal of line breaks, tabs, and excessive spaces |
| 192 | noWhiteSpace = noWhiteSpace.trim().replace(/[\r\n\t ]*\n[\r\n\t ]*/g, ""); |
| 193 | noWhiteSpace = noWhiteSpace.replace(/[\r\n\t ]+/g, " "); |
| 194 | noWhiteSpace = noWhiteSpace.replace(/, /g, ","); |
| 195 | noWhiteSpace = noWhiteSpace.replace(/": "/g, '":"'); |
| 196 | return noWhiteSpace; |
| 197 | } |
| 198 | |
| 199 | export function splitMarkdownIntoSentences(markdown: string): string[] { |
| 200 | /** Does what it says on the tin. |
no outgoing calls
no test coverage detected