(text: string, options?: ParseOptions, parentMeta?: ParentMeta)
| 40 | } |
| 41 | |
| 42 | function doParseJSON(text: string, options?: ParseOptions, parentMeta?: ParentMeta) { |
| 43 | const visitor = new Visitor(text, options, parentMeta); |
| 44 | |
| 45 | jsonc.visit( |
| 46 | text, |
| 47 | { |
| 48 | onObjectBegin( |
| 49 | offset: number, |
| 50 | length: number, |
| 51 | startLine: number, |
| 52 | startCharacter: number, |
| 53 | pathSupplier: () => jsonc.JSONPath, |
| 54 | ) { |
| 55 | return visitor.onObjectBegin(offset, "object", pathSupplier); |
| 56 | }, |
| 57 | onObjectEnd(offset: number, length: number) { |
| 58 | return visitor.onObjectEnd(offset, length); |
| 59 | }, |
| 60 | onArrayBegin( |
| 61 | offset: number, |
| 62 | length: number, |
| 63 | startLine: number, |
| 64 | startCharacter: number, |
| 65 | pathSupplier: () => jsonc.JSONPath, |
| 66 | ) { |
| 67 | return visitor.onObjectBegin(offset, "array", pathSupplier); |
| 68 | }, |
| 69 | onArrayEnd(offset: number, length: number) { |
| 70 | return visitor.onObjectEnd(offset, length); |
| 71 | }, |
| 72 | onObjectProperty( |
| 73 | property: string, |
| 74 | offset: number, |
| 75 | length: number, |
| 76 | startLine: number, |
| 77 | startCharacter: number, |
| 78 | pathSupplier: () => jsonc.JSONPath, |
| 79 | ) { |
| 80 | return visitor.onObjectProperty(property, offset); |
| 81 | }, |
| 82 | onLiteralValue( |
| 83 | value: any, |
| 84 | offset: number, |
| 85 | length: number, |
| 86 | startLine: number, |
| 87 | startCharacter: number, |
| 88 | pathSupplier: () => jsonc.JSONPath, |
| 89 | ) { |
| 90 | return visitor.onLiteralValue(value, offset, length, pathSupplier); |
| 91 | }, |
| 92 | onError(error: jsonc.ParseErrorCode, offset: number, length: number) { |
| 93 | return visitor.onError(error, offset, length); |
| 94 | }, |
| 95 | }, |
| 96 | { |
| 97 | disallowComments: true, |
| 98 | allowTrailingComma: false, |
| 99 | }, |
no outgoing calls
no test coverage detected