Skip to content

Commit edf17e9

Browse files
malbert69IonCazajef
authored
feat(store): microcenter (jef#39)
Co-authored-by: Ion Caza <contact@johncaza.com> Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
1 parent faad3e6 commit edf17e9

File tree

4 files changed

+55
-22
lines changed

4 files changed

+55
-22
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.idea/
2+
.vs/
3+
.vscode/
24
build/
35
node_modules/
46

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ First, you're going to need to copy the `.env.example` to `.env`. The current op
8585
| Amazon | `amazon`|
8686
| B&H | `bandh`|
8787
| EVGA | `evga`|
88+
| Micro Center | `microcenter`|
8889
| Newegg | `newegg`|
8990
| Nvidia | `nvidia`|
9091

src/store/index.ts

+8-22
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,25 @@ import {Evga} from './evga';
44
import {NewEgg} from './newegg';
55
import {Nvidia} from './nvidia';
66
import {Amazon} from './amazon';
7+
import {MicroCenter} from './microcenter';
78
import {Config} from '../config';
89

9-
const list = new Map([
10+
const masterList = new Map([
11+
['amazon', Amazon],
1012
['bestbuy', BestBuy],
1113
['bandh', BAndH],
1214
['evga', Evga],
13-
['amazon', Amazon],
15+
['microcenter', MicroCenter],
1416
['newegg', NewEgg],
1517
['nvidia', Nvidia]
1618
]);
1719

18-
if (!Config.stores.toLowerCase().includes('bestbuy')) {
19-
list.delete('bestbuy');
20-
}
21-
22-
if (!Config.stores.toLowerCase().includes('bandh')) {
23-
list.delete('bandh');
24-
}
25-
26-
if (!Config.stores.toLowerCase().includes('evga')) {
27-
list.delete('evga');
28-
}
20+
const list = new Map();
2921

30-
if (!Config.stores.toLowerCase().includes('amazon')) {
31-
list.delete('amazon');
32-
}
33-
34-
if (!Config.stores.toLowerCase().includes('newegg')) {
35-
list.delete('newegg');
36-
}
22+
const storeArray = Config.stores.split(',');
3723

38-
if (!Config.stores.toLowerCase().includes('nvidia')) {
39-
list.delete('nvidia');
24+
for (const name of storeArray) {
25+
list.set(name, masterList.get(name));
4026
}
4127

4228
export const Stores = Array.from(list.values());

src/store/microcenter.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {Store} from './store';
2+
3+
export const MicroCenter: Store = {
4+
cartUrl: '',
5+
links: [
6+
{
7+
brand: 'evga',
8+
model: 'xc3 ultra gaming',
9+
url: 'https://www.microcenter.com/product/628344/evga-geforce-rtx-3080-xc3-ultra-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
10+
oosLabels: ['sold out']
11+
},
12+
{
13+
brand: 'msi',
14+
model: 'ventus 3x overclocked',
15+
url: 'https://www.microcenter.com/product/628331/msi-geforce-rtx-3080-ventus-3x-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
16+
oosLabels: ['sold out']
17+
},
18+
{
19+
brand: 'asus',
20+
model: 'tuf gaming',
21+
url: 'https://www.microcenter.com/product/628303/asus-geforce-rtx-3080-tuf-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
22+
oosLabels: ['sold out']
23+
},
24+
{
25+
brand: 'msi',
26+
model: 'gaming x trio',
27+
url: 'https://www.microcenter.com/product/628330/msi-geforce-rtx-3080-gaming-x-trio-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
28+
oosLabels: ['sold out']
29+
},
30+
{
31+
brand: 'evga',
32+
model: 'xc3 black',
33+
url: 'https://www.microcenter.com/product/628340/evga-geforce-rtx-3080-xc3-black-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
34+
oosLabels: ['sold out']
35+
},
36+
{
37+
brand: 'zotac',
38+
model: 'trinity overclocked',
39+
url: 'https://www.microcenter.com/product/628607/zotac-geforce-rtx-3080-trinity-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
40+
oosLabels: ['sold out']
41+
}
42+
],
43+
name: 'microcenter'
44+
};

0 commit comments

Comments
 (0)