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

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.8",
3
+ "version": "14.0.0-next.9",
4
4
  "description": "Angular DevKit - Core Utility Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -16,13 +16,13 @@ export declare namespace strategy {
16
16
  /**
17
17
  * Creates a JobStrategy that will always reuse a running job, and restart it if the job ended.
18
18
  * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
19
- * is.
19
+ * is.
20
20
  */
21
21
  function reuse<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
22
22
  /**
23
23
  * Creates a JobStrategy that will reuse a running job if the argument matches.
24
24
  * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
25
- * is.
25
+ * is.
26
26
  */
27
27
  function memoize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
28
28
  }
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.strategy = void 0;
11
11
  const rxjs_1 = require("rxjs");
12
12
  const operators_1 = require("rxjs/operators");
13
+ const json_1 = require("../../json");
13
14
  const api_1 = require("./api");
14
- const stableStringify = require('fast-json-stable-stringify');
15
15
  // eslint-disable-next-line @typescript-eslint/no-namespace
16
16
  var strategy;
17
17
  (function (strategy) {
@@ -35,7 +35,7 @@ var strategy;
35
35
  /**
36
36
  * Creates a JobStrategy that will always reuse a running job, and restart it if the job ended.
37
37
  * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
38
- * is.
38
+ * is.
39
39
  */
40
40
  function reuse(replayMessages = false) {
41
41
  let inboundBus = new rxjs_1.Subject();
@@ -70,13 +70,20 @@ var strategy;
70
70
  /**
71
71
  * Creates a JobStrategy that will reuse a running job if the argument matches.
72
72
  * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
73
- * is.
73
+ * is.
74
74
  */
75
75
  function memoize(replayMessages = false) {
76
76
  const runs = new Map();
77
77
  return (handler, options) => {
78
78
  const newHandler = (argument, context) => {
79
- const argumentJson = stableStringify(argument);
79
+ const argumentJson = JSON.stringify((0, json_1.isJsonObject)(argument)
80
+ ? Object.keys(argument)
81
+ .sort()
82
+ .reduce((result, key) => {
83
+ result[key] = argument[key];
84
+ return result;
85
+ }, {})
86
+ : argument);
80
87
  const maybeJob = runs.get(argumentJson);
81
88
  if (maybeJob) {
82
89
  return maybeJob;