mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
feat: add type checking for rawKey in formatKey function
This commit is contained in:
@@ -22,6 +22,12 @@ function formatSegment(segment) {
|
||||
}
|
||||
|
||||
function formatKey(rawKey) {
|
||||
// Add type checking
|
||||
if (typeof rawKey !== 'string') {
|
||||
console.warn('Expected string for key, received:', rawKey);
|
||||
return String(rawKey || ''); // Convert to string or use empty string as fallback
|
||||
}
|
||||
|
||||
const segments = rawKey.split('.');
|
||||
const formattedSegments = segments.map(segment => formatSegment(segment));
|
||||
return formattedSegments.join(': ');
|
||||
|
||||
Reference in New Issue
Block a user