For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/logs/functions/wrap.md.
  • 简体中文
  • Function: wrap()

    function wrap(color: 
      | "reset"
      | "bold"
      | "dim"
      | "red"
      | "green"
      | "yellow"
      | "blue"
      | "magenta"
      | "cyan"
      | "gray", s: string): string;

    Defined in: logs/ansi.ts:59

    使用指定的 ANSI 颜色样式包裹目标字符串。

    Parameters

    ParameterTypeDescription
    color| "reset" | "bold" | "dim" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "gray"颜色名称键。
    sstring待着色的字符串。

    Returns

    string

    着色并重置样式的字符串。