Skip to content
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 examples/express/valibot/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const newApp = () => {
// ```
// // validatorMiddleware allows to use res.locals.validate method
// app.use(validatorMiddleware(pathMap));
// // wApp is same as app, but with additional common information
// // wApp is same as app, but with additional core information
// const wApp = app as TRouter<typeof pathMap>;
// ```
const wApp = asAsync(typed(pathMap, app));
Expand Down
4 changes: 2 additions & 2 deletions examples/express/valibot/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const main = async () => {
}
{
// query parameter example
// TODO: Add common information for query parameter
// TODO: Add core information for query parameter
const path = `${origin}/users?page=1`;
const method = "get";
const res = await fetchT(path, { method });
Expand All @@ -58,7 +58,7 @@ const main = async () => {
method,
headers,
// body is the request schema defined in pathMap["/users"]["post"].body
// stringify is same as JSON.stringify but with common information
// stringify is same as JSON.stringify but with core information
body: JSONT.stringify({ userName: "user1" }),
});
if (res.ok) {
Expand Down
2 changes: 1 addition & 1 deletion examples/express/zod/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const newApp = () => {
// ```
// // validatorMiddleware allows to use res.locals.validate method
// app.use(validatorMiddleware(pathMap));
// // wApp is same as app, but with additional common information
// // wApp is same as app, but with additional core information
// const wApp = app as TRouter<typeof pathMap>;
// ```
const wApp = asAsync(typed(pathMap, app));
Expand Down
4 changes: 2 additions & 2 deletions examples/express/zod/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const main = async () => {
}
{
// query parameter example
// TODO: Add common information for query parameter
// TODO: Add core information for query parameter
const path = `${origin}/users?page=1`;
const method = "get";
const res = await fetchT(path, { method });
Expand All @@ -58,7 +58,7 @@ const main = async () => {
method,
headers,
// body is the request schema defined in pathMap["/users"]["post"].body
// stringify is same as JSON.stringify but with common information
// stringify is same as JSON.stringify but with core information
body: JSONT.stringify({ userName: "user1" }),
});
if (res.ok) {
Expand Down
2 changes: 1 addition & 1 deletion examples/fastify/zod/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const main = async () => {
method,
headers,
// body is the request schema defined in pathMap["/users"]["post"].body
// stringify is same as JSON.stringify but with common information
// stringify is same as JSON.stringify but with core information
body: JSONT.stringify({ userName: "user1" }),
});
if (res.ok) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./common": {
"require": "./dist/common/index.js",
"import": "./dist/common/index.mjs",
"types": "./dist/common/index.d.ts"
"./core": {
"require": "./dist/core/index.js",
"import": "./dist/core/index.mjs",
"types": "./dist/core/index.d.ts"
},
"./express": {
"require": "./dist/express/index.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/express/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
Request,
Response,
} from "express-serve-static-core";
import { StatusCode } from "../common";
import { StatusCode } from "../core";
import { ParsedQs } from "qs";
import {
AnyValidators,
ValidatorsInput,
ValidatorsMap,
} from "../common/validate";
} from "../core/validate";

/**
* Express Request Handler, but with more strict type information.
Expand Down
2 changes: 1 addition & 1 deletion src/express/valibot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import express from "express";
import { asAsync, ValidateLocals, validatorMiddleware } from "./index";
import * as v from "valibot";
import { Request } from "express";
import { ParseUrlParams } from "../common";
import { ParseUrlParams } from "../core";
import { ToHandlers, typed } from "./valibot";
import {
newValibotValidator,
Expand Down
2 changes: 1 addition & 1 deletion src/express/valibot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ValibotApiSpec,
ValibotValidators,
} from "../valibot";
import { Method } from "../common";
import { Method } from "../core";
import {
RouterT,
ToHandler as ToPureHandler,
Expand Down
2 changes: 1 addition & 1 deletion src/express/zod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "../zod";
import { z, ZodError } from "zod";
import { Request } from "express";
import { ParseUrlParams } from "../common";
import { ParseUrlParams } from "../core";
import { ToHandlers, typed } from "./zod";

type ZodValidateLocals<
Expand Down
2 changes: 1 addition & 1 deletion src/express/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ZodApiSpec,
ZodValidators,
} from "../zod";
import { Method } from "../common";
import { Method } from "../core";
import {
RouterT,
ToHandler as ToPureHandler,
Expand Down
2 changes: 1 addition & 1 deletion src/fastify/zod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ZodApiEndpoint, ZodApiEndpoints, ZodApiSpec } from "../zod";
import { AnyApiResponses, Method, StatusCode } from "../common";
import { AnyApiResponses, Method, StatusCode } from "../core";

const toFastifyResponse = <Responses extends AnyApiResponses>(
responses: Responses,
Expand Down
2 changes: 1 addition & 1 deletion src/fetch/index.t-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AsJsonApi, DefineApiEndpoints } from "../common";
import { AsJsonApi, DefineApiEndpoints } from "../core";
import FetchT from "./index";
import JSONT from "../json";
const JSONT = JSON as JSONT;
Expand Down
4 changes: 2 additions & 2 deletions src/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
StatusCode,
IsAllOptional,
CaseInsensitive,
} from "../common";
import { UrlPrefixPattern, ToUrlParamPattern } from "../common";
} from "../core";
import { UrlPrefixPattern, ToUrlParamPattern } from "../core";
import { TypedString } from "../json";

export type RequestInitT<
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./common";
export * from "./core";
export {
asAsync as expressAsAsync,
wrap as expressWrap,
Expand Down
4 changes: 2 additions & 2 deletions src/valibot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
isMethod,
Method,
StatusCode,
} from "../common";
} from "../core";
import {
getApiSpec,
Validator,
Validators,
ValidatorsInput,
} from "../common/validate";
} from "../core/validate";
import { Result } from "../utils";
import {
BaseIssue,
Expand Down
4 changes: 2 additions & 2 deletions src/zod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
isMethod,
Method,
StatusCode,
} from "../common";
} from "../core";
import {
getApiSpec,
Validator,
Validators,
ValidatorsInput,
} from "../common/validate";
} from "../core/validate";
import { Result } from "../utils";

export const anyZ = <T>() => z.any() as ZodType<T>;
Expand Down