cnpm / cnpmjs.org

Compare 5e1c608 ... +0 ... 2e7354c

Coverage Reach
controllers/registry/package/list.js controllers/registry/package/save.js controllers/registry/package/update.js controllers/registry/package/download.js controllers/registry/package/dist_tag.js controllers/registry/package/remove_version.js controllers/registry/package/remove.js controllers/registry/package/download_total.js controllers/registry/package/tag.js controllers/registry/package/list_since.js controllers/registry/package/show.js controllers/registry/package/deprecate.js controllers/registry/package/list_shorts.js controllers/registry/package/list_versions.js controllers/registry/package/list_all.js controllers/registry/package/list_dependents.js controllers/registry/package/list_by_user.js controllers/registry/user/add.js controllers/registry/user/update.js controllers/registry/user/show.js controllers/registry/user/common.js controllers/registry/user/ping.js controllers/registry/user/whoami.js controllers/registry/token/create.js controllers/registry/token/list.js controllers/registry/token/del.js controllers/registry/user_package.js controllers/sync_module_worker.js controllers/web/package/show.js controllers/web/package/search.js controllers/web/package/search_range.js controllers/web/package/list_privates.js controllers/web/badge.js controllers/web/user/show.js controllers/web/show_sync.js controllers/utils.js controllers/sync.js controllers/total.js services/package.js services/npm.js services/download_total.js services/total.js services/default_user_service.js services/user.js services/token.js services/module_log.js services/hook.js services/common.js middleware/auth.js middleware/publishable.js middleware/proxy_to_npm.js middleware/web_not_found.js middleware/login.js middleware/sync_by_install.js middleware/editable.js middleware/exists_package.js middleware/registry_not_found.js middleware/opensearch.js middleware/unpublishable.js middleware/limit.js middleware/static.js middleware/block.js models/user.js models/_module_maintainer_class_methods.js models/index.js models/token.js models/module_unpublished.js models/total.js models/utils.js models/tag.js models/module_abbreviated.js models/module_keyword.js models/package_readme.js models/module.js models/npm_module_maintainer.js models/download_total.js models/module_deps.js models/module_star.js models/module_log.js models/module_maintainer.js sync/sync_exist.js sync/status.js sync/sync_all.js sync/sync_popular.js common/urllib.js common/logger.js common/mail.js common/sequelize.js common/markdown.js common/cache.js common/nfs.js servers/web.js servers/registry.js routes/registry.js routes/web.js lib/common.js config/index.js

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -88,8 +88,10 @@
Loading
88 88
89 89
  // need limit by ip
90 90
  app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/download\/(@[\w\-\.]+\/[\w\-\.]+)$/, limit, downloadPackage);
91 +
  app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/download\/([\w\-\.]+)$/, limit, downloadPackage);
91 92
  app.get('/:name/download/:filename', limit, downloadPackage);
92 93
  app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/\-\/(@[\w\-\.]+\/[\w\-\.]+)$/, limit, downloadPackage);
94 +
  app.get(/^\/(@[\w\-\.]+\/[\w\-\.]+)\/\-\/([\w\-\.]+)$/, limit, downloadPackage);
93 95
  app.get('/:name/-/:filename', limit, downloadPackage);
94 96
95 97
  // delete tarball and remove one version

@@ -18,6 +18,14 @@
Loading
18 18
module.exports = function* download(next) {
19 19
  var name = this.params.name || this.params[0];
20 20
  var filename = this.params.filename || this.params[1];
21 +
  // scope pkg and download with out scope
22 +
  if (name.startsWith('@') && !filename.startsWith('@')) {
23 +
    var scope = name.slice(0, name.indexOf('/'));
24 +
    // fix filename with scope
25 +
    filename = `${scope}/${filename}`;
26 +
  }
27 +
28 +
21 29
  var version = filename.slice(name.length + 1, -4);
22 30
  // can not get dist
23 31
  var url = null;

Learn more Showing 1 files with coverage changes found.

Changes in controllers/sync_module_worker.js
-2
+2
Loading file...
Files Coverage
common 66.67%
controllers -0.06% 85.44%
middleware 94.34%
models 90.42%
routes 100.00%
servers 90.91%
services 90.82%
sync 89.61%
config/index.js 75.51%
lib/common.js 89.19%
Project Totals (97 files) 87.32%
Loading