spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / message-of / message-of.ts
9 lines · 274 BRaw
1/**
2 * A thrown or rejected value as the words it carries: an Error's message,
3 * anything else as a string.
4 *
5 * @param error what was caught
6 * @returns the message
7 */
8export const messageOf = (error: unknown) =>
9 error instanceof Error ? error.message : String(error)