Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Mar 4, 2024
2 parents e32ba2a + 81d1d85 commit ab59142
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/marshalls/downloads.marshall.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict'

const BaseMarshall = require('./baseMarshall')
const Warning = require('../helpers/warning')
const { marshallCategories } = require('./constants')

const MARSHALL_NAME = 'downloads'
const DOWNLOAD_COUNT_THRESHOLD = 20 // threshold per month
const DOWNLOAD_COUNT_THRESHOLD = 100 // threshold per month
const DOWNLOAD_COUNT_UPPER_THRESHOLD = 10000 // threshold per month

class Marshall extends BaseMarshall {
constructor(options) {
Expand All @@ -25,6 +27,12 @@ class Marshall extends BaseMarshall {
)
}

if (downloadCount < DOWNLOAD_COUNT_UPPER_THRESHOLD) {
throw new Warning(
`detected a low relatively low download-count package (${downloadCount} downloads last month)`
)
}

return downloadCount
})
}
Expand Down

0 comments on commit ab59142

Please sign in to comment.