Skip to content

Commit

Permalink
refactor!: drop deprecated util aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 15, 2022
1 parent 5234270 commit dc8ee81
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
6 changes: 0 additions & 6 deletions src/utils/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export function readRawBody (event: H3Event, encoding: Encoding = "utf8"): Encod
return encoding ? promise.then(buff => buff.toString(encoding)) : promise;
}

/** @deprecated Use `h3.readRawBody` */
export const useRawBody = readRawBody;

/**
* Reads request body and try to safely parse using [destr](https://github.com/unjs/destr)
* @param event {H3Event} H3 event or req passed by h3 handler
Expand Down Expand Up @@ -75,6 +72,3 @@ export async function readBody<T=any> (event: H3Event): Promise<T> {
(event.req as any)[ParsedBodySymbol] = json;
return json;
}

/** @deprecated Use `h3.readBody` */
export const useBody = readBody;
6 changes: 0 additions & 6 deletions src/utils/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export function parseCookies (event: H3Event): Record<string, string> {
return parse(event.req.headers.cookie || "");
}

/** @deprecated Use `h3.parseCookies` */
export const useCookies = parseCookies;

/**
* Get a cookie value by name.
* @param event {H3Event} H3 event or req passed by h3 handler
Expand All @@ -31,9 +28,6 @@ export function getCookie (event: H3Event, name: string): string | undefined {
return parseCookies(event)[name];
}

/** @deprecated Use `h3.getCookie` */
export const useCookie = getCookie;

/**
* Set a cookie value by name.
* @param event {H3Event} H3 event or res passed by h3 handler
Expand Down
6 changes: 0 additions & 6 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export function getQuery (event: H3Event) {
return _getQuery(event.req.url || "");
}

/** @deprecated Use `h3.getQuery` */
export const useQuery = getQuery;

export function getRouterParams (event: H3Event): H3Event["context"] {
// Fallback object needs to be returned in case router is not used (#149)
return event.context.params || {};
Expand All @@ -25,9 +22,6 @@ export function getMethod (event: H3Event, defaultMethod: HTTPMethod = "GET"): H
return (event.req.method || defaultMethod).toUpperCase() as HTTPMethod;
}

/** @deprecated Use `h3.getMethod` */
export const useMethod = getMethod;

export function isMethod (event: H3Event, expected: HTTPMethod | HTTPMethod[], allowHead?: boolean) {
const method = getMethod(event);

Expand Down

0 comments on commit dc8ee81

Please sign in to comment.