File tree Expand file tree Collapse file tree 6 files changed +267
-76
lines changed Expand file tree Collapse file tree 6 files changed +267
-76
lines changed Original file line number Diff line number Diff line change 38
38
"@types/ws" : " ^8.5.10" ,
39
39
"@typescript-eslint/eslint-plugin" : " ^6.19.0" ,
40
40
"@typescript-eslint/parser" : " ^6.19.0" ,
41
- "@vitest/coverage-v8 " : " ^1.2.1 " ,
41
+ "@vitest/coverage-istanbul " : " ^3.0.5 " ,
42
42
"abort-controller" : " ^3.0.0" ,
43
43
"eslint" : " ^8.56.0" ,
44
44
"eslint-config-prettier" : " ^9.1.0" ,
Original file line number Diff line number Diff line change @@ -72,16 +72,13 @@ function createHeaders(req: HttpRequest): Headers {
72
72
const headers = new Headers ( ) ;
73
73
74
74
req . forEach ( ( key , value ) => {
75
- if ( typeof key === 'string' && key . startsWith ( ':' ) ) {
75
+ /* istanbul ignore next -- @preserve */
76
+ if ( key . startsWith ( ':' ) ) {
76
77
// Skip HTTP/2 pseudo-headers
77
78
return ;
78
79
}
79
80
80
- if ( Array . isArray ( value ) ) {
81
- for ( const item of value ) {
82
- headers . append ( key , item ) ;
83
- }
84
- } else if ( value != null ) {
81
+ if ( value . length != 0 ) {
85
82
headers . append ( key , value ) ;
86
83
}
87
84
} ) ;
Original file line number Diff line number Diff line change @@ -40,10 +40,6 @@ import {
40
40
import { applyWebsocketHandler , CreateWSSContextFnOptions } from './websockets' ;
41
41
import { TRPCRequestInfo } from '@trpc/server/http' ;
42
42
43
- export function sleep ( ms = 0 ) : Promise < void > {
44
- return new Promise < void > ( ( res ) => setTimeout ( res , ms ) ) ;
45
- }
46
-
47
43
const config = {
48
44
prefix : '/trpc' ,
49
45
} ;
Original file line number Diff line number Diff line change @@ -56,9 +56,6 @@ import {
56
56
} from '@trpc/server/observable' ;
57
57
import { URL } from 'url' ;
58
58
59
- // TODO: ask TRPC to expose these
60
- // import { iteratorResource } from '@trpc/server/src/unstable-core-do-not-import/stream/utils/asyncIterable';
61
- // import { Unpromise } from '@trpc/server/src/vendor/unpromise';
62
59
// copying over packages/server/src/adapters/ws.ts
63
60
64
61
export type WebSocketConnection = WebSocket < WebsocketData > ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default defineConfig({
12
12
coverage : {
13
13
provider : 'istanbul' ,
14
14
include : [ '**/src/**' ] ,
15
- exclude : [ ] ,
15
+ exclude : [ '**/src/**.spec.ts' ] ,
16
16
} ,
17
17
poolOptions : {
18
18
threads : {
You can’t perform that action at this time.
0 commit comments