Skip to content

Commit 58c0256

Browse files
committed
reduce diff
1 parent bb8d8d9 commit 58c0256

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/utils/body.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import {
99
} from "./internal/multipart";
1010
import { assertMethod, getRequestHeader, toWebRequest } from "./request";
1111
import { ValidateFunction, validateData } from "./internal/validate";
12-
import { ParsedBodySymbol, RawBodySymbol } from "./symbols";
1312
import { hasProp } from "./internal/object";
1413

1514
export type { MultiPartData } from "./internal/multipart";
1615

16+
const RawBodySymbol = Symbol.for("h3RawBody");
17+
const ParsedBodySymbol = Symbol.for("h3ParsedBody");
1718
type InternalRequest<T = any> = IncomingMessage & {
1819
[RawBodySymbol]?: Promise<Buffer | undefined>;
1920
[ParsedBodySymbol]?: T;

src/utils/request.ts

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
} from "../types";
99
import type { H3Event } from "../event";
1010
import { validateData, ValidateFunction } from "./internal/validate";
11-
import { ParsedQuerySymbol } from "./symbols";
1211
import { getRequestWebStream } from "./body";
1312

1413
/**
@@ -24,9 +23,6 @@ export function getQuery<
2423
Event extends H3Event = H3Event,
2524
_T = Exclude<InferEventInput<"query", Event, T>, undefined>,
2625
>(event: Event): _T {
27-
if (ParsedQuerySymbol in event) {
28-
return event[ParsedQuerySymbol] as _T;
29-
}
3026
return _getQuery(event.path || "") as _T;
3127
}
3228

src/utils/symbols.ts

-3
This file was deleted.

0 commit comments

Comments
 (0)