Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace obsolete methods in comments / test descriptions #341

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function readRawBody<E extends Encoding = "utf8">(
* @return {*} The `Object`, `Array`, `String`, `Number`, `Boolean`, or `null` value corresponding to the request JSON body
*
* ```ts
* const body = await useBody(req)
* const body = await readBody(req)
* ```
*/
export async function readBody<T = any>(event: H3Event): Promise<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function parseCookies(event: H3Event): Record<string, string> {
* @param name Name of the cookie to get
* @returns {*} Value of the cookie (String or undefined)
* ```ts
* const authorization = useCookie(request, 'Authorization')
* const authorization = getCookie(request, 'Authorization')
* ```
*/
export function getCookie(event: H3Event, name: string): string | undefined {
Expand Down
2 changes: 1 addition & 1 deletion test/body.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("", () => {
request = supertest(toNodeListener(app));
});

describe("useRawBody", () => {
describe("readRawBody", () => {
it("can handle raw string", async () => {
app.use(
"/",
Expand Down
2 changes: 1 addition & 1 deletion test/cookie.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("", () => {
});
});

describe("useCookie", () => {
describe("getCookie", () => {
it("can parse cookie with name", async () => {
app.use(
"/",
Expand Down
4 changes: 2 additions & 2 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("", () => {
});
});

describe("useQuery", () => {
describe("getQuery", () => {
it("can parse query params", async () => {
app.use(
"/",
Expand All @@ -82,7 +82,7 @@ describe("", () => {
});
});

describe("useMethod", () => {
describe("getMethod", () => {
it("can get method", async () => {
app.use(
"/",
Expand Down