We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1d0a64 commit 16a7d67Copy full SHA for 16a7d67
packages/core/src/context.ts
@@ -642,7 +642,10 @@ function mergePlatformItems<T = any>(source: CommentArray<CommentObject> | undef
642
platformUsage[v.platformStr] = (platformUsage[v.platformStr] || 0) + 1
643
})
644
645
- const defaultPlatformStr = Object.keys(platformUsage).reduce((a, b) => platformUsage[a] > platformUsage[b] ? a : b)
+ const usageKeys = Object.keys(platformUsage)
646
+ const defaultPlatformStr = usageKeys.length
647
+ ? usageKeys.reduce((a, b) => (platformUsage[a] > platformUsage[b] ? a : b))
648
+ : currentPlatform
649
650
// 为 result 添加 Symbol.for(`before:0`) 添加生成标识注释
651
result[Symbol.for('before:0') as CommentSymbol] = [{
0 commit comments