Skip to content

Commit a66cfd0

Browse files
alan-agius4dgp1130
authored andcommitted
refactor(@angular-devkit/core): replace fast-json-stable-stringify import to es6
1 parent ebbb0ad commit a66cfd0

File tree

1 file changed

+5
-6
lines changed
  • packages/angular_devkit/core/src/experimental/jobs

1 file changed

+5
-6
lines changed

packages/angular_devkit/core/src/experimental/jobs/strategy.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import stableStringify from 'fast-json-stable-stringify';
910
import { Observable, Subject, concat, of } from 'rxjs';
1011
import { finalize, ignoreElements, share, shareReplay, tap } from 'rxjs/operators';
1112
import { JsonValue } from '../../json';
@@ -18,14 +19,12 @@ import {
1819
JobOutboundMessageKind,
1920
} from './api';
2021

21-
const stableStringify = require('fast-json-stable-stringify');
22-
2322
// eslint-disable-next-line @typescript-eslint/no-namespace
2423
export namespace strategy {
2524
export type JobStrategy<
2625
A extends JsonValue = JsonValue,
2726
I extends JsonValue = JsonValue,
28-
O extends JsonValue = JsonValue
27+
O extends JsonValue = JsonValue,
2928
> = (
3029
handler: JobHandler<A, I, O>,
3130
options?: Partial<Readonly<JobDescription>>,
@@ -37,7 +36,7 @@ export namespace strategy {
3736
export function serialize<
3837
A extends JsonValue = JsonValue,
3938
I extends JsonValue = JsonValue,
40-
O extends JsonValue = JsonValue
39+
O extends JsonValue = JsonValue,
4140
>(): JobStrategy<A, I, O> {
4241
let latest: Observable<JobOutboundMessage<O>> = of();
4342

@@ -66,7 +65,7 @@ export namespace strategy {
6665
export function reuse<
6766
A extends JsonValue = JsonValue,
6867
I extends JsonValue = JsonValue,
69-
O extends JsonValue = JsonValue
68+
O extends JsonValue = JsonValue,
7069
>(replayMessages = false): JobStrategy<A, I, O> {
7170
let inboundBus = new Subject<JobInboundMessage<I>>();
7271
let run: Observable<JobOutboundMessage<O>> | null = null;
@@ -121,7 +120,7 @@ export namespace strategy {
121120
export function memoize<
122121
A extends JsonValue = JsonValue,
123122
I extends JsonValue = JsonValue,
124-
O extends JsonValue = JsonValue
123+
O extends JsonValue = JsonValue,
125124
>(replayMessages = false): JobStrategy<A, I, O> {
126125
const runs = new Map<string, Observable<JobOutboundMessage<O>>>();
127126

0 commit comments

Comments
 (0)