+/**
+ * Return a set containing non-shared items between two sets.
+ * @param {Set} a set a
+ * @param {Set} b set b
+ * @returns {Set} set difference
+ */
+const setSymmetricDifference = (a, b) => {
+ const d = new Set(a);
+ for (const x of b) {
+ if (d.has(x)) {
+ d.delete(x);
+ } else {
+ d.add(x);
+ }
+ }
+ return d;
+};
+
+
+/**
+ * URL objects have weird names.
+ * @param {string} component url component name
+ * @returns {string} translated url component name
+ */
+const properURLComponentName = (component) => {
+ // eslint-disable-next-line security/detect-object-injection
+ return {
+ hash: 'fragment',
+ protocol: 'scheme',
+ }[component] || component;
+};
+
+