@miroir-framework/jzod-ts 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -36,7 +36,7 @@ function jzodToTsCode(jzodElement, exportPrefix = true, typeName) {
36
36
  const schemaName = typeName ? typeName.replace(/^(.)(.*)$/, (a, b, c) => b.toLowerCase() + c) : "";
37
37
  const header = `import { ZodType, ZodTypeAny, z } from "zod";`;
38
38
  const typeAliasesAndZodText = jzodToTsTypeAliasesAndZodText(jzodElement, typeName);
39
- const bodyJsCode = `export const ${schemaName} = ${typeAliasesAndZodText.mainZodText};`;
39
+ const bodyJsCode = `export const ${schemaName}: z.ZodType<${schemaName}> = ${typeAliasesAndZodText.mainZodText};`;
40
40
  const contextTsTypesString = printTsTypeAliases(typeAliasesAndZodText.contextTsTypeAliases, exportPrefix);
41
41
  const contextJsCode = typeAliasesAndZodText.contextZodText
42
42
  ? Object.entries(typeAliasesAndZodText.contextZodText).reduce((acc, curr) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@miroir-framework/jzod-ts",
3
3
  "private": false,
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "The Typescript-related functionalities of Jzod.",
6
6
  "main": "dist/bundle.js",
7
7
  "types": "dist/bundle.d.ts",
@@ -15,7 +15,7 @@
15
15
  "bugs": "https://github.com/miroir-framework/jzod/issues",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@miroir-framework/jzod": "0.1.2",
18
+ "@miroir-framework/jzod": "0.5.1",
19
19
  "zod": "^3.22.2",
20
20
  "zod-to-ts": "^1.2.0"
21
21
  },
package/src/JzodToTs.ts CHANGED
@@ -79,7 +79,7 @@ export function jzodToTsCode (
79
79
 
80
80
  const typeAliasesAndZodText = jzodToTsTypeAliasesAndZodText(jzodElement, typeName);
81
81
 
82
- const bodyJsCode = `export const ${schemaName} = ${typeAliasesAndZodText.mainZodText};`;
82
+ const bodyJsCode = `export const ${schemaName}: z.ZodType<${schemaName}> = ${typeAliasesAndZodText.mainZodText};`;
83
83
 
84
84
  const contextTsTypesString = printTsTypeAliases(typeAliasesAndZodText.contextTsTypeAliases, exportPrefix);
85
85
  // console.log("getTsCodeCorrespondingToZodSchemaAndDescription contextTsTypesString",contextTsTypesString);