Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

424 B
Raw Blame
import { isNil } from '@activepieces/core-utils'
import { ProcessorFn } from './types'

export const textProcessor: ProcessorFn = (property, value) => {
    if (isNil(value)) {
        return value
    }
    if (typeof value === 'object') {
        return JSON.stringify(value)
    }

    const result = value.toString()
    if (result.length === 0 && !property.required) {
        return undefined
    }
    return result
}