mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 19:13:34 +08:00
refactor(@angular-devkit/core): replace fast-json-stable-stringify
import to es6
This commit is contained in:
parent
ebbb0adf56
commit
a66cfd0c6d
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import stableStringify from 'fast-json-stable-stringify';
|
||||||
import { Observable, Subject, concat, of } from 'rxjs';
|
import { Observable, Subject, concat, of } from 'rxjs';
|
||||||
import { finalize, ignoreElements, share, shareReplay, tap } from 'rxjs/operators';
|
import { finalize, ignoreElements, share, shareReplay, tap } from 'rxjs/operators';
|
||||||
import { JsonValue } from '../../json';
|
import { JsonValue } from '../../json';
|
||||||
@ -18,14 +19,12 @@ import {
|
|||||||
JobOutboundMessageKind,
|
JobOutboundMessageKind,
|
||||||
} from './api';
|
} from './api';
|
||||||
|
|
||||||
const stableStringify = require('fast-json-stable-stringify');
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
export namespace strategy {
|
export namespace strategy {
|
||||||
export type JobStrategy<
|
export type JobStrategy<
|
||||||
A extends JsonValue = JsonValue,
|
A extends JsonValue = JsonValue,
|
||||||
I extends JsonValue = JsonValue,
|
I extends JsonValue = JsonValue,
|
||||||
O extends JsonValue = JsonValue
|
O extends JsonValue = JsonValue,
|
||||||
> = (
|
> = (
|
||||||
handler: JobHandler<A, I, O>,
|
handler: JobHandler<A, I, O>,
|
||||||
options?: Partial<Readonly<JobDescription>>,
|
options?: Partial<Readonly<JobDescription>>,
|
||||||
@ -37,7 +36,7 @@ export namespace strategy {
|
|||||||
export function serialize<
|
export function serialize<
|
||||||
A extends JsonValue = JsonValue,
|
A extends JsonValue = JsonValue,
|
||||||
I extends JsonValue = JsonValue,
|
I extends JsonValue = JsonValue,
|
||||||
O extends JsonValue = JsonValue
|
O extends JsonValue = JsonValue,
|
||||||
>(): JobStrategy<A, I, O> {
|
>(): JobStrategy<A, I, O> {
|
||||||
let latest: Observable<JobOutboundMessage<O>> = of();
|
let latest: Observable<JobOutboundMessage<O>> = of();
|
||||||
|
|
||||||
@ -66,7 +65,7 @@ export namespace strategy {
|
|||||||
export function reuse<
|
export function reuse<
|
||||||
A extends JsonValue = JsonValue,
|
A extends JsonValue = JsonValue,
|
||||||
I extends JsonValue = JsonValue,
|
I extends JsonValue = JsonValue,
|
||||||
O extends JsonValue = JsonValue
|
O extends JsonValue = JsonValue,
|
||||||
>(replayMessages = false): JobStrategy<A, I, O> {
|
>(replayMessages = false): JobStrategy<A, I, O> {
|
||||||
let inboundBus = new Subject<JobInboundMessage<I>>();
|
let inboundBus = new Subject<JobInboundMessage<I>>();
|
||||||
let run: Observable<JobOutboundMessage<O>> | null = null;
|
let run: Observable<JobOutboundMessage<O>> | null = null;
|
||||||
@ -121,7 +120,7 @@ export namespace strategy {
|
|||||||
export function memoize<
|
export function memoize<
|
||||||
A extends JsonValue = JsonValue,
|
A extends JsonValue = JsonValue,
|
||||||
I extends JsonValue = JsonValue,
|
I extends JsonValue = JsonValue,
|
||||||
O extends JsonValue = JsonValue
|
O extends JsonValue = JsonValue,
|
||||||
>(replayMessages = false): JobStrategy<A, I, O> {
|
>(replayMessages = false): JobStrategy<A, I, O> {
|
||||||
const runs = new Map<string, Observable<JobOutboundMessage<O>>>();
|
const runs = new Map<string, Observable<JobOutboundMessage<O>>>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user