Skip to content

Commit

Permalink
attempt at 'slow types': SubsetOfZ
Browse files Browse the repository at this point in the history
  • Loading branch information
Thesephi committed Jul 11, 2024
1 parent f6029cd commit 3d7b2dd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.8.2] - 2024-XX-XX

### Changed

- `z` "slow types" workaround attempt: `SubsetOfZ`

## [0.8.1] - 2024-07-11

### Added
Expand Down
39 changes: 37 additions & 2 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,44 @@ export { type OpenAPIObjectConfig } from "npm:@asteasolutions/zod-to-openapi@^7.
// must import from `npm:` instead of from `deno.land` to be compatible with `@asteasolutions/zod-to-openapi`
import { z as slowTypedZ } from "npm:zod@^3.23.8";
extendZodWithOpenApi(slowTypedZ);
type ExplicitZ = Omit<typeof slowTypedZ, "">;
type SubsetOfZ = Pick<
typeof slowTypedZ,
| "string"
| "object"
| "array"
| "number"
| "boolean"
| "date"
| "any"
| "enum"
| "function"
| "lazy"
| "void"
| "promise"
| "null"
| "never"
| "map"
| "bigint"
| "symbol"
| "strictObject"
| "transformer"
| "literal"
| "coerce"
| "custom"
| "util"
| "tuple"
| "record"
| "preprocess"
| "nan"
| "datetimeRegex"
| "discriminatedUnion"
| "intersection"
| "pipeline"
| "ZodSchema"
| "Schema"
>;
/**
* entry to the `Zod` API, enhanced with `@asteasolutions/zod-to-openapi`;
* for usage documentation please refer to https://github.com/asteasolutions/zod-to-openapi?tab=readme-ov-file#purpose-and-quick-example
*/
export const z: ExplicitZ = slowTypedZ;
export const z: SubsetOfZ = slowTypedZ;
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dklab/oak-routing-ctrl",
"version": "0.8.1",
"version": "0.8.2-alpha.1",
"exports": {
".": "./mod.ts",
"./mod": "./mod.ts"
Expand Down

0 comments on commit 3d7b2dd

Please sign in to comment.