Skip to content

Commit 48170a1

Browse files
committed
take ZodRawShape
1 parent 8b2ee61 commit 48170a1

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zod-cdk-context",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "Validate AWS CDK context with Zod",
55
"keywords": [
66
"zod",

src/index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import type { Node } from 'constructs'
22

3-
import { z } from 'zod'
3+
import { z, type ZodRawShape } from 'zod'
44

55
export { z } from 'zod'
66

7-
export const getValidatedContext = <
8-
T extends {
9-
[key: string]:
10-
| z.ZodString
11-
| z.ZodNumber
12-
| z.ZodOptional<z.ZodString | z.ZodNumber>
13-
| z.ZodEnum<[string, ...string[]]>
14-
},
15-
>(
7+
export const getValidatedContext = <T extends ZodRawShape>(
168
node: Node,
179
schemaObject: T,
1810
): z.infer<z.ZodObject<T>> => {

0 commit comments

Comments
 (0)