-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 (dify) Fix Dify error when inputs are empty
- Loading branch information
1 parent
5226b06
commit f5bdba5
Showing
11 changed files
with
129 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/builder/src/features/forge/helpers/getZodInnerSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { z } from '@typebot.io/forge/zod' | ||
|
||
export const getZodInnerSchema = (schema: z.ZodTypeAny): z.ZodTypeAny => { | ||
if (schema._def.typeName === 'ZodEffects') | ||
return getZodInnerSchema(schema._def.schema) | ||
if (schema._def.typeName === 'ZodOptional') { | ||
const innerSchema = getZodInnerSchema(schema._def.innerType) | ||
return { | ||
...innerSchema, | ||
_def: { | ||
...innerSchema._def, | ||
layout: schema._def.layout, | ||
}, | ||
} as z.ZodTypeAny | ||
} | ||
|
||
return schema | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import isURL, { IsURLOptions } from 'validator/lib/isURL' | ||
|
||
const customIsURL = (val: string, options?: IsURLOptions) => | ||
isURL(val, { | ||
protocols: ['https', 'http'], | ||
require_protocol: true, | ||
...options, | ||
}) | ||
|
||
export { customIsURL as isURL } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.