Comparing version 1.0.9 to 1.0.10
@@ -43,3 +43,3 @@ { | ||
], | ||
"version": "1.0.9" | ||
"version": "1.0.10" | ||
} |
/** | ||
* build-url - A small library that builds a URL given it's components | ||
* @version v1.0.9 | ||
* build-url - A small library that builds a URL given its components | ||
* @version v1.0.10 | ||
* @link https://github.com/steverydz/build-url#readme | ||
@@ -29,3 +29,7 @@ * @license MIT | ||
if (options.path) { | ||
builtUrl += '/' + options.path; | ||
if (options.path.indexOf('/') === 0) { | ||
builtUrl += options.path; | ||
} else { | ||
builtUrl += '/' + options.path; | ||
} | ||
} | ||
@@ -32,0 +36,0 @@ |
/** | ||
* build-url - A small library that builds a URL given it's components | ||
* @version v1.0.9 | ||
* build-url - A small library that builds a URL given its components | ||
* @version v1.0.10 | ||
* @link https://github.com/steverydz/build-url#readme | ||
* @license MIT | ||
*/ | ||
(function(){"use strict";var r=this,e=r.buildUrl,t=function(r,e){var t,u,o=[];if(null===r?u="":"object"==typeof r?(u="",e=r):u=r,e){if(e.path&&(u+="/"+e.path),e.queryParams){for(t in e.queryParams)e.queryParams.hasOwnProperty(t)&&o.push(t+"="+e.queryParams[t]);u+="?"+o.join("&")}e.hash&&(u+="#"+e.hash)}return u};t.noConflict=function(){return r.buildUrl=e,t},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.buildUrl=t):r.buildUrl=t}).call(this); | ||
(function(){"use strict";var r=this,e=r.buildUrl,t=function(r,e){var t,u,o=[];if(null===r?u="":"object"==typeof r?(u="",e=r):u=r,e){if(e.path&&(u+=0===e.path.indexOf("/")?e.path:"/"+e.path),e.queryParams){for(t in e.queryParams)e.queryParams.hasOwnProperty(t)&&o.push(t+"="+e.queryParams[t]);u+="?"+o.join("&")}e.hash&&(u+="#"+e.hash)}return u};t.noConflict=function(){return r.buildUrl=e,t},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.buildUrl=t):r.buildUrl=t}).call(this); |
{ | ||
"name": "build-url", | ||
"version": "1.0.9", | ||
"description": "A small library that builds a URL given it's components", | ||
"version": "1.0.10", | ||
"description": "A small library that builds a URL given its components", | ||
"main": "./dist/build-url.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -22,2 +22,8 @@ describe('buildUrl', function () { | ||
it('should append a path when passed an option with a leading "/"', function() { | ||
expect(buildUrl('http://example.com', { | ||
path: '/about/me' | ||
})).toEqual('http://example.com/about/me'); | ||
}); | ||
it('should append a query string when passed as an option', function () { | ||
@@ -24,0 +30,0 @@ expect(buildUrl('http://example.com', { |
@@ -23,3 +23,7 @@ ;(function () { | ||
if (options.path) { | ||
builtUrl += '/' + options.path; | ||
if (options.path.indexOf('/') === 0) { | ||
builtUrl += options.path; | ||
} else { | ||
builtUrl += '/' + options.path; | ||
} | ||
} | ||
@@ -26,0 +30,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14832
360