Skip to content

Commit

Permalink
chore: change verbiage to be more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed Apr 9, 2021
1 parent 9b02c36 commit e006c48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/store/lookup.ts
Expand Up @@ -149,7 +149,7 @@ async function handleAdBlock(request: HTTPRequest, adBlockRequestHandler: any) {
* because we don't want to get rate limited within the same store.
*
* @param browser Puppeteer browser.
* @param store Vendor of graphics cards.
* @param store Vendor of items.
*/
async function lookup(browser: Browser, store: Store) {
if (!getStores().has(store.name)) {
Expand Down Expand Up @@ -252,7 +252,7 @@ async function lookup(browser: Browser, store: Store) {
let statusCode = 0;

try {
statusCode = await lookupCard(browser, store, page, link);
statusCode = await lookupIem(browser, store, page, link);
} catch (error: unknown) {
if (store.currentProxyIndex !== undefined && store.proxyList) {
const proxy = `${store.currentProxyIndex + 1}/${
Expand Down Expand Up @@ -290,7 +290,7 @@ async function lookup(browser: Browser, store: Store) {
/* eslint-enable no-await-in-loop */
}

async function lookupCard(
async function lookupIem(
browser: Browser,
store: Store,
page: Page,
Expand All @@ -308,7 +308,7 @@ async function lookupCard(
return statusCode;
}

if (await lookupCardInStock(store, page, link)) {
if (await isItemInStock(store, page, link)) {
const givenUrl =
link.cartUrl && config.store.autoAddToCart ? link.cartUrl : link.url;
logger.info(`${Print.inStock(link, store, true)}\n${givenUrl}`);
Expand Down Expand Up @@ -427,7 +427,7 @@ async function isAboveMaxPrice(
return false;
}

async function lookupCardInStock(store: Store, page: Page, link: Link) {
async function isItemInStock(store: Store, page: Page, link: Link) {
const baseOptions: Selector = {
requireVisible: false,
selector: store.labels.container ?? 'body',
Expand Down

0 comments on commit e006c48

Please sign in to comment.