Bugfix/Check condition when input is undefined (#2914)

fix check condition when input is undefined
This commit is contained in:
Henry Heng 2024-07-30 23:20:36 +01:00 committed by GitHub
parent c899c05693
commit dd7e3eef04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ import { ICommonObject, IDatabaseEntity, INodeData, ISeqAgentsState, IVisionChat
import { availableDependencies, defaultAllowBuiltInDep, getVars, prepareSandboxVars } from '../../src/utils'
export const checkCondition = (input: string | number | undefined, condition: string, value: string | number = ''): boolean => {
if (!input) return false
if (!input && condition === 'Is Empty') return true
else if (!input) return false
// Function to check if a string is a valid number
const isNumericString = (str: string): boolean => /^-?\d*\.?\d+$/.test(str)