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 / sec-default / hooks / attempted / attempted.ts
9 lines · 337 BRaw
1/**
2 * Makes a call on `$` at once and hands back a promise of what it settles
3 * to; a call that throws where it is made rejects that promise.
4 *
5 * @param call the call, made inside the hook that asked for it
6 * @returns what the call settles to
7 */
8export const attempted = <T>(call: () => T | Promise<T>) =>
9 (async () => call())()