(text: string)
| 3 | const stringOrTrailingCommaRe = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g; |
| 4 | |
| 5 | export function parseJsonc(text: string): unknown { |
| 6 | try { |
| 7 | return JSON.parse(text); |
| 8 | } catch { |
| 9 | return JSON.parse(text.replace(stringOrCommentRe, '$1').replace(stringOrTrailingCommaRe, '$1')); |
| 10 | } |
| 11 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…