Skip to content

Commit

Permalink
Merge pull request #51 from guMcrey/hotfix/grammatical-error
Browse files Browse the repository at this point in the history
Hotfix/grammatical error
  • Loading branch information
guMcrey authored Sep 19, 2024
2 parents c00ab99 + fdfbfe3 commit a9600f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

---

## 1.7.3

`2024-09-19`

[#50](https://github.com/guMcrey/version-rocket/issues/50) (Thanks to [Jolie](https://github.com/newives) for the feedback)
- 🪲 Fix the syntax error of the expression `[...new Set(config.checkOriginSpecifiedFilesUrl)] || []` in TypeScript.

## 1.7.2

`2024-08-09`
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

---

## 1.7.3

`2024-09-19`

[#50](https://github.com/guMcrey/version-rocket/issues/50) (感谢 [Jolie](https://github.com/newives) 同学的反馈)
- 🪲 修复 `[...new Set(config.checkOriginSpecifiedFilesUrl)] || []` 表达式在 Typescript 中的语法错误

## 1.7.2

`2024-08-09`
Expand Down
13 changes: 11 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,22 @@ export const checkVersion = (
worker = createWorker(createWorkerFunc, [checkVersionTypeFunc])
}

const processUserInput = (input: any) => {
if (!Array.isArray(input)) {
console.warn('Invalid input: Expected an array.')
return []
}
return [...new Set(input)].filter((item) => item != null)
}

worker.postMessage({
'version-key': config.localPackageVersion || '',
'polling-time': config.pollingTime || 5000,
immediate: config.immediate || false,
'origin-version-file-url': config.originVersionFileUrl || '',
'check-origin-specified-files-url':
[...new Set(config.checkOriginSpecifiedFilesUrl)] || [],
'check-origin-specified-files-url': processUserInput(
config.checkOriginSpecifiedFilesUrl
),
'check-origin-specified-files-url-mode':
config.checkOriginSpecifiedFilesUrlMode || 'one',
'clear-interval-on-dialog': config.clearIntervalOnDialog || false,
Expand Down

0 comments on commit a9600f4

Please sign in to comment.