Skip to content

Commit a9600f4

Browse files
authored
Merge pull request #51 from guMcrey/hotfix/grammatical-error
Hotfix/grammatical error
2 parents c00ab99 + fdfbfe3 commit a9600f4

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

CHANGELOG.en-US.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
---
88

9+
## 1.7.3
10+
11+
`2024-09-19`
12+
13+
[#50](https://github.com/guMcrey/version-rocket/issues/50) (Thanks to [Jolie](https://github.com/newives) for the feedback)
14+
- 🪲 Fix the syntax error of the expression `[...new Set(config.checkOriginSpecifiedFilesUrl)] || []` in TypeScript.
15+
916
## 1.7.2
1017

1118
`2024-08-09`

CHANGELOG.zh-CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
---
88

9+
## 1.7.3
10+
11+
`2024-09-19`
12+
13+
[#50](https://github.com/guMcrey/version-rocket/issues/50) (感谢 [Jolie](https://github.com/newives) 同学的反馈)
14+
- 🪲 修复 `[...new Set(config.checkOriginSpecifiedFilesUrl)] || []` 表达式在 Typescript 中的语法错误
15+
916
## 1.7.2
1017

1118
`2024-08-09`

index.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,22 @@ export const checkVersion = (
9999
worker = createWorker(createWorkerFunc, [checkVersionTypeFunc])
100100
}
101101

102+
const processUserInput = (input: any) => {
103+
if (!Array.isArray(input)) {
104+
console.warn('Invalid input: Expected an array.')
105+
return []
106+
}
107+
return [...new Set(input)].filter((item) => item != null)
108+
}
109+
102110
worker.postMessage({
103111
'version-key': config.localPackageVersion || '',
104112
'polling-time': config.pollingTime || 5000,
105113
immediate: config.immediate || false,
106114
'origin-version-file-url': config.originVersionFileUrl || '',
107-
'check-origin-specified-files-url':
108-
[...new Set(config.checkOriginSpecifiedFilesUrl)] || [],
115+
'check-origin-specified-files-url': processUserInput(
116+
config.checkOriginSpecifiedFilesUrl
117+
),
109118
'check-origin-specified-files-url-mode':
110119
config.checkOriginSpecifiedFilesUrlMode || 'one',
111120
'clear-interval-on-dialog': config.clearIntervalOnDialog || false,

0 commit comments

Comments
 (0)