* Derive a kebab-case ID from a comment string. * Handles ASCII (spaces/underscores → hyphens) and CJK (kept as-is).
(comment: string)
| 138 | * Handles ASCII (spaces/underscores → hyphens) and CJK (kept as-is). |
| 139 | */ |
| 140 | function commentToId(comment: string): string { |
| 141 | return comment |
| 142 | .trim() |
| 143 | .toLowerCase() |
| 144 | .replace(/[\s_]+/g, '-') |
| 145 | .replace(/[^a-z0-9\p{Unified_Ideograph}-]/gu, '') |
| 146 | .replace(/-+/g, '-') |
| 147 | .replace(/^-|-$/g, ''); |
| 148 | } |
| 149 | |
| 150 | const TAG_NAME_PATTERN = '[a-zA-Z\\p{Unified_Ideograph}]'; |
| 151 | const RESOURCE_LIST_NAMES = ['scene_list', 'CG_list', 'fans', 'surveillance', 'live']; |
no outgoing calls
no test coverage detected