mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 07:37:39 +00:00
chore: add types for brand and series (#148)
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
+2
-2
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user