mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-05 04:57:54 +00:00
17 lines
362 B
JavaScript
17 lines
362 B
JavaScript
// adapted from https://gist.github.com/jed/964849
|
|
const fn = (function (anchor) {
|
|
return function (url) {
|
|
anchor.href = url;
|
|
const parts = {};
|
|
for (const prop in anchor) {
|
|
if ('' + anchor[prop] === anchor[prop]) {
|
|
parts[prop] = anchor[prop];
|
|
}
|
|
}
|
|
|
|
return parts;
|
|
};
|
|
})(document.createElement('a'));
|
|
|
|
export default fn;
|