mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 20:17:59 +00:00
22 lines
440 B
JavaScript
22 lines
440 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
// 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;
|