Add counter for ?main usage

This commit is contained in:
MICHAEL JACKSON 2017-11-16 21:25:50 -05:00
parent a9497166fe
commit e988180c8a
1 changed files with 6 additions and 0 deletions

View File

@ -112,6 +112,12 @@ function fetchFile(req, res, next) {
) {
// They specified a custom ?main field.
filename = req.packageConfig[req.query.main]
incrementCounter(
'package-json-custom-main',
req.packageSpec + '?main=' + req.query.main,
1
)
} else if (typeof req.packageConfig.unpkg === 'string') {
// The "unpkg" field allows packages to explicitly declare the
// file to serve at the bare URL (see #59).