0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

Merge pull request #78 from josephg/master

Allow tarballs with @ in them
This commit is contained in:
Alex Kocharin 2014-06-18 01:57:34 +04:00
commit 20524118ef
2 changed files with 2 additions and 3 deletions

View file

@ -10,8 +10,7 @@ module.exports.validate_name = function(name) {
if (
name.charAt(0) === '.' || // ".bin", etc.
name.charAt(0) === '-' || // "-" is reserved by couchdb
name.match(/[\/@\s\+%:]/) ||
name !== encodeURIComponent(name) ||
name.match(/[\\\/\s\+%:]/) ||
name === 'node_modules' ||
name === '__proto__' ||
name === 'package.json' ||

View file

@ -5,6 +5,7 @@ describe('Validate', function() {
it('good ones', function() {
assert(validate('sinopia'))
assert(validate('some.weird.package-zzz'))
assert(validate('old-package@0.1.2.tgz'))
})
it('uppercase', function() {
@ -32,7 +33,6 @@ describe('Validate', function() {
})
it('other', function() {
assert(!validate('pkg@'))
assert(!validate('pk g'))
assert(!validate('pk\tg'))
assert(!validate('pk%20g'))