Address Sonar warnings and harden runtime
This commit is contained in:
parent
9e2bc89ff2
commit
69282c63d5
5 changed files with 25 additions and 9 deletions
|
|
@ -385,7 +385,9 @@ try {
|
|||
const detailLoc = page.locator('[data-a-target="DescriptionItemDetails"], [data-testid="DescriptionItemDetails"]');
|
||||
if (await detailLoc.count()) {
|
||||
const item_text = await detailLoc.first().innerText();
|
||||
store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1);
|
||||
const lower = item_text.toLowerCase();
|
||||
const onPos = lower.lastIndexOf(' on ');
|
||||
if (onPos >= 0) store = lower.slice(onPos + 4).replace(/[.!]$/, '');
|
||||
} else if (url.includes('/claims/')) {
|
||||
const slug = url.split('/claims/')[1]?.split('/')[0] || '';
|
||||
if (slug.includes('gog')) store = 'gog.com';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue