@trpc/server 11.0.0-alpha-tmp-03-03-pipe-pipe.308 → 11.0.0-alpha-tmp-03-03-pipe-pipe.310
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 37.
|
|
2
|
+
"bundleSize": 92666,
|
|
3
|
+
"bundleOrigSize": 147947,
|
|
4
|
+
"bundleReduction": 37.37,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/adapters/ws.ts",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"dependents": [
|
|
121
121
|
"/src/adapters/fetch/index.ts"
|
|
122
122
|
],
|
|
123
|
-
"percent": 3.
|
|
123
|
+
"percent": 3.84,
|
|
124
124
|
"reduction": 9.5
|
|
125
125
|
},
|
|
126
126
|
{
|
|
@@ -161,8 +161,8 @@
|
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"id": "/src/observable/operators.ts",
|
|
164
|
-
"size":
|
|
165
|
-
"origSize":
|
|
164
|
+
"size": 2756,
|
|
165
|
+
"origSize": 2720,
|
|
166
166
|
"renderedExports": [
|
|
167
167
|
"map",
|
|
168
168
|
"share",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"dependents": [
|
|
173
173
|
"/src/observable/index.ts"
|
|
174
174
|
],
|
|
175
|
-
"percent":
|
|
175
|
+
"percent": 2.97,
|
|
176
176
|
"reduction": 0
|
|
177
177
|
},
|
|
178
178
|
{
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
],
|
|
327
327
|
"removedExports": [],
|
|
328
328
|
"dependents": [],
|
|
329
|
-
"percent": 1.
|
|
329
|
+
"percent": 1.71,
|
|
330
330
|
"reduction": 21.04
|
|
331
331
|
},
|
|
332
332
|
{
|
|
@@ -690,9 +690,9 @@
|
|
|
690
690
|
"reduction": 100
|
|
691
691
|
},
|
|
692
692
|
{
|
|
693
|
-
"id": "/src/adapters/
|
|
693
|
+
"id": "/src/adapters/fetch/index.ts",
|
|
694
694
|
"size": 0,
|
|
695
|
-
"origSize":
|
|
695
|
+
"origSize": 64,
|
|
696
696
|
"renderedExports": [],
|
|
697
697
|
"removedExports": [],
|
|
698
698
|
"dependents": [],
|
|
@@ -700,9 +700,9 @@
|
|
|
700
700
|
"reduction": 100
|
|
701
701
|
},
|
|
702
702
|
{
|
|
703
|
-
"id": "/src/adapters/
|
|
703
|
+
"id": "/src/adapters/fastify/index.ts",
|
|
704
704
|
"size": 0,
|
|
705
|
-
"origSize":
|
|
705
|
+
"origSize": 78,
|
|
706
706
|
"renderedExports": [],
|
|
707
707
|
"removedExports": [],
|
|
708
708
|
"dependents": [],
|
|
@@ -716,8 +716,8 @@
|
|
|
716
716
|
"renderedExports": [],
|
|
717
717
|
"removedExports": [],
|
|
718
718
|
"dependents": [
|
|
719
|
-
"/src/adapters/next.ts",
|
|
720
719
|
"/src/adapters/express.ts",
|
|
720
|
+
"/src/adapters/next.ts",
|
|
721
721
|
"/src/adapters/standalone.ts"
|
|
722
722
|
],
|
|
723
723
|
"percent": 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../src/observable/operators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAEjB,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,CAkB7D;AAED,UAAU,WAAW;CAAG;AACxB,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,WAAW,GAClB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAyD1C;AAED,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,
|
|
1
|
+
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../src/observable/operators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAEjB,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,CAkB7D;AAED,UAAU,WAAW;CAAG;AACxB,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,WAAW,GAClB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAyD1C;AAED,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,CAmB1C"}
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
var observable = require('./observable.js');
|
|
4
4
|
|
|
5
5
|
function map(project) {
|
|
6
|
-
return (
|
|
7
|
-
return observable.observable((
|
|
6
|
+
return (source)=>{
|
|
7
|
+
return observable.observable((destination)=>{
|
|
8
8
|
let index = 0;
|
|
9
|
-
const subscription =
|
|
9
|
+
const subscription = source.subscribe({
|
|
10
10
|
next (value) {
|
|
11
|
-
|
|
11
|
+
destination.next(project(value, index++));
|
|
12
12
|
},
|
|
13
13
|
error (error) {
|
|
14
|
-
|
|
14
|
+
destination.error(error);
|
|
15
15
|
},
|
|
16
16
|
complete () {
|
|
17
|
-
|
|
17
|
+
destination.complete();
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
return subscription;
|
|
@@ -22,7 +22,7 @@ function map(project) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
function share(_opts) {
|
|
25
|
-
return (
|
|
25
|
+
return (source)=>{
|
|
26
26
|
let refCount = 0;
|
|
27
27
|
let subscription = null;
|
|
28
28
|
const observers = [];
|
|
@@ -30,7 +30,7 @@ function share(_opts) {
|
|
|
30
30
|
if (subscription) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
subscription =
|
|
33
|
+
subscription = source.subscribe({
|
|
34
34
|
next (value) {
|
|
35
35
|
for (const observer of observers){
|
|
36
36
|
observer.next?.(value);
|
|
@@ -56,15 +56,15 @@ function share(_opts) {
|
|
|
56
56
|
_sub.unsubscribe();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return observable.observable((
|
|
59
|
+
return observable.observable((subscriber)=>{
|
|
60
60
|
refCount++;
|
|
61
|
-
observers.push(
|
|
61
|
+
observers.push(subscriber);
|
|
62
62
|
startIfNeeded();
|
|
63
63
|
return {
|
|
64
64
|
unsubscribe () {
|
|
65
65
|
refCount--;
|
|
66
66
|
resetIfNeeded();
|
|
67
|
-
const index = observers.findIndex((v)=>v ===
|
|
67
|
+
const index = observers.findIndex((v)=>v === subscriber);
|
|
68
68
|
if (index > -1) {
|
|
69
69
|
observers.splice(index, 1);
|
|
70
70
|
}
|
|
@@ -74,23 +74,22 @@ function share(_opts) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function tap(observer) {
|
|
77
|
-
return (
|
|
78
|
-
return observable.observable((
|
|
79
|
-
|
|
77
|
+
return (source)=>{
|
|
78
|
+
return observable.observable((destination)=>{
|
|
79
|
+
return source.subscribe({
|
|
80
80
|
next (value) {
|
|
81
81
|
observer.next?.(value);
|
|
82
|
-
|
|
82
|
+
destination.next(value);
|
|
83
83
|
},
|
|
84
84
|
error (error) {
|
|
85
85
|
observer.error?.(error);
|
|
86
|
-
|
|
86
|
+
destination.error(error);
|
|
87
87
|
},
|
|
88
88
|
complete () {
|
|
89
89
|
observer.complete?.();
|
|
90
|
-
|
|
90
|
+
destination.complete();
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
return subscription;
|
|
94
93
|
});
|
|
95
94
|
};
|
|
96
95
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { observable } from './observable.mjs';
|
|
2
2
|
|
|
3
3
|
function map(project) {
|
|
4
|
-
return (
|
|
5
|
-
return observable((
|
|
4
|
+
return (source)=>{
|
|
5
|
+
return observable((destination)=>{
|
|
6
6
|
let index = 0;
|
|
7
|
-
const subscription =
|
|
7
|
+
const subscription = source.subscribe({
|
|
8
8
|
next (value) {
|
|
9
|
-
|
|
9
|
+
destination.next(project(value, index++));
|
|
10
10
|
},
|
|
11
11
|
error (error) {
|
|
12
|
-
|
|
12
|
+
destination.error(error);
|
|
13
13
|
},
|
|
14
14
|
complete () {
|
|
15
|
-
|
|
15
|
+
destination.complete();
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
return subscription;
|
|
@@ -20,7 +20,7 @@ function map(project) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function share(_opts) {
|
|
23
|
-
return (
|
|
23
|
+
return (source)=>{
|
|
24
24
|
let refCount = 0;
|
|
25
25
|
let subscription = null;
|
|
26
26
|
const observers = [];
|
|
@@ -28,7 +28,7 @@ function share(_opts) {
|
|
|
28
28
|
if (subscription) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
subscription =
|
|
31
|
+
subscription = source.subscribe({
|
|
32
32
|
next (value) {
|
|
33
33
|
for (const observer of observers){
|
|
34
34
|
observer.next?.(value);
|
|
@@ -54,15 +54,15 @@ function share(_opts) {
|
|
|
54
54
|
_sub.unsubscribe();
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
return observable((
|
|
57
|
+
return observable((subscriber)=>{
|
|
58
58
|
refCount++;
|
|
59
|
-
observers.push(
|
|
59
|
+
observers.push(subscriber);
|
|
60
60
|
startIfNeeded();
|
|
61
61
|
return {
|
|
62
62
|
unsubscribe () {
|
|
63
63
|
refCount--;
|
|
64
64
|
resetIfNeeded();
|
|
65
|
-
const index = observers.findIndex((v)=>v ===
|
|
65
|
+
const index = observers.findIndex((v)=>v === subscriber);
|
|
66
66
|
if (index > -1) {
|
|
67
67
|
observers.splice(index, 1);
|
|
68
68
|
}
|
|
@@ -72,23 +72,22 @@ function share(_opts) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
function tap(observer) {
|
|
75
|
-
return (
|
|
76
|
-
return observable((
|
|
77
|
-
|
|
75
|
+
return (source)=>{
|
|
76
|
+
return observable((destination)=>{
|
|
77
|
+
return source.subscribe({
|
|
78
78
|
next (value) {
|
|
79
79
|
observer.next?.(value);
|
|
80
|
-
|
|
80
|
+
destination.next(value);
|
|
81
81
|
},
|
|
82
82
|
error (error) {
|
|
83
83
|
observer.error?.(error);
|
|
84
|
-
|
|
84
|
+
destination.error(error);
|
|
85
85
|
},
|
|
86
86
|
complete () {
|
|
87
87
|
observer.complete?.();
|
|
88
|
-
|
|
88
|
+
destination.complete();
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
return subscription;
|
|
92
91
|
});
|
|
93
92
|
};
|
|
94
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-03-03-pipe-pipe.
|
|
3
|
+
"version": "11.0.0-alpha-tmp-03-03-pipe-pipe.310+5895b1d60",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"funding": [
|
|
158
158
|
"https://trpc.io/sponsor"
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "5895b1d60190baf573249029f6fc5bba03a6d997"
|
|
161
161
|
}
|
|
@@ -9,18 +9,18 @@ import type {
|
|
|
9
9
|
export function map<TValueBefore, TError, TValueAfter>(
|
|
10
10
|
project: (value: TValueBefore, index: number) => TValueAfter,
|
|
11
11
|
): OperatorFunction<TValueBefore, TError, TValueAfter, TError> {
|
|
12
|
-
return (
|
|
13
|
-
return observable((
|
|
12
|
+
return (source) => {
|
|
13
|
+
return observable((destination) => {
|
|
14
14
|
let index = 0;
|
|
15
|
-
const subscription =
|
|
15
|
+
const subscription = source.subscribe({
|
|
16
16
|
next(value) {
|
|
17
|
-
|
|
17
|
+
destination.next(project(value, index++));
|
|
18
18
|
},
|
|
19
19
|
error(error) {
|
|
20
|
-
|
|
20
|
+
destination.error(error);
|
|
21
21
|
},
|
|
22
22
|
complete() {
|
|
23
|
-
|
|
23
|
+
destination.complete();
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
return subscription;
|
|
@@ -32,7 +32,7 @@ interface ShareConfig {}
|
|
|
32
32
|
export function share<TValue, TError>(
|
|
33
33
|
_opts?: ShareConfig,
|
|
34
34
|
): MonoTypeOperatorFunction<TValue, TError> {
|
|
35
|
-
return (
|
|
35
|
+
return (source) => {
|
|
36
36
|
let refCount = 0;
|
|
37
37
|
|
|
38
38
|
let subscription: Unsubscribable | null = null;
|
|
@@ -42,7 +42,7 @@ export function share<TValue, TError>(
|
|
|
42
42
|
if (subscription) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
subscription =
|
|
45
|
+
subscription = source.subscribe({
|
|
46
46
|
next(value) {
|
|
47
47
|
for (const observer of observers) {
|
|
48
48
|
observer.next?.(value);
|
|
@@ -69,17 +69,17 @@ export function share<TValue, TError>(
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
return observable((
|
|
72
|
+
return observable((subscriber) => {
|
|
73
73
|
refCount++;
|
|
74
74
|
|
|
75
|
-
observers.push(
|
|
75
|
+
observers.push(subscriber);
|
|
76
76
|
startIfNeeded();
|
|
77
77
|
return {
|
|
78
78
|
unsubscribe() {
|
|
79
79
|
refCount--;
|
|
80
80
|
resetIfNeeded();
|
|
81
81
|
|
|
82
|
-
const index = observers.findIndex((v) => v ===
|
|
82
|
+
const index = observers.findIndex((v) => v === subscriber);
|
|
83
83
|
|
|
84
84
|
if (index > -1) {
|
|
85
85
|
observers.splice(index, 1);
|
|
@@ -93,23 +93,22 @@ export function share<TValue, TError>(
|
|
|
93
93
|
export function tap<TValue, TError>(
|
|
94
94
|
observer: Partial<Observer<TValue, TError>>,
|
|
95
95
|
): MonoTypeOperatorFunction<TValue, TError> {
|
|
96
|
-
return (
|
|
97
|
-
return observable((
|
|
98
|
-
|
|
96
|
+
return (source) => {
|
|
97
|
+
return observable((destination) => {
|
|
98
|
+
return source.subscribe({
|
|
99
99
|
next(value) {
|
|
100
100
|
observer.next?.(value);
|
|
101
|
-
|
|
101
|
+
destination.next(value);
|
|
102
102
|
},
|
|
103
103
|
error(error) {
|
|
104
104
|
observer.error?.(error);
|
|
105
|
-
|
|
105
|
+
destination.error(error);
|
|
106
106
|
},
|
|
107
107
|
complete() {
|
|
108
108
|
observer.complete?.();
|
|
109
|
-
|
|
109
|
+
destination.complete();
|
|
110
110
|
},
|
|
111
111
|
});
|
|
112
|
-
return subscription;
|
|
113
112
|
});
|
|
114
113
|
};
|
|
115
114
|
}
|