mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Fix target not being added if source does not look like a source.
This commit is contained in:
@@ -92,9 +92,9 @@ function decomposed2json(decEndpoint) {
|
||||
// If value is empty, we append the target always
|
||||
if (!value) {
|
||||
value += isWildcard(target) ? '*' : target;
|
||||
// Otherwise append only if not a wildcard
|
||||
} else if (!isWildcard(target)) {
|
||||
value += '#' + target;
|
||||
// Otherwise append only if not a wildcard or source does not look like a source
|
||||
} else if (!isWildcard(target) || !isSource(source)) {
|
||||
value += '#' + (target || '*');
|
||||
}
|
||||
|
||||
ret[name] = value;
|
||||
|
||||
@@ -181,6 +181,8 @@ describe('endpoint-parser', function () {
|
||||
{ bar: '*' },
|
||||
{ baz: '*' },
|
||||
{ jqueryx: 'jquery#~1.9.1' },
|
||||
{ jqueryy: 'jquery-x#*' },
|
||||
{ jqueryy: 'jquery-x#*' },
|
||||
{ backbone: 'backbone-amd#~1.0.0' },
|
||||
{ backbone : 'backbone=backbone-amd#~1.0.0' },
|
||||
{ bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' },
|
||||
@@ -196,6 +198,8 @@ describe('endpoint-parser', function () {
|
||||
{ name: 'bar', source: 'bar', target: '*' },
|
||||
{ name: 'baz', source: 'baz', target: '' },
|
||||
{ name: 'jqueryx', source: 'jquery', target: '~1.9.1' },
|
||||
{ name: 'jqueryy', source: 'jquery-x', target: '' },
|
||||
{ name: 'jqueryy', source: 'jquery-x', target: '*' },
|
||||
{ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' },
|
||||
{ name: 'backbone', source: 'backbone=backbone-amd', target: '~1.0.0' },
|
||||
{ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '' },
|
||||
@@ -218,6 +222,8 @@ describe('endpoint-parser', function () {
|
||||
{ name: 'bar', source: 'bar ', target: ' * ' },
|
||||
{ name: 'baz ', source: 'baz', target: ' ' },
|
||||
{ name: ' jqueryx ', source: ' jquery ', target: ' ~1.9.1 ' },
|
||||
{ name: ' jqueryy ', source: ' jquery-x ', target: ' ' },
|
||||
{ name: ' jqueryy ', source: ' jquery-x ', target: ' * ' },
|
||||
{ name: ' backbone ', source: ' backbone-amd ', target: ' ~1.0.0 ' },
|
||||
{ name: ' backbone ', source: ' backbone=backbone-amd ', target: ' ~1.0.0 ' },
|
||||
{ name: ' bootstrap ', source: ' http://twitter.github.io/bootstrap/assets/bootstrap ', target: ' ' },
|
||||
|
||||
Reference in New Issue
Block a user