Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Do a client side check before uploaded rejecting packages ending in .js #103

Closed
wants to merge 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/settings.js
View
4 lib/settings.js
@@ -31,6 +31,10 @@ exports.validate = function (settings, filename) {
'letters and "_", "-" or ".", and must start with a letter'
);
}
+ var bad_suffix = '.js';
+ if (settings.name.indexOf(bad_suffix, settings.name.length - bad_suffix.length) !== -1) {
+ throw new Error('The package name cannot end in .js');
+ }
if (!settings.version) {
throw new Error('Missing version property in ' + filename);
}
Something went wrong with that request. Please try again.