chore: add types for brand and series (#148)

Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
Scott Cooper
2020-09-23 11:33:38 -07:00
committed by GitHub
parent 7c50e2b5aa
commit c78d9a98ba
16 changed files with 32 additions and 32 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ const inStock: Record<string, boolean> = {};
* *
* @param brand The brand of the GPU * @param brand The brand of the GPU
*/ */
function filterBrand(brand: string) { function filterBrand(brand: Link['brand']) {
if (Config.store.showOnlyBrands.length === 0) { if (Config.store.showOnlyBrands.length === 0) {
return true; return true;
} }
@@ -27,7 +27,7 @@ function filterBrand(brand: string) {
* *
* @param series The series of the GPU * @param series The series of the GPU
*/ */
function filterSeries(series: string) { function filterSeries(series: Link['series']) {
if (Config.store.showOnlySeries.length === 0) { if (Config.store.showOnlySeries.length === 0) {
return true; return true;
} }
+2 -2
View File
@@ -9,9 +9,9 @@ export const Adorama: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.adorama.com/ev08gp43067k.html' url: 'https://www.adorama.com/ev08gp43067k.html'
}, },
{ {
+2 -2
View File
@@ -13,9 +13,9 @@ export const AmazonCa: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.amazon.ca/dp/B07PBLD2MX' url: 'https://www.amazon.ca/dp/B07PBLD2MX'
}, },
{ {
+2 -2
View File
@@ -13,9 +13,9 @@ export const Amazon: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.amazon.com/dp/B07MQ36Z6L' url: 'https://www.amazon.com/dp/B07MQ36Z6L'
}, },
{ {
+2 -2
View File
@@ -9,9 +9,9 @@ export const Asus: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://store.asus.com/us/item/202003AM280000002/' url: 'https://store.asus.com/us/item/202003AM280000002/'
}, },
{ {
+2 -2
View File
@@ -9,9 +9,9 @@ export const BAndH: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.bhphotovideo.com/c/product/1452927-REG/evga_06g_p4_2063_kr_geforce_rtx_2060_xc.html' url: 'https://www.bhphotovideo.com/c/product/1452927-REG/evga_06g_p4_2063_kr_geforce_rtx_2060_xc.html'
}, },
// TUF was removed from BH, not sure why so commenting out listing for now // TUF was removed from BH, not sure why so commenting out listing for now
+2 -2
View File
@@ -9,9 +9,9 @@ export const BestBuyCa: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.bestbuy.ca/en-ca/product/msi-nvidia-geforce-rtx-2060-super-gaming-x-8gb-gddr6-video-card/14419420?intl=nosplash' url: 'https://www.bestbuy.ca/en-ca/product/msi-nvidia-geforce-rtx-2060-super-gaming-x-8gb-gddr6-video-card/14419420?intl=nosplash'
}, },
{ {
+2 -2
View File
@@ -9,9 +9,9 @@ export const BestBuy: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-2060-super-8gb-gddr6-pci-express-graphics-card-black-silver/6361329.p?skuId=6361329&intl=nosplash' url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-2060-super-8gb-gddr6-pci-express-graphics-card-black-silver/6361329.p?skuId=6361329&intl=nosplash'
}, },
{ {
+2 -2
View File
@@ -9,9 +9,9 @@ export const Evga: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.evga.com/products/product.aspx?pn=06G-P4-2065-KR' url: 'https://www.evga.com/products/product.aspx?pn=06G-P4-2065-KR'
}, },
{ {
+2 -2
View File
@@ -135,10 +135,10 @@ export function generateLinks(): Link[] {
if (fe2060SuperId) { if (fe2060SuperId) {
links.push({ links.push({
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
openCartAction: generateOpenCartAction(fe2060SuperId, nvidiaLocale, drLocale, 'TEST CARD debug'), openCartAction: generateOpenCartAction(fe2060SuperId, nvidiaLocale, drLocale, 'TEST CARD debug'),
series: 'debug', series: 'test:series',
url: digitalRiverStockUrl(fe2060SuperId, drLocale) url: digitalRiverStockUrl(fe2060SuperId, drLocale)
}); });
} }
+2 -2
View File
@@ -9,9 +9,9 @@ export const MicroCenter: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.microcenter.com/product/618433/evga-geforce-rtx-2060-ko-ultra-overclocked-dual-fan-6gb-gddr6-pcie-30-graphics-card' url: 'https://www.microcenter.com/product/618433/evga-geforce-rtx-2060-ko-ultra-overclocked-dual-fan-6gb-gddr6-pcie-30-graphics-card'
}, },
{ {
+2 -2
View File
@@ -13,9 +13,9 @@ export const NewEggCa: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.newegg.ca/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488' url: 'https://www.newegg.ca/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488'
}, },
{ {
+2 -2
View File
@@ -13,9 +13,9 @@ export const NewEgg: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.newegg.com/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488' url: 'https://www.newegg.com/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488'
}, },
{ {
+2 -2
View File
@@ -13,9 +13,9 @@ export const OfficeDepot: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://www.officedepot.com/a/products/4652239/EVGA-GeForce-RTX-2060-Graphic-Card/' url: 'https://www.officedepot.com/a/products/4652239/EVGA-GeForce-RTX-2060-Graphic-Card/'
}, },
{ {
+2 -2
View File
@@ -6,8 +6,8 @@ export type Element = {
}; };
export type Link = { export type Link = {
series: string; brand: 'test:brand' | 'asus' | 'evga' | 'gigabyte' | 'pny' | 'msi' | 'nvidia' | 'zotac';
brand: string; series: 'test:series' | '3070' | '3080' | '3090';
model: string; model: string;
url: string; url: string;
cartUrl?: string; cartUrl?: string;
+2 -2
View File
@@ -9,9 +9,9 @@ export const Zotac: Store = {
}, },
links: [ links: [
{ {
brand: 'TEST', brand: 'test:brand',
model: 'CARD', model: 'CARD',
series: 'debug', series: 'test:series',
url: 'https://store.zotac.com/zotac-gaming-geforce-rtx-2060-twin-fan-zt-t20600f-10m' url: 'https://store.zotac.com/zotac-gaming-geforce-rtx-2060-twin-fan-zt-t20600f-10m'
}, },
{ {