f4c0ac1438
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>
12 lines
456 B
TypeScript
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;
|
|
}
|
|
}
|