Skip to content

Commit dc8ee81

Browse files
committedNov 15, 2022
refactor!: drop deprecated util aliases
1 parent 5234270 commit dc8ee81

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed
 

‎src/utils/body.ts

-6
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ export function readRawBody (event: H3Event, encoding: Encoding = "utf8"): Encod
4444
return encoding ? promise.then(buff => buff.toString(encoding)) : promise;
4545
}
4646

47-
/** @deprecated Use `h3.readRawBody` */
48-
export const useRawBody = readRawBody;
49-
5047
/**
5148
* Reads request body and try to safely parse using [destr](https://github.com/unjs/destr)
5249
* @param event {H3Event} H3 event or req passed by h3 handler
@@ -75,6 +72,3 @@ export async function readBody<T=any> (event: H3Event): Promise<T> {
7572
(event.req as any)[ParsedBodySymbol] = json;
7673
return json;
7774
}
78-
79-
/** @deprecated Use `h3.readBody` */
80-
export const useBody = readBody;

‎src/utils/cookie.ts

-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export function parseCookies (event: H3Event): Record<string, string> {
1515
return parse(event.req.headers.cookie || "");
1616
}
1717

18-
/** @deprecated Use `h3.parseCookies` */
19-
export const useCookies = parseCookies;
20-
2118
/**
2219
* Get a cookie value by name.
2320
* @param event {H3Event} H3 event or req passed by h3 handler
@@ -31,9 +28,6 @@ export function getCookie (event: H3Event, name: string): string | undefined {
3128
return parseCookies(event)[name];
3229
}
3330

34-
/** @deprecated Use `h3.getCookie` */
35-
export const useCookie = getCookie;
36-
3731
/**
3832
* Set a cookie value by name.
3933
* @param event {H3Event} H3 event or res passed by h3 handler

‎src/utils/request.ts

-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ export function getQuery (event: H3Event) {
77
return _getQuery(event.req.url || "");
88
}
99

10-
/** @deprecated Use `h3.getQuery` */
11-
export const useQuery = getQuery;
12-
1310
export function getRouterParams (event: H3Event): H3Event["context"] {
1411
// Fallback object needs to be returned in case router is not used (#149)
1512
return event.context.params || {};
@@ -25,9 +22,6 @@ export function getMethod (event: H3Event, defaultMethod: HTTPMethod = "GET"): H
2522
return (event.req.method || defaultMethod).toUpperCase() as HTTPMethod;
2623
}
2724

28-
/** @deprecated Use `h3.getMethod` */
29-
export const useMethod = getMethod;
30-
3125
export function isMethod (event: H3Event, expected: HTTPMethod | HTTPMethod[], allowHead?: boolean) {
3226
const method = getMethod(event);
3327

0 commit comments

Comments
 (0)
Please sign in to comment.