diff --git a/bun.lockb b/bun.lockb index 5d5ba8c..a6c5f62 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 4bb4542..abd207c 100644 --- a/package.json +++ b/package.json @@ -48,12 +48,12 @@ "clean:node": "rm -rf node_modules" }, "dependencies": { - "@thilawyn/traitify-ts": "^0.1.13", + "@thilawyn/traitify-ts": "^0.1.14", "decimal.js": "^10.4.3", - "effect": "^2.4.0", + "effect": "^2.4.1", "lodash-es": "^4.17.21", "mobx": "^6.12.0", - "type-fest": "^4.10.3", + "type-fest": "^4.12.0", "zod": "^3.22.4" }, "devDependencies": { @@ -62,11 +62,11 @@ "bun-types": "latest", "npm-check-updates": "^16.14.15", "npm-sort": "^0.0.4", - "rollup": "^4.12.0", + "rollup": "^4.12.1", "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-ts": "^3.4.5", "ts-functional-pipe": "^3.1.2", "tsx": "^4.7.1", - "typescript": "^5.3.3" + "typescript": "^5.4.2" } } diff --git a/src/traits/ZodSchemaObject.ts b/src/traits/ZodSchemaObject.ts index fcecae9..08b3680 100644 --- a/src/traits/ZodSchemaObject.ts +++ b/src/traits/ZodSchemaObject.ts @@ -1,7 +1,7 @@ -import { ImplStaticThis, trait } from "@thilawyn/traitify-ts" +import { ImplStatic, trait } from "@thilawyn/traitify-ts" import { Class, HasRequiredKeys } from "type-fest" import { z } from "zod" -import { StaticMembers, parseZodSchemaEffect } from "../util" +import { parseZodSchemaEffect } from "../util" type ParseParamsArgs = [] | [params: Partial] @@ -32,7 +32,7 @@ export const ZodSchemaObject = < static readonly schema = schema static readonly schemaWithDefaultsValues = schemaWithDefaultValues - static instantiationTransform< + static transform< Instance extends Values, T extends z.ZodRawShape, @@ -53,12 +53,12 @@ export const ZodSchemaObject = < >( this: ( Class & - StaticMembers> + ImplStatic ), ...[values, params]: NewZodSchemaInstanceArgs ) { return this - .instantiationTransform(this.schemaWithDefaultsValues) + .transform(this.schemaWithDefaultsValues) .parse(values, params) } @@ -67,12 +67,12 @@ export const ZodSchemaObject = < >( this: ( Class & - StaticMembers> + ImplStatic ), ...[values, params]: NewZodSchemaInstanceArgs ) { return this - .instantiationTransform(this.schemaWithDefaultsValues) + .transform(this.schemaWithDefaultsValues) .parseAsync(values, params) } @@ -81,12 +81,12 @@ export const ZodSchemaObject = < >( this: ( Class & - StaticMembers> + ImplStatic ), ...[values, params]: NewZodSchemaInstanceArgs ) { return parseZodSchemaEffect( - this.instantiationTransform(this.schemaWithDefaultsValues), + this.transform(this.schemaWithDefaultsValues), values, params, )