New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/router

Package Overview
Dependencies
Maintainers
24
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/router - npm Package Compare versions

Comparing version 0.23.0 to 0.24.0

18

build-module/history.js

@@ -9,3 +9,3 @@ /**

*/
import { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';
import { buildQueryString } from '@wordpress/url';
const history = createBrowserHistory();

@@ -15,12 +15,12 @@ const originalHistoryPush = history.push;

function push(params, state) {
const currentArgs = getQueryArgs(window.location.href);
const currentUrlWithoutArgs = removeQueryArgs(window.location.href, ...Object.keys(currentArgs));
const newUrl = addQueryArgs(currentUrlWithoutArgs, params);
return originalHistoryPush.call(history, newUrl, state);
const search = buildQueryString(params);
return originalHistoryPush.call(history, {
search
}, state);
}
function replace(params, state) {
const currentArgs = getQueryArgs(window.location.href);
const currentUrlWithoutArgs = removeQueryArgs(window.location.href, ...Object.keys(currentArgs));
const newUrl = addQueryArgs(currentUrlWithoutArgs, params);
return originalHistoryReplace.call(history, newUrl, state);
const search = buildQueryString(params);
return originalHistoryReplace.call(history, {
search
}, state);
}

@@ -27,0 +27,0 @@ history.push = push;

@@ -21,12 +21,12 @@ "use strict";

function push(params, state) {
const currentArgs = (0, _url.getQueryArgs)(window.location.href);
const currentUrlWithoutArgs = (0, _url.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
const newUrl = (0, _url.addQueryArgs)(currentUrlWithoutArgs, params);
return originalHistoryPush.call(history, newUrl, state);
const search = (0, _url.buildQueryString)(params);
return originalHistoryPush.call(history, {
search
}, state);
}
function replace(params, state) {
const currentArgs = (0, _url.getQueryArgs)(window.location.href);
const currentUrlWithoutArgs = (0, _url.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
const newUrl = (0, _url.addQueryArgs)(currentUrlWithoutArgs, params);
return originalHistoryReplace.call(history, newUrl, state);
const search = (0, _url.buildQueryString)(params);
return originalHistoryReplace.call(history, {
search
}, state);
}

@@ -33,0 +33,0 @@ history.push = push;

@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## 0.24.0 (2024-04-03)
## 0.23.0 (2024-03-21)

@@ -7,0 +9,0 @@

{
"name": "@wordpress/router",
"version": "0.23.0",
"version": "0.24.0",
"description": "Router API for WordPress pages.",

@@ -29,6 +29,6 @@ "author": "The WordPress Contributors",

"@babel/runtime": "^7.16.0",
"@wordpress/element": "^5.31.0",
"@wordpress/private-apis": "^0.36.0",
"@wordpress/url": "^3.55.0",
"history": "^5.1.0"
"@wordpress/element": "^5.32.0",
"@wordpress/private-apis": "^0.37.0",
"@wordpress/url": "^3.56.0",
"history": "^5.3.0"
},

@@ -41,3 +41,3 @@ "peerDependencies": {

},
"gitHead": "ffc07735d0abfb3f69e91d48f25b7fe8d1ef92d2"
"gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
}

@@ -9,3 +9,3 @@ /**

*/
import { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';
import { buildQueryString } from '@wordpress/url';

@@ -18,19 +18,9 @@ const history = createBrowserHistory();

function push( params, state ) {
const currentArgs = getQueryArgs( window.location.href );
const currentUrlWithoutArgs = removeQueryArgs(
window.location.href,
...Object.keys( currentArgs )
);
const newUrl = addQueryArgs( currentUrlWithoutArgs, params );
return originalHistoryPush.call( history, newUrl, state );
const search = buildQueryString( params );
return originalHistoryPush.call( history, { search }, state );
}
function replace( params, state ) {
const currentArgs = getQueryArgs( window.location.href );
const currentUrlWithoutArgs = removeQueryArgs(
window.location.href,
...Object.keys( currentArgs )
);
const newUrl = addQueryArgs( currentUrlWithoutArgs, params );
return originalHistoryReplace.call( history, newUrl, state );
const search = buildQueryString( params );
return originalHistoryReplace.call( history, { search }, state );
}

@@ -37,0 +27,0 @@

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