Download src/shared/types.ts from xjackkx/s2: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/spaces/xjackkx/s2/resolve/main/src/shared/types.ts
- Command line
-
hf download hf://spaces/xjackkx/s2/src/shared/types.ts
-
curl -L -o types.ts https://huggingface.co/spaces/xjackkx/s2/resolve/main/src/shared/types.ts
604 Bytes
| export type UnknownRecord = Record<string, unknown>; | |
| export type ErrorWithMetadata = Error & { | |
| code?: string; | |
| status?: number; | |
| promptBytes?: number; | |
| promptBytesExact?: boolean; | |
| thresholdBytes?: number; | |
| upstreamStatus?: number; | |
| rawLength?: number | null; | |
| reason?: string; | |
| cause?: unknown; | |
| }; | |
| export function isRecord(value: unknown): value is UnknownRecord { | |
| return !!value && typeof value === "object" && !Array.isArray(value); | |
| } | |
| export function firstRecord(...values: unknown[]): UnknownRecord | null { | |
| for (const value of values) { | |
| if (isRecord(value)) return value; | |
| } | |
| return null; | |
| } | |