File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/kit ' : patch
3+ ---
4+
5+ Allow ` EndpointOutput ` response body objects to have a ` toJSON ` property
Original file line number Diff line number Diff line change 11import { ServerRequest } from './hooks' ;
22import { Headers , MaybePromise } from './helper' ;
33
4- type JSONValue = string | number | boolean | null | JSONValue [ ] | { [ key : string ] : JSONValue } ;
4+ type ToJSON = { toJSON ( ...args : any [ ] ) : JSONValue } ;
5+ type JSONValue = Exclude < JSONResponse , ToJSON > ;
6+ type JSONResponse =
7+ | string
8+ | number
9+ | boolean
10+ | null
11+ | JSONResponse [ ]
12+ | ToJSON
13+ | { [ key : string ] : JSONResponse } ;
514
6- type DefaultBody = JSONValue | Uint8Array ;
15+ type DefaultBody = JSONResponse | Uint8Array ;
716
817export interface EndpointOutput < Body extends DefaultBody = DefaultBody > {
918 status ?: number ;
You can’t perform that action at this time.
0 commit comments