Skip to content

Commit 7b0a9c4

Browse files
authored
chore: replace deprecated methods in test and jsdocs (#341)
1 parent 80f2c61 commit 7b0a9c4

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/utils/body.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function readRawBody<E extends Encoding = "utf8">(
7171
* @return {*} The `Object`, `Array`, `String`, `Number`, `Boolean`, or `null` value corresponding to the request JSON body
7272
*
7373
* ```ts
74-
* const body = await useBody(req)
74+
* const body = await readBody(req)
7575
* ```
7676
*/
7777
export async function readBody<T = any>(event: H3Event): Promise<T> {

src/utils/cookie.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function parseCookies(event: H3Event): Record<string, string> {
2020
* @param name Name of the cookie to get
2121
* @returns {*} Value of the cookie (String or undefined)
2222
* ```ts
23-
* const authorization = useCookie(request, 'Authorization')
23+
* const authorization = getCookie(request, 'Authorization')
2424
* ```
2525
*/
2626
export function getCookie(event: H3Event, name: string): string | undefined {

test/body.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("", () => {
1919
request = supertest(toNodeListener(app));
2020
});
2121

22-
describe("useRawBody", () => {
22+
describe("readRawBody", () => {
2323
it("can handle raw string", async () => {
2424
app.use(
2525
"/",

test/cookie.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("", () => {
4646
});
4747
});
4848

49-
describe("useCookie", () => {
49+
describe("getCookie", () => {
5050
it("can parse cookie with name", async () => {
5151
app.use(
5252
"/",

test/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("", () => {
6060
});
6161
});
6262

63-
describe("useQuery", () => {
63+
describe("getQuery", () => {
6464
it("can parse query params", async () => {
6565
app.use(
6666
"/",
@@ -82,7 +82,7 @@ describe("", () => {
8282
});
8383
});
8484

85-
describe("useMethod", () => {
85+
describe("getMethod", () => {
8686
it("can get method", async () => {
8787
app.use(
8888
"/",

0 commit comments

Comments
 (0)