Socket
Socket
Sign inDemoInstall

build-url

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-url - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

bower.json

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc