Download packages/klient/src/transports/args.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/klient/src/transports/args.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/klient/src/transports/args.ts
-
curl -L -o args.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/klient/src/transports/args.ts
517 Bytes
| /** | |
| * JSON has no `undefined`: an args tuple ending in optional parameters would | |
| * cross the wire as `null` and defeat server-side default parameters (and | |
| * `z.string().optional()`-style fields). Contracts only ever make trailing | |
| * args optional, so trimming the tail is sufficient. | |
| */ | |
| export function trimTrailingUndefined(args: readonly unknown[]): unknown[] { | |
| let end = args.length; | |
| while (end > 0 && args[end - 1] === undefined) end -= 1; | |
| return end === args.length ? [...args] : args.slice(0, end); | |
| } | |