Skip to content

Commit

Permalink
0.5.4: added jzodToZod and zodToJzod to index.ts, and corrected image…
Browse files Browse the repository at this point in the history
… links in README.md
  • Loading branch information
miroir-framework committed Nov 22, 2023
1 parent 575d2aa commit 311b0e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Which requires to type undeniably more characters, but provides a plain JSON str

## Usage

![usage](doc/usage.drawio.png)
![usage](https://github.com/miroir-framework/jzod/blob/main/doc/usage.drawio.png)

Using the features of Zod, one may obtain, in a single movement:

Expand Down Expand Up @@ -147,7 +147,7 @@ jzodToZod(recursiveType).parse( { a: { a: { a: "test" } } } ); //success

Jzod provides Typescript Types for Jzod Schemas. One thus benefits from completion when creating Jzod Schemas, at least on modern IDEs:

![Completion](doc/ts-completion.png)
![Completion](https://github.com/miroir-framework/jzod/blob/main/doc/ts-completion.png)


### Conversion to Zod
Expand Down Expand Up @@ -193,6 +193,7 @@ jzodToTsCode({ type: "simpleType", definition: "string" }, true/*export declarat
The function

```ts
import { jzodToTsTypeAliasesAndZodText } from "jzod-ts"
jzodToTsTypeAliasesAndZodText(
element: JzodElement,
typeName?: string,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@miroir-framework/jzod",
"private": false,
"version": "0.5.3",
"version": "0.5.4",
"description": "The Json bootstrapper for Zod.",
"main": "dist/bundle.js",
"types": "dist/bundle.d.ts",
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export {
objectToJsStringArray,
objectToJsStringObject,
} from "./Jzod"
// export {
// zodToZodText
// } from "./ZodToZodText"
export {
zodToJzod
} from "./ZodToJzod"
export {
jzodToZod
} from "./facade"

0 comments on commit 311b0e6

Please sign in to comment.