Skip to content

Commit

Permalink
move back to internal + types export
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 25, 2023
1 parent 373cbfe commit dce1f18
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { H3Event } from "./event";
import { Session } from "./utils/session";

export type {
ValidateFunction,
ValidateResult,
} from "./utils/internal/validate";

// https://www.rfc-editor.org/rfc/rfc7231#section-4.1
export type HTTPMethod =
| "GET"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { H3Event } from "../event";
import { createError } from "../error";
import { parse as parseMultipartData } from "./internal/multipart";
import { assertMethod, getRequestHeader } from "./request";
import { ValidateFunction, validateData } from "./validate";
import { ValidateFunction, validateData } from "./internal/validate";

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

Expand Down
2 changes: 0 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ export * from "./response";
export * from "./session";
export * from "./cors";
export * from "./sanitize";

export { ValidateFunction, ValidateResult } from "./validate";
2 changes: 1 addition & 1 deletion src/utils/validate.ts → src/utils/internal/validate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createError } from "../error";
import { createError } from "../../error";

// TODO: Consider using similar method of typeschema for external library compatibility
// https://github.com/decs/typeschema/blob/v0.1.3/src/assert.ts
Expand Down
2 changes: 1 addition & 1 deletion src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getQuery as _getQuery } from "ufo";
import { createError } from "../error";
import type { HTTPMethod, RequestHeaders } from "../types";
import type { H3Event } from "../event";
import { validateData, ValidateFunction } from "./validate";
import { validateData, ValidateFunction } from "./internal/validate";

export function getQuery(event: H3Event) {
return _getQuery(event.path || "");
Expand Down

0 comments on commit dce1f18

Please sign in to comment.