fix: exclude yml into totaldownload start next version (#4572)
This commit is contained in:
parent
ddc2cd5e0f
commit
678116c6d6
@ -6,15 +6,20 @@ export function formatCompactNumber(count: number) {
|
||||
export const totalDownload = (release: []) => {
|
||||
if (release instanceof Array) {
|
||||
const count = release
|
||||
.map((version: { assets: any[] }) =>
|
||||
version.assets.map((os) => os.download_count)
|
||||
)
|
||||
.map((version: { assets: any[]; name: string }) => {
|
||||
// it will be correct since 0.5.15
|
||||
const tag = version.name >= '0.5.15' && version.name.includes('0.5.15')
|
||||
|
||||
return version.assets
|
||||
.filter((os) => !(tag && os.name.endsWith('.yml')))
|
||||
.map((os) => os.download_count)
|
||||
})
|
||||
.map((x: any[]) => x.reduce((a: any, b: any) => a + b, 0))
|
||||
.reduce((a: any, b: any) => a + b, 0)
|
||||
|
||||
return formatCompactNumber(count)
|
||||
} else {
|
||||
// return dummy avoid reate limit API when dev mode
|
||||
// return dummy to avoid rate limit API when in dev mode
|
||||
return formatCompactNumber(9000000)
|
||||
}
|
||||
}
|
||||
|
||||
3399
docs/yarn.lock
3399
docs/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user