MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / commentToId

Function commentToId

apps/webuiapps/src/lib/cardExtractor.ts:140–148  ·  view source on GitHub ↗

* Derive a kebab-case ID from a comment string. * Handles ASCII (spaces/underscores → hyphens) and CJK (kept as-is).

(comment: string)

Source from the content-addressed store, hash-verified

138 * Handles ASCII (spaces/underscores → hyphens) and CJK (kept as-is).
139 */
140function 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
150const TAG_NAME_PATTERN = '[a-zA-Z\\p{Unified_Ideograph}]';
151const RESOURCE_LIST_NAMES = ['scene_list', 'CG_list', 'fans', 'surveillance', 'live'];

Callers 1

extractAppsFromEntriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected