Clone a WHATWG
URL
instance.
This module's browser version contains no URL
shim.
Node.js >= 6
is required. To install, type this at the command line:
npm install cloneurl
const cloneURL = require('cloneurl');
const b = cloneURL(a);
console.log(b === a);
//-> false
console.log(b.href === a.href);
//-> true