mirror of
https://github.com/anthropics/claude-code.git
synced 2026-09-14 19:48:39 +08:00
10 lines
296 B
TypeScript
10 lines
296 B
TypeScript
/**
|
|
* A value a tool stored as the array it is, or an empty one when it is
|
|
* anything else.
|
|
*
|
|
* @param value a field of a tool's input or result
|
|
* @returns the array's items, unknown each
|
|
*/
|
|
export const arrayOf = (value: unknown): readonly unknown[] =>
|
|
Array.isArray(value) ? value : []
|