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 / array-of / array-of.ts
9 lines · 296 BRaw
1/**
2 * A value a tool stored as the array it is, or an empty one when it is
3 * anything else.
4 *
5 * @param value a field of a tool's input or result
6 * @returns the array's items, unknown each
7 */
8export const arrayOf = (value: unknown): readonly unknown[] =>
9 Array.isArray(value) ? value : []