Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chrishoermann/zod-prisma-types
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 48067e4e74693f5feae61506efc304b9a5cc2f46
Choose a base ref
...
head repository: chrishoermann/zod-prisma-types
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 26108d67c974070a29482cc30dc012104266748c
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on May 3, 2023

  1. fixed #136

    chrishoermann committed May 3, 2023
    Copy the full SHA
    26108d6 View commit details
6 changes: 3 additions & 3 deletions packages/generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zod-prisma-types",
"version": "2.5.6",
"version": "2.5.7",
"description": "Generates zod schemas from Prisma models with advanced validation",
"author": "Chris Hörmann",
"license": "MIT",
@@ -32,7 +32,7 @@
"format": "prettier --write \"**/*.{ts,tsx,md,json}\""
},
"devDependencies": {
"@prisma/internals": "^4.11.0",
"@prisma/internals": "^4.13.0",
"@types/lodash": "^4.14.191",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
@@ -46,7 +46,7 @@
"vitest": "^0.24.5"
},
"dependencies": {
"@prisma/generator-helper": "^4.11.0",
"@prisma/generator-helper": "^4.13.0",
"code-block-writer": "^11.0.3",
"lodash": "^4.17.21",
"zod": "^3.21.1"
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ export const STRING_VALIDATOR_STRING_AND_MESSAGE_REGEX =
// ----------------------------------------

export const NUMBER_VALIDATOR_NUMBER_AND_MESSAGE_REGEX =
/.(?<validator>gt|gte|lt|lte|multipleOf)(?<number>\([\d]+([,][ ]?)?(?<message>[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/;
/.(?<validator>gt|gte|lt|lte|multipleOf)(?<number>\([\d.]+([,][ ]?)?(?<message>[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/;

export const NUMBER_VALIDATOR_MESSAGE_REGEX =
/.(?<validator>int|positive|nonnegative|negative|nonpositive|finite|noDefault)(\((?<message>[{][ ]?message:[ ]?['"][\w\W]+['"][ ]?[}])?\))/;
2 changes: 1 addition & 1 deletion packages/usage/package.json
Original file line number Diff line number Diff line change
@@ -30,6 +30,6 @@
"validator": "^13.9.0",
"vitest": "^0.25.8",
"zod": "^3.21.1",
"zod-prisma-types": "workspace:2.5.4"
"zod-prisma-types": "workspace:2.5.6"
}
}
2 changes: 1 addition & 1 deletion packages/usage/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ model MyPrismaScalarsType {
string String?
/// @zod.custom.use(z.string().refine((val) => validator.isBIC(val), { message: 'BIC is not valid' }))
bic String?
/// @zod.number.lt(10, { message: "lt error" }).gt(5, { message: "gt error" })
/// @zod.number.lt(10.3, { message: "lt error" }).gt(5.5, { message: "gt error" })
float Float
floatOpt Float?
/// @zod.number.int({ message: "error" }).gt(5, { message: "gt error" })
110 changes: 57 additions & 53 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.