Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

418 B
Raw Blame
import type { ParseIssue } from 'effect/ParseResult';
import { inspect } from 'node:util';

export function extractActual({ actual }: ParseIssue, cap = 50) {
  // Cap the length of the actual value to 50 characters
  let str: string;

  if (typeof actual === 'object') {
    str = inspect(actual, { depth: 2 });
  } else {
    str = String(actual);
  }

  return str.slice(0, cap) + (str.length > cap ? '...' : '');
}