@trpc/client 10.0.0-alpha.21 → 10.0.0-alpha.22
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/dist/index.js +313 -270
- package/dist/index.mjs +301 -257
- package/dist/internals/TRPCClient.d.ts +12 -7
- package/dist/internals/TRPCClient.d.ts.map +1 -1
- package/dist/internals/dataLoader.d.ts +7 -6
- package/dist/internals/dataLoader.d.ts.map +1 -1
- package/dist/links/dedupeLink.d.ts.map +1 -1
- package/dist/links/httpBatchLink.d.ts +1 -1
- package/dist/links/httpBatchLink.d.ts.map +1 -1
- package/dist/links/index.d.ts +0 -2
- package/dist/links/index.d.ts.map +1 -1
- package/dist/links/internals/httpUtils.d.ts +15 -7
- package/dist/links/internals/httpUtils.d.ts.map +1 -1
- package/dist/links/internals/transformOperationResult.d.ts +17 -3
- package/dist/links/internals/transformOperationResult.d.ts.map +1 -1
- package/dist/links/loggerLink.d.ts.map +1 -1
- package/dist/links/retryLink.d.ts.map +1 -1
- package/dist/links/types.d.ts +10 -7
- package/dist/links/types.d.ts.map +1 -1
- package/dist/links/wsLink.d.ts +1 -1
- package/dist/links/wsLink.d.ts.map +1 -1
- package/package.json +5 -11
- package/src/internals/TRPCClient.ts +48 -24
- package/src/internals/dataLoader.ts +116 -54
- package/src/links/dedupeLink.test.ts +1 -1
- package/src/links/dedupeLink.ts +1 -2
- package/src/links/httpBatchLink.ts +54 -31
- package/src/links/httpLink.ts +3 -3
- package/src/links/index.ts +0 -2
- package/src/links/internals/createChain.test.ts +1 -1
- package/src/links/internals/createChain.ts +1 -1
- package/src/links/internals/httpUtils.ts +52 -31
- package/src/links/internals/transformOperationResult.ts +40 -12
- package/src/links/loggerLink.ts +1 -1
- package/src/links/retryLink.ts +1 -2
- package/src/links/splitLink.test.ts +1 -1
- package/src/links/splitLink.ts +4 -4
- package/src/links/types.ts +12 -7
- package/src/links/wsLink.ts +11 -10
- package/dist/links/transformerLink.d.ts +0 -4
- package/dist/links/transformerLink.d.ts.map +0 -1
- package/dist/observable/index.d.ts +0 -4
- package/dist/observable/index.d.ts.map +0 -1
- package/dist/observable/index.js +0 -38
- package/dist/observable/index.mjs +0 -31
- package/dist/observable/index.ts.js +0 -1
- package/dist/observable/internals/identity.d.ts +0 -2
- package/dist/observable/internals/identity.d.ts.map +0 -1
- package/dist/observable/internals/observableToPromise.d.ts +0 -10
- package/dist/observable/internals/observableToPromise.d.ts.map +0 -1
- package/dist/observable/internals/pipe.d.ts +0 -4
- package/dist/observable/internals/pipe.d.ts.map +0 -1
- package/dist/observable/observable.d.ts +0 -4
- package/dist/observable/observable.d.ts.map +0 -1
- package/dist/observable/operators/index.d.ts +0 -4
- package/dist/observable/operators/index.d.ts.map +0 -1
- package/dist/observable/operators/map.d.ts +0 -3
- package/dist/observable/operators/map.d.ts.map +0 -1
- package/dist/observable/operators/share.d.ts +0 -6
- package/dist/observable/operators/share.d.ts.map +0 -1
- package/dist/observable/operators/tap.d.ts +0 -3
- package/dist/observable/operators/tap.d.ts.map +0 -1
- package/dist/observable/types.d.ts +0 -29
- package/dist/observable/types.d.ts.map +0 -1
- package/dist/tap-0dcdee86.js +0 -243
- package/dist/tap-136a9a90.mjs +0 -239
- package/observable/dist/trpc-client-rx.cjs.d.ts +0 -1
- package/observable/dist/trpc-client-rx.cjs.dev.js +0 -9
- package/observable/dist/trpc-client-rx.cjs.js +0 -7
- package/observable/dist/trpc-client-rx.cjs.prod.js +0 -9
- package/observable/dist/trpc-client-rx.esm.js +0 -1
- package/observable/index.d.ts +0 -1
- package/observable/index.js +0 -1
- package/src/links/transformerLink.ts +0 -74
- package/src/observable/index.ts +0 -3
- package/src/observable/internals/identity.ts +0 -3
- package/src/observable/internals/observableToPromise.ts +0 -49
- package/src/observable/internals/pipe.ts +0 -22
- package/src/observable/observable.test.ts +0 -101
- package/src/observable/observable.ts +0 -70
- package/src/observable/operators/index.ts +0 -3
- package/src/observable/operators/map.test.ts +0 -92
- package/src/observable/operators/map.ts +0 -25
- package/src/observable/operators/share.test.ts +0 -60
- package/src/observable/operators/share.ts +0 -67
- package/src/observable/operators/tap.ts +0 -26
- package/src/observable/types.ts +0 -69
package/src/links/wsLink.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { AnyRouter, ProcedureType } from '@trpc/server';
|
|
2
|
+
import { UnsubscribeFn, observable } from '@trpc/server/observable';
|
|
2
3
|
import {
|
|
3
4
|
TRPCClientIncomingMessage,
|
|
4
5
|
TRPCClientIncomingRequest,
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
TRPCClientOutgoingMessage,
|
|
7
|
+
TRPCRequestMessage,
|
|
8
|
+
TRPCResponseMessage,
|
|
7
9
|
} from '@trpc/server/rpc';
|
|
8
10
|
import { TRPCClientError } from '../TRPCClientError';
|
|
9
11
|
import { retryDelay } from '../internals/retryDelay';
|
|
10
|
-
import { UnsubscribeFn, observable } from '../observable';
|
|
11
12
|
import { Operation, OperationResultObserver, TRPCLink } from './types';
|
|
12
13
|
|
|
13
14
|
export interface WebSocketClientOptions {
|
|
@@ -30,7 +31,7 @@ export function createWSClient(opts: WebSocketClientOptions) {
|
|
|
30
31
|
/**
|
|
31
32
|
* outgoing messages buffer whilst not open
|
|
32
33
|
*/
|
|
33
|
-
let outgoing:
|
|
34
|
+
let outgoing: TRPCClientOutgoingMessage[] = [];
|
|
34
35
|
/**
|
|
35
36
|
* pending outgoing requests that are awaiting callback
|
|
36
37
|
*/
|
|
@@ -140,7 +141,7 @@ export function createWSClient(opts: WebSocketClientOptions) {
|
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
};
|
|
143
|
-
const handleIncomingResponse = (data:
|
|
144
|
+
const handleIncomingResponse = (data: TRPCResponseMessage) => {
|
|
144
145
|
const req = data.id !== null && pendingRequests[data.id];
|
|
145
146
|
if (!req) {
|
|
146
147
|
// do something?
|
|
@@ -207,9 +208,8 @@ export function createWSClient(opts: WebSocketClientOptions) {
|
|
|
207
208
|
|
|
208
209
|
function request(op: Operation, callbacks: TCallbacks): UnsubscribeFn {
|
|
209
210
|
const { type, input, path, id } = op;
|
|
210
|
-
const envelope:
|
|
211
|
+
const envelope: TRPCRequestMessage = {
|
|
211
212
|
id,
|
|
212
|
-
jsonrpc: '2.0',
|
|
213
213
|
method: type,
|
|
214
214
|
params: {
|
|
215
215
|
input,
|
|
@@ -237,7 +237,6 @@ export function createWSClient(opts: WebSocketClientOptions) {
|
|
|
237
237
|
outgoing.push({
|
|
238
238
|
id,
|
|
239
239
|
method: 'subscription.stop',
|
|
240
|
-
params: undefined,
|
|
241
240
|
});
|
|
242
241
|
dispatch();
|
|
243
242
|
}
|
|
@@ -278,11 +277,13 @@ class TRPCSubscriptionEndedError extends Error {
|
|
|
278
277
|
export function wsLink<TRouter extends AnyRouter>(
|
|
279
278
|
opts: WebSocketLinkOptions,
|
|
280
279
|
): TRPCLink<TRouter> {
|
|
281
|
-
return () => {
|
|
280
|
+
return (runtime) => {
|
|
282
281
|
const { client } = opts;
|
|
283
282
|
return ({ op }) => {
|
|
284
283
|
return observable((observer) => {
|
|
285
|
-
const { type,
|
|
284
|
+
const { type, path, id, context } = op;
|
|
285
|
+
|
|
286
|
+
const input = runtime.transformer.serialize(op.input);
|
|
286
287
|
|
|
287
288
|
let isDone = false;
|
|
288
289
|
const unsub = client.request(
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AnyRouter, ClientDataTransformerOptions } from '@trpc/server';
|
|
2
|
-
import { TRPCLink } from './types';
|
|
3
|
-
export declare function transformerLink<TRouter extends AnyRouter = AnyRouter>(transformer: ClientDataTransformerOptions): TRPCLink<TRouter>;
|
|
4
|
-
//# sourceMappingURL=transformerLink.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformerLink.d.ts","sourceRoot":"","sources":["../../src/links/transformerLink.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,4BAA4B,EAE7B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAmB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAgCpD,wBAAgB,eAAe,CAAC,OAAO,SAAS,SAAS,GAAG,SAAS,EACnE,WAAW,EAAE,4BAA4B,GACxC,QAAQ,CAAC,OAAO,CAAC,CAiCnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observable/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/observable/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var tap = require('../tap-0dcdee86.js');
|
|
6
|
-
|
|
7
|
-
function map(project) {
|
|
8
|
-
return function (originalObserver) {
|
|
9
|
-
return {
|
|
10
|
-
subscribe: function subscribe(observer) {
|
|
11
|
-
var index = 0;
|
|
12
|
-
var subscription = originalObserver.subscribe({
|
|
13
|
-
next: function next(value) {
|
|
14
|
-
var _observer$next;
|
|
15
|
-
|
|
16
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, project(value, index++));
|
|
17
|
-
},
|
|
18
|
-
error: function error(_error) {
|
|
19
|
-
var _observer$error;
|
|
20
|
-
|
|
21
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, _error);
|
|
22
|
-
},
|
|
23
|
-
complete: function complete() {
|
|
24
|
-
var _observer$complete;
|
|
25
|
-
|
|
26
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return subscription;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.observable = tap.observable;
|
|
36
|
-
exports.share = tap.share;
|
|
37
|
-
exports.tap = tap.tap;
|
|
38
|
-
exports.map = map;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export { o as observable, s as share, t as tap } from '../tap-136a9a90.mjs';
|
|
2
|
-
|
|
3
|
-
function map(project) {
|
|
4
|
-
return function (originalObserver) {
|
|
5
|
-
return {
|
|
6
|
-
subscribe: function subscribe(observer) {
|
|
7
|
-
var index = 0;
|
|
8
|
-
var subscription = originalObserver.subscribe({
|
|
9
|
-
next: function next(value) {
|
|
10
|
-
var _observer$next;
|
|
11
|
-
|
|
12
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, project(value, index++));
|
|
13
|
-
},
|
|
14
|
-
error: function error(_error) {
|
|
15
|
-
var _observer$error;
|
|
16
|
-
|
|
17
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, _error);
|
|
18
|
-
},
|
|
19
|
-
complete: function complete() {
|
|
20
|
-
var _observer$complete;
|
|
21
|
-
|
|
22
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return subscription;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { map };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/observable/internals/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Observable } from '../types';
|
|
2
|
-
export declare class ObservableAbortError extends Error {
|
|
3
|
-
constructor(message: string);
|
|
4
|
-
}
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>): {
|
|
7
|
-
promise: Promise<TValue>;
|
|
8
|
-
abort: () => void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=observableToPromise.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observableToPromise.d.ts","sourceRoot":"","sources":["../../../src/observable/internals/observableToPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAK5B;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;;iBAEtB,IAAI;EAkCtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../../src/observable/internals/pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAChC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAC9B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAerB"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Observable, Observer, TeardownLogic } from './types';
|
|
2
|
-
export declare type inferObservableValue<TObservable extends Observable<any, any>> = TObservable extends Observable<infer TValue, any> ? TValue : never;
|
|
3
|
-
export declare function observable<TValue, TError = unknown>(subscribe: (observer: Observer<TValue, TError>) => TeardownLogic): Observable<TValue, TError>;
|
|
4
|
-
//# sourceMappingURL=observable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../src/observable/observable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhF,oBAAY,oBAAoB,CAAC,WAAW,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IACvE,WAAW,SAAS,UAAU,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAErE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EACjD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,aAAa,GAC/D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/observable/operators/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/observable/operators/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EACnD,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,GAC3D,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAoB7D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../../src/observable/operators/share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA4B,MAAM,UAAU,CAAC;AAG9E,UAAU,WAAW;CAAG;AACxB,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAElC,KAAK,CAAC,EAAE,WAAW,GAClB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CA2D1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tap.d.ts","sourceRoot":"","sources":["../../../src/observable/operators/tap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC1C,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB1C"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface Unsubscribable {
|
|
2
|
-
unsubscribe(): void;
|
|
3
|
-
}
|
|
4
|
-
export declare type UnsubscribeFn = () => void;
|
|
5
|
-
export interface Subscribable<TValue, TError> {
|
|
6
|
-
subscribe(observer: Partial<Observer<TValue, TError>>): Unsubscribable;
|
|
7
|
-
}
|
|
8
|
-
export interface Observable<TValue, TError> extends Subscribable<TValue, TError> {
|
|
9
|
-
pipe(): Observable<TValue, TError>;
|
|
10
|
-
pipe<V1, E1>(op1: OperatorFunction<TValue, TError, V1, E1>): Observable<V1, E1>;
|
|
11
|
-
pipe<V1, E1, V2, E2>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>): Observable<V2, E2>;
|
|
12
|
-
pipe<V1, E1, V2, E2, V3, E3>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>): Observable<V2, E2>;
|
|
13
|
-
pipe<V1, E1, V2, E2, V3, E3, V4, E4>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>): Observable<V2, E2>;
|
|
14
|
-
pipe<V1, E1, V2, E2, V3, E3, V4, E4, V5, E5>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>, op5: OperatorFunction<V4, E4, V5, E5>): Observable<V2, E2>;
|
|
15
|
-
}
|
|
16
|
-
export interface SubscriptionLike extends Unsubscribable {
|
|
17
|
-
unsubscribe(): void;
|
|
18
|
-
readonly closed: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface Observer<TValue, TError> {
|
|
21
|
-
next: (value: TValue) => void;
|
|
22
|
-
error: (err: TError) => void;
|
|
23
|
-
complete: () => void;
|
|
24
|
-
}
|
|
25
|
-
export declare type TeardownLogic = Unsubscribable | UnsubscribeFn | void;
|
|
26
|
-
export declare type UnaryFunction<T, R> = (source: T) => R;
|
|
27
|
-
export declare type OperatorFunction<TValueBefore, TErrorBefore, TValueAfter, TErrorAfter> = UnaryFunction<Subscribable<TValueBefore, TErrorBefore>, Subscribable<TValueAfter, TErrorAfter>>;
|
|
28
|
-
export declare type MonoTypeOperatorFunction<TValue, TError> = OperatorFunction<TValue, TError, TValue, TError>;
|
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/observable/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,WAAW,IAAI,IAAI,CAAC;CACrB;AACD,oBAAY,aAAa,GAAG,MAAM,IAAI,CAAC;AACvC,MAAM,WAAW,YAAY,CAAC,MAAM,EAAE,MAAM;IAC1C,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC;CACxE;AACD,MAAM,WAAW,UAAU,CAAC,MAAM,EAAE,MAAM,CACxC,SAAQ,YAAY,CAAC,MAAM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AAgB,CAC1B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,IACT,aAAa,CACf,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,EACxC,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,CACvC,CAAC;AAEF,oBAAY,wBAAwB,CAAC,MAAM,EAAE,MAAM,IAAI,gBAAgB,CACrE,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP,CAAC"}
|
package/dist/tap-0dcdee86.js
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function identity(x) {
|
|
4
|
-
return x;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/** @internal */
|
|
8
|
-
|
|
9
|
-
function pipeFromArray(fns) {
|
|
10
|
-
if (fns.length === 0) {
|
|
11
|
-
return identity;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (fns.length === 1) {
|
|
15
|
-
return fns[0];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return function piped(input) {
|
|
19
|
-
return fns.reduce(function (prev, fn) {
|
|
20
|
-
return fn(prev);
|
|
21
|
-
}, input);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function observable(_subscribe) {
|
|
26
|
-
var self = {
|
|
27
|
-
subscribe: function subscribe(observer) {
|
|
28
|
-
var teardownRef = null;
|
|
29
|
-
var isDone = false;
|
|
30
|
-
var unsubscribed = false;
|
|
31
|
-
var teardownImmediately = false;
|
|
32
|
-
|
|
33
|
-
function unsubscribe() {
|
|
34
|
-
if (teardownRef === null) {
|
|
35
|
-
teardownImmediately = true;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (unsubscribed) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
unsubscribed = true;
|
|
44
|
-
|
|
45
|
-
if (typeof teardownRef === 'function') {
|
|
46
|
-
teardownRef();
|
|
47
|
-
} else if (teardownRef) {
|
|
48
|
-
teardownRef.unsubscribe();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
teardownRef = _subscribe({
|
|
53
|
-
next: function next(value) {
|
|
54
|
-
var _observer$next;
|
|
55
|
-
|
|
56
|
-
if (isDone) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, value);
|
|
61
|
-
},
|
|
62
|
-
error: function error(err) {
|
|
63
|
-
var _observer$error;
|
|
64
|
-
|
|
65
|
-
if (isDone) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
isDone = true;
|
|
70
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, err);
|
|
71
|
-
unsubscribe();
|
|
72
|
-
},
|
|
73
|
-
complete: function complete() {
|
|
74
|
-
var _observer$complete;
|
|
75
|
-
|
|
76
|
-
if (isDone) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
isDone = true;
|
|
81
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
82
|
-
unsubscribe();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (teardownImmediately) {
|
|
87
|
-
unsubscribe();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
unsubscribe: unsubscribe
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
pipe: function pipe() {
|
|
95
|
-
for (var _len = arguments.length, operations = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
96
|
-
operations[_key] = arguments[_key];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return pipeFromArray(operations)(self);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
return self;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
106
|
-
|
|
107
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
108
|
-
|
|
109
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
110
|
-
|
|
111
|
-
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
112
|
-
function share( // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
113
|
-
_opts) {
|
|
114
|
-
return function (originalObserver) {
|
|
115
|
-
var refCount = 0;
|
|
116
|
-
var subscription = null;
|
|
117
|
-
var observers = [];
|
|
118
|
-
|
|
119
|
-
function startIfNeeded() {
|
|
120
|
-
if (subscription) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
subscription = originalObserver.subscribe({
|
|
125
|
-
next: function next(value) {
|
|
126
|
-
var _iterator = _createForOfIteratorHelper(observers),
|
|
127
|
-
_step;
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
131
|
-
var _observer$next;
|
|
132
|
-
|
|
133
|
-
var observer = _step.value;
|
|
134
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, value);
|
|
135
|
-
}
|
|
136
|
-
} catch (err) {
|
|
137
|
-
_iterator.e(err);
|
|
138
|
-
} finally {
|
|
139
|
-
_iterator.f();
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
error: function error(_error) {
|
|
143
|
-
var _iterator2 = _createForOfIteratorHelper(observers),
|
|
144
|
-
_step2;
|
|
145
|
-
|
|
146
|
-
try {
|
|
147
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
148
|
-
var _observer$error;
|
|
149
|
-
|
|
150
|
-
var observer = _step2.value;
|
|
151
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, _error);
|
|
152
|
-
}
|
|
153
|
-
} catch (err) {
|
|
154
|
-
_iterator2.e(err);
|
|
155
|
-
} finally {
|
|
156
|
-
_iterator2.f();
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
complete: function complete() {
|
|
160
|
-
var _iterator3 = _createForOfIteratorHelper(observers),
|
|
161
|
-
_step3;
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
165
|
-
var _observer$complete;
|
|
166
|
-
|
|
167
|
-
var observer = _step3.value;
|
|
168
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
169
|
-
}
|
|
170
|
-
} catch (err) {
|
|
171
|
-
_iterator3.e(err);
|
|
172
|
-
} finally {
|
|
173
|
-
_iterator3.f();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function resetIfNeeded() {
|
|
180
|
-
// "resetOnRefCountZero"
|
|
181
|
-
if (refCount === 0 && subscription) {
|
|
182
|
-
var _sub = subscription;
|
|
183
|
-
subscription = null;
|
|
184
|
-
|
|
185
|
-
_sub.unsubscribe();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return {
|
|
190
|
-
subscribe: function subscribe(observer) {
|
|
191
|
-
refCount++;
|
|
192
|
-
observers.push(observer);
|
|
193
|
-
startIfNeeded();
|
|
194
|
-
return {
|
|
195
|
-
unsubscribe: function unsubscribe() {
|
|
196
|
-
refCount--;
|
|
197
|
-
resetIfNeeded();
|
|
198
|
-
var index = observers.findIndex(function (v) {
|
|
199
|
-
return v === observer;
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
if (index > -1) {
|
|
203
|
-
observers.splice(index, 1);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function tap(observer) {
|
|
213
|
-
return function (originalObserver) {
|
|
214
|
-
return {
|
|
215
|
-
subscribe: function subscribe(observer2) {
|
|
216
|
-
return originalObserver.subscribe({
|
|
217
|
-
next: function next(v) {
|
|
218
|
-
var _observer$next, _observer2$next;
|
|
219
|
-
|
|
220
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, v);
|
|
221
|
-
(_observer2$next = observer2.next) === null || _observer2$next === void 0 ? void 0 : _observer2$next.call(observer2, v);
|
|
222
|
-
},
|
|
223
|
-
error: function error(v) {
|
|
224
|
-
var _observer$error, _observer2$error;
|
|
225
|
-
|
|
226
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, v);
|
|
227
|
-
(_observer2$error = observer2.error) === null || _observer2$error === void 0 ? void 0 : _observer2$error.call(observer2, v);
|
|
228
|
-
},
|
|
229
|
-
complete: function complete() {
|
|
230
|
-
var _observer$complete, _observer2$complete;
|
|
231
|
-
|
|
232
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
233
|
-
(_observer2$complete = observer2.complete) === null || _observer2$complete === void 0 ? void 0 : _observer2$complete.call(observer2);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
exports.observable = observable;
|
|
242
|
-
exports.share = share;
|
|
243
|
-
exports.tap = tap;
|