Skip to content

Commit b52729f

Browse files
committed
proper deep clones
1 parent 1ac99a4 commit b52729f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/crontabs/update-prices.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default new Crontab()
3333
.text(extension.name, (c) => c.cyan)
3434
.info()
3535

36-
const platforms = Object.assign({}, extension.platforms)
36+
const platforms = JSON.parse(JSON.stringify(extension.platforms))
3737

3838
if (extension.platforms.SOURCEXCHANGE) {
3939
const product = sxcProducts.find((product) => product.url === extension.platforms.SOURCEXCHANGE.url)
@@ -64,11 +64,12 @@ export default new Crontab()
6464
}
6565

6666
if (extension.platforms.GITHUB && (!platforms.GITHUB.price || !platforms.GITHUB.currency || !platforms.GITHUB.reviews)) {
67-
platforms.GITHUB = Object.assign(extension.platforms.GITHUB, {
67+
platforms.GITHUB = {
68+
url: extension.platforms.GITHUB.url,
6869
price: 0,
6970
currency: 'USD',
7071
reviews: 0
71-
})
72+
}
7273
}
7374

7475
if (JSON.stringify(platforms) !== JSON.stringify(extension.platforms)) {

0 commit comments

Comments
 (0)