JSONVisitor.onObjectBeginandJSONVisitor.onArrayBegincan now returnfalseto instruct the visitor that no children should be visited.
- update the version of the bundled Javascript files to
es2020. - include all
const enumvalues in the bundled JavaScript files (ScanError,SyntaxKind,ParseErrorCode).
- added new API
FormattingOptions.keepLines: It leaves the initial line positions in the formatting.
- fixed API spec for
parseTree. Can returnundefinefor empty input. - added new API
FormattingOptions.insertFinalNewline.
- new API
ModificationOptions.isArrayInsertion: IfJSONPathrefers to an index of an array andisArrayInsertionistrue, thenmodifywill insert a new item at that location instead of overwriting its contents. ModificationOptions.formattingOptionsis now optional. If not set, newly inserted content will not be formatted.
- added
ParseOptions.allowEmptyContent. Default isfalse. - new API
getNodeType: Returns the type of a value returned by parse. parse: Fix issue with empty property name
JSONScannerandJSONVisitorreturn lineNumber / character.
- renamed
Node.columnOffsettoNode.colonOffset - new API
getNodePath: Gets the JSON path of the given JSON DOM node - new API
findNodeAtOffset: Finds the most inner node at the given offset. IfincludeRightBoundis set, also finds nodes that end at the given offset.
- provide ems modules
- added the
visit.onCommentAPI, reported when comments are allowed. - added the
ParseErrorCode.InvalidCommentTokenenum value, reported when comments are disallowed.
- added the
formatAPI: computes edits to format a JSON document. - added the
modifyAPI: computes edits to insert, remove or replace a property or value in a JSON document. - added the
allyEditsAPI: applies edits to a document
- remove nls dependency (remove
getParseErrorMessage)
- added
ParseError.offset&ParseError.length
- added
ParseOptions.allowTrailingComma
- fix for
getLocation. NowgetLocationinside an object will always return a property from inside that property. Can be empty string if the object has no properties or if the offset is before a actual property{ "a": { | }} will return location ['a', ' ']
- Updating to typescript 2.0