Fix Samsung density-code regex to honor fixed field width
The lazy quantifier {4,6}? never expanded beyond its minimum because
the trailing greedy [A-Z0-9]* always absorbed the rest up to the
hyphen, so a longer density code would silently be truncated to 5
chars and could match an unrelated table entry, producing wrong specs
instead of null. The density code is actually fixed-width (A + 4
chars); the revision after it is the variable part. Tighten the
pattern to {4}, rewrite the stale comment (which still claimed a fixed
3-char revision), and add a test that every Samsung density key is
exactly 5 characters so a future mismatched table entry can't silently
become unreachable.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+9
-7
@@ -10,13 +10,15 @@
|
||||
export const VENDOR_TABLES = [
|
||||
{
|
||||
vendor: 'Samsung',
|
||||
// M<bauform><dichte>-<rev(3)>-<speed><rest>
|
||||
// Hinweis: Die im Brief angegebene Fassung dieses Musters liess die
|
||||
// fuehrende Generationskennung 'A' ausserhalb der Erfassungsgruppe und
|
||||
// erfasste dadurch nie den vollstaendigen Dichte-Code 'A8K40' - die
|
||||
// Tabellensuche schlug immer fehl. Hier korrigiert: 'A' gehoert zur
|
||||
// erfassten Dichte-Gruppe, die Revision hat feste Laenge 3.
|
||||
pattern: /^M(\d{3})(A[A-Z0-9]{4,6}?)[A-Z0-9]*-([A-Z]{3})/,
|
||||
// M<bauform><dichte(5)><rev(variabel)>-<speed><rest>
|
||||
// Der Dichte-Code hat feste Breite: die Generationskennung 'A' plus vier
|
||||
// weitere Zeichen, also fuenf insgesamt. Die Revision danach ist die
|
||||
// variable Groesse und wird nicht separat erfasst. Der
|
||||
// Geschwindigkeitscode sind die drei Buchstaben direkt nach dem
|
||||
// Bindestrich. Achtung: Ein Dichte-Code abweichender Laenge kann von
|
||||
// diesem Muster nicht erfasst werden - ein solcher Tabelleneintrag
|
||||
// bliebe wirkungslos, die Tabellensuche schluege dafuer stets fehl.
|
||||
pattern: /^M(\d{3})(A[A-Z0-9]{4})[A-Z0-9]*-([A-Z]{3})/,
|
||||
formFactor: {
|
||||
378: 'UDIMM',
|
||||
391: 'UDIMM',
|
||||
|
||||
Reference in New Issue
Block a user