Files
DndGamePlayer/app/shared/foundry/foundryPaths.ts
T
Ivan Fontosh f4c0ac1438 feat(npcs): add groups, storyline bindings, and Foundry import
Nested NPC groups with color, graph filter, and scene/storyline binding; Foundry worlds/modules import actors into groups; storyline merge asks on NPC name conflicts and reports NPC counts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 13:19:22 +08:00

12 lines
456 B
TypeScript

/** Декодирует %20 и т.п. в путях Foundry; безопасен для уже декодированных строк. */
export function decodeFoundryAssetPath(foundryPath: string): string {
const trimmed = foundryPath.trim().replace(/\\/gu, '/').replace(/^\/+/u, '');
if (!trimmed) return '';
if (/^https?:\/\//iu.test(trimmed)) return trimmed;
try {
return decodeURIComponent(trimmed);
} catch {
return trimmed;
}
}