Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arcteryx/js-url

Package Overview
Dependencies
Maintainers
3
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcteryx/js-url - npm Package Compare versions

Comparing version 1.28.0 to 1.28.1-alpha.0

src/index.ts

28

dist/cjs/index.js

@@ -27,2 +27,3 @@ 'use strict';

}
if (endsWith(newModel, "-W")) {

@@ -33,4 +34,6 @@ newModel = newModel.substr(0, newModel.lastIndexOf("-W"));

}
return newModel;
}
function querySt(ji, or) {

@@ -41,4 +44,6 @@ let hu = or ? or : window.location.search.substring(1),

i;
for (i = 0; i < gy.length; i++) {
ft = gy[i].split("=");
if (ft[0].toLowerCase() === ji.toLowerCase()) {

@@ -50,5 +55,7 @@ return ft[1];

}
function removeQueryStringParameter(url, key) {
let newUrl = url,
urlparts = url.split("?");
if (urlparts.length >= 2) {

@@ -59,3 +66,3 @@ const prefix = `${encodeURIComponent(key)}=`;

// Reverse iteration as may be destructive
for (let i = pars.length; i-- > 0;) {
for (let i = pars.length; i-- > 0; ) {
// Idiom for string.startsWith

@@ -66,5 +73,7 @@ if (pars[i].lastIndexOf(prefix, 0) !== -1) {

}
newUrl = urlparts[0] + (pars.length > 0 ? `?${pars.join("&")}` : "");
return newUrl;
}
return newUrl;

@@ -81,13 +90,17 @@ }

function toQueryParams(obj) {
const url = Object.keys(obj).map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
}).join("&");
const url = Object.keys(obj)
.map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
})
.join("&");
return url;
}
function updateQueryStringParameter(uri, key, value) {
const re = new RegExp(`([?&])${key}=.*?(&|$)`, "i");
const separator = uri.indexOf("?") > -1 ? "&" : "?";
if (uri.match(re)) {

@@ -102,2 +115,3 @@ return uri.replace(re, `$1${key}=${value}$2`);

}
return `${uri + separator + key}=${value}`;

@@ -104,0 +118,0 @@ }

@@ -23,2 +23,3 @@ /**

}
if (endsWith(newModel, "-W")) {

@@ -29,4 +30,6 @@ newModel = newModel.substr(0, newModel.lastIndexOf("-W"));

}
return newModel;
}
function querySt(ji, or) {

@@ -37,4 +40,6 @@ let hu = or ? or : window.location.search.substring(1),

i;
for (i = 0; i < gy.length; i++) {
ft = gy[i].split("=");
if (ft[0].toLowerCase() === ji.toLowerCase()) {

@@ -46,5 +51,7 @@ return ft[1];

}
function removeQueryStringParameter(url, key) {
let newUrl = url,
urlparts = url.split("?");
if (urlparts.length >= 2) {

@@ -55,3 +62,3 @@ const prefix = `${encodeURIComponent(key)}=`;

// Reverse iteration as may be destructive
for (let i = pars.length; i-- > 0;) {
for (let i = pars.length; i-- > 0; ) {
// Idiom for string.startsWith

@@ -62,5 +69,7 @@ if (pars[i].lastIndexOf(prefix, 0) !== -1) {

}
newUrl = urlparts[0] + (pars.length > 0 ? `?${pars.join("&")}` : "");
return newUrl;
}
return newUrl;

@@ -77,13 +86,17 @@ }

function toQueryParams(obj) {
const url = Object.keys(obj).map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
}).join("&");
const url = Object.keys(obj)
.map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
})
.join("&");
return url;
}
function updateQueryStringParameter(uri, key, value) {
const re = new RegExp(`([?&])${key}=.*?(&|$)`, "i");
const separator = uri.indexOf("?") > -1 ? "&" : "?";
if (uri.match(re)) {

@@ -98,2 +111,3 @@ return uri.replace(re, `$1${key}=${value}$2`);

}
return `${uri + separator + key}=${value}`;

@@ -100,0 +114,0 @@ }

@@ -34,2 +34,3 @@ (function (global, factory) {

}
if (endsWith(newModel, "-W")) {

@@ -40,4 +41,6 @@ newModel = newModel.substr(0, newModel.lastIndexOf("-W"));

}
return newModel;
}
function querySt(ji, or) {

@@ -48,4 +51,6 @@ let hu = or ? or : window.location.search.substring(1),

i;
for (i = 0; i < gy.length; i++) {
ft = gy[i].split("=");
if (ft[0].toLowerCase() === ji.toLowerCase()) {

@@ -57,5 +62,7 @@ return ft[1];

}
function removeQueryStringParameter(url, key) {
let newUrl = url,
urlparts = url.split("?");
if (urlparts.length >= 2) {

@@ -66,3 +73,3 @@ const prefix = `${encodeURIComponent(key)}=`;

// Reverse iteration as may be destructive
for (let i = pars.length; i-- > 0;) {
for (let i = pars.length; i-- > 0; ) {
// Idiom for string.startsWith

@@ -73,5 +80,7 @@ if (pars[i].lastIndexOf(prefix, 0) !== -1) {

}
newUrl = urlparts[0] + (pars.length > 0 ? `?${pars.join("&")}` : "");
return newUrl;
}
return newUrl;

@@ -88,13 +97,17 @@ }

function toQueryParams(obj) {
const url = Object.keys(obj).map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
}).join("&");
const url = Object.keys(obj)
.map(x => {
if (Array.isArray(obj[x])) {
return obj[x].map(i => `${encodeURIComponent(x)}=${encodeURIComponent(i)}`).join("&");
}
return `${encodeURIComponent(x)}=${encodeURIComponent(obj[x])}`;
})
.join("&");
return url;
}
function updateQueryStringParameter(uri, key, value) {
const re = new RegExp(`([?&])${key}=.*?(&|$)`, "i");
const separator = uri.indexOf("?") > -1 ? "&" : "?";
if (uri.match(re)) {

@@ -109,2 +122,3 @@ return uri.replace(re, `$1${key}=${value}$2`);

}
return `${uri + separator + key}=${value}`;

@@ -111,0 +125,0 @@ }

{
"name": "@arcteryx/js-url",
"version": "1.28.0",
"version": "1.28.1-alpha.0",
"source": "src/index.js",

@@ -13,3 +13,3 @@ "main": "dist/cjs/index.js",

"license": "ISC",
"gitHead": "ec3795a7d5bb844c4d9931d9f32cf1416d09e081",
"gitHead": "4f15ba8d5658656d9258fed37b749d2bfe63a9a2",
"files": [

@@ -16,0 +16,0 @@ "dist",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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