Buckets:
| export const ACCEPTED_IMAGE_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"] | |
| export const ACCEPTED_FILE_TYPES = [ | |
| ...ACCEPTED_IMAGE_TYPES, | |
| "application/pdf", | |
| "text/*", | |
| "application/json", | |
| "application/ld+json", | |
| "application/toml", | |
| "application/x-toml", | |
| "application/x-yaml", | |
| "application/xml", | |
| "application/yaml", | |
| ".c", | |
| ".cc", | |
| ".cjs", | |
| ".conf", | |
| ".cpp", | |
| ".css", | |
| ".csv", | |
| ".cts", | |
| ".env", | |
| ".go", | |
| ".gql", | |
| ".graphql", | |
| ".h", | |
| ".hh", | |
| ".hpp", | |
| ".htm", | |
| ".html", | |
| ".ini", | |
| ".java", | |
| ".js", | |
| ".json", | |
| ".jsx", | |
| ".log", | |
| ".md", | |
| ".mdx", | |
| ".mjs", | |
| ".mts", | |
| ".py", | |
| ".rb", | |
| ".rs", | |
| ".sass", | |
| ".scss", | |
| ".sh", | |
| ".sql", | |
| ".toml", | |
| ".ts", | |
| ".tsx", | |
| ".txt", | |
| ".xml", | |
| ".yaml", | |
| ".yml", | |
| ".zsh", | |
| ] | |
| const MIME_EXT = new Map([ | |
| ["image/png", "png"], | |
| ["image/jpeg", "jpg"], | |
| ["image/gif", "gif"], | |
| ["image/webp", "webp"], | |
| ["application/pdf", "pdf"], | |
| ["application/json", "json"], | |
| ["application/ld+json", "jsonld"], | |
| ["application/toml", "toml"], | |
| ["application/x-toml", "toml"], | |
| ["application/x-yaml", "yaml"], | |
| ["application/xml", "xml"], | |
| ["application/yaml", "yaml"], | |
| ]) | |
| const TEXT_EXT = ["txt", "text", "md", "markdown", "log", "csv"] | |
| export const ACCEPTED_FILE_EXTENSIONS = Array.from( | |
| new Set( | |
| ACCEPTED_FILE_TYPES.flatMap((item) => { | |
| if (item.startsWith(".")) return [item.slice(1)] | |
| if (item === "text/*") return TEXT_EXT | |
| const out = MIME_EXT.get(item) | |
| return out ? [out] : [] | |
| }), | |
| ), | |
| ).sort() | |
| export function filePickerFilters(ext?: string[]) { | |
| if (!ext || ext.length === 0) return undefined | |
| return [{ name: "Files", extensions: ext }] | |
| } | |
Xet Storage Details
- Size:
- 1.67 kB
- Xet hash:
- 4488b3fdeb86785690b488e0a78283451ba558e7e1170dc39eaa4926090ab5fa
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.