Download mods/diff/hooks/array-of/array-of.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 296 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/array-of/array-of.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/hooks/array-of/array-of.ts
-
curl -L -o array-of.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/array-of/array-of.ts
296 Bytes
| /** | |
| * 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 : [] | |