@angular-devkit/core 14.0.0-next.7 → 14.0.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/core",
3
- "version": "14.0.0-next.7",
3
+ "version": "14.0.0-next.8",
4
4
  "description": "Angular DevKit - Core Utility Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { BaseException } from '../exception';
9
9
  import { JsonAstNode, Position } from './parser_ast';
10
- import { JsonValue } from './utils';
11
10
  export declare class JsonException extends BaseException {
12
11
  }
13
12
  /**
@@ -30,15 +29,6 @@ export declare class InvalidJsonCharacterException extends JsonException {
30
29
  export declare class UnexpectedEndOfInputException extends JsonException {
31
30
  constructor(_context: JsonParserContext);
32
31
  }
33
- /**
34
- * An error happened within a file.
35
- * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
36
- */
37
- export declare class PathSpecificJsonException extends JsonException {
38
- path: string;
39
- exception: JsonException;
40
- constructor(path: string, exception: JsonException);
41
- }
42
32
  /**
43
33
  * Context passed around the parser with information about where we currently are in the parse.
44
34
  * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
@@ -78,27 +68,3 @@ export declare enum JsonParseMode {
78
68
  * @returns {JsonAstNode} The root node of the value of the AST.
79
69
  */
80
70
  export declare function parseJsonAst(input: string, mode?: JsonParseMode): JsonAstNode;
81
- /**
82
- * Options for the parseJson() function.
83
- * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
84
- */
85
- export interface ParseJsonOptions {
86
- /**
87
- * If omitted, will only emit errors related to the content of the JSON. If specified, any
88
- * JSON errors will also include the path of the file that caused the error.
89
- */
90
- path?: string;
91
- }
92
- /**
93
- * Parse a JSON string into its value. This discards the AST and only returns the value itself.
94
- *
95
- * If a path option is pass, it also absorbs JSON parsing errors and return a new error with the
96
- * path in it. Useful for showing errors when parsing from a file.
97
- *
98
- * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
99
- * @param input The string to parse.
100
- * @param mode The mode to parse the input with. {@see JsonParseMode}.
101
- * @param options Additional optinos for parsing.
102
- * @returns {JsonValue} The value represented by the JSON string.
103
- */
104
- export declare function parseJson(input: string, mode?: JsonParseMode, options?: ParseJsonOptions): JsonValue;
@@ -7,7 +7,7 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.parseJson = exports.parseJsonAst = exports.JsonParseMode = exports.PathSpecificJsonException = exports.UnexpectedEndOfInputException = exports.InvalidJsonCharacterException = exports.JsonException = void 0;
10
+ exports.parseJsonAst = exports.JsonParseMode = exports.UnexpectedEndOfInputException = exports.InvalidJsonCharacterException = exports.JsonException = void 0;
11
11
  /* eslint-disable no-constant-condition */
12
12
  const exception_1 = require("../exception");
13
13
  class JsonException extends exception_1.BaseException {
@@ -41,18 +41,6 @@ class UnexpectedEndOfInputException extends JsonException {
41
41
  }
42
42
  }
43
43
  exports.UnexpectedEndOfInputException = UnexpectedEndOfInputException;
44
- /**
45
- * An error happened within a file.
46
- * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
47
- */
48
- class PathSpecificJsonException extends JsonException {
49
- constructor(path, exception) {
50
- super(`An error happened at file path ${JSON.stringify(path)}: ${exception.message}`);
51
- this.path = path;
52
- this.exception = exception;
53
- }
54
- }
55
- exports.PathSpecificJsonException = PathSpecificJsonException;
56
44
  /**
57
45
  * Peek and return the next character from the context.
58
46
  * @private
@@ -753,36 +741,3 @@ function parseJsonAst(input, mode = JsonParseMode.Default) {
753
741
  return ast;
754
742
  }
755
743
  exports.parseJsonAst = parseJsonAst;
756
- /**
757
- * Parse a JSON string into its value. This discards the AST and only returns the value itself.
758
- *
759
- * If a path option is pass, it also absorbs JSON parsing errors and return a new error with the
760
- * path in it. Useful for showing errors when parsing from a file.
761
- *
762
- * @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
763
- * @param input The string to parse.
764
- * @param mode The mode to parse the input with. {@see JsonParseMode}.
765
- * @param options Additional optinos for parsing.
766
- * @returns {JsonValue} The value represented by the JSON string.
767
- */
768
- function parseJson(input, mode = JsonParseMode.Default, options) {
769
- try {
770
- // Try parsing for the fastest path available, if error, uses our own parser for better errors.
771
- if (mode == JsonParseMode.Strict) {
772
- try {
773
- return JSON.parse(input);
774
- }
775
- catch (err) {
776
- return parseJsonAst(input, mode).value;
777
- }
778
- }
779
- return parseJsonAst(input, mode).value;
780
- }
781
- catch (e) {
782
- if (options && options.path && e instanceof JsonException) {
783
- throw new PathSpecificJsonException(options.path, e);
784
- }
785
- throw e;
786
- }
787
- }
788
- exports.parseJson = parseJson;