A collection of utilities to manipulate URLs
Install the module
npm install @wordpress/url --save
import { addQueryArgs, prependHTTP } from '@wordpress/url';
// Appends arguments to the query string of a given url
const newUrl = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test
// Prepends 'http:https://' to URLs that are probably mean to have them
const actualUrl = prependHTTP( 'wordpress.org' ); // http:https://wordpress.org