Files
vault/ui/lib/core/addon/utils/parse-url.js
Hamid Ghaf e55c18ed12 adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

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;