Skip to content

Commit 32581ef

Browse files
committed
refactor(@angular-devkit/core): deprecate json parser
Use 3rd party JSON parsers such as `jsonc-parser` instead.
1 parent 0bc1597 commit 32581ef

File tree

1 file changed

+8
-0
lines changed
  • packages/angular_devkit/core/src/json

1 file changed

+8
-0
lines changed

packages/angular_devkit/core/src/json/parser.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class JsonException extends BaseException {}
2929

3030
/**
3131
* A character was invalid in this context.
32+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
3233
*/
3334
export class InvalidJsonCharacterException extends JsonException {
3435
invalidChar: string;
@@ -51,6 +52,7 @@ export class InvalidJsonCharacterException extends JsonException {
5152

5253
/**
5354
* More input was expected, but we reached the end of the stream.
55+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
5456
*/
5557
export class UnexpectedEndOfInputException extends JsonException {
5658
constructor(_context: JsonParserContext) {
@@ -60,6 +62,7 @@ export class UnexpectedEndOfInputException extends JsonException {
6062

6163
/**
6264
* An error happened within a file.
65+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
6366
*/
6467
export class PathSpecificJsonException extends JsonException {
6568
constructor(public path: string, public exception: JsonException) {
@@ -69,6 +72,7 @@ export class PathSpecificJsonException extends JsonException {
6972

7073
/**
7174
* Context passed around the parser with information about where we currently are in the parse.
75+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
7276
*/
7377
export interface JsonParserContext {
7478
position: Position;
@@ -832,6 +836,8 @@ export enum JsonParseMode {
832836
* Parse the JSON string and return its AST. The AST may be losing data (end comments are
833837
* discarded for example, and space characters are not represented in the AST), but all values
834838
* will have a single node in the AST (a 1-to-1 mapping).
839+
*
840+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
835841
* @param input The string to use.
836842
* @param mode The mode to parse the input with. {@see JsonParseMode}.
837843
* @returns {JsonAstNode} The root node of the value of the AST.
@@ -863,6 +869,7 @@ export function parseJsonAst(input: string, mode = JsonParseMode.Default): JsonA
863869

864870
/**
865871
* Options for the parseJson() function.
872+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
866873
*/
867874
export interface ParseJsonOptions {
868875
/**
@@ -879,6 +886,7 @@ export interface ParseJsonOptions {
879886
* If a path option is pass, it also absorbs JSON parsing errors and return a new error with the
880887
* path in it. Useful for showing errors when parsing from a file.
881888
*
889+
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
882890
* @param input The string to parse.
883891
* @param mode The mode to parse the input with. {@see JsonParseMode}.
884892
* @param options Additional optinos for parsing.

0 commit comments

Comments
 (0)