fix: use serial positions 6-11 for module slug instead of last 6 chars
Serial format is PPPPPP+SSSSSS+0001 — slice(-6) was picking up the trailing 0001 suffix. slice(6,12) gives the correct device identifier. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -10,7 +10,9 @@ const USER_ID = process.env.SOLEM_USER_ID || '5de53bca7ed4c45c2cfe067f';
|
|||||||
const registry = new Map();
|
const registry = new Map();
|
||||||
|
|
||||||
function makeSlug(type, serial) {
|
function makeSlug(type, serial) {
|
||||||
const suffix = (serial || '').slice(-6).toLowerCase();
|
// Serial format: PPPPPP SSSSSS 0001 — device identifier is at positions 6-11
|
||||||
|
const s = serial || '';
|
||||||
|
const suffix = (s.length >= 12 ? s.slice(6, 12) : s.slice(-6)).toLowerCase();
|
||||||
return `${type}_${suffix}`.replace(/[^a-z0-9_]/g, '_');
|
return `${type}_${suffix}`.replace(/[^a-z0-9_]/g, '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user