Spaces:
Runtime error
Runtime error
| const DEFAULT_BIN_ASSET_BASE = 'https://huggingface.co/datasets/pedroc/caro5-game-assets/resolve/main' | |
| const rawBase = import.meta.env.VITE_BIN_ASSET_BASE || DEFAULT_BIN_ASSET_BASE | |
| export const BIN_ASSET_BASE = rawBase.replace(/\/+$/, '') | |
| export function binAssetUrl(path: string): string { | |
| const normalizedPath = path.replace(/^\/+/, '') | |
| return `${BIN_ASSET_BASE}/${normalizedPath}` | |
| } | |
| const IMAGE_SYMBOL_PREFIX = 'img:' | |
| export function isImageSymbol(sym: string | undefined | null): boolean { | |
| return typeof sym === 'string' && sym.startsWith(IMAGE_SYMBOL_PREFIX) | |
| } | |
| export function imageSymbolUrl(sym: string): string { | |
| return binAssetUrl(sym.slice(IMAGE_SYMBOL_PREFIX.length)) | |
| } | |