Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / uri-js / dist / esnext / schemes / http.js
index a280369881c13069354326abc0a404605a444abd..6abf0fe6e3f1f897c2066285f25476e4152712f4 100644 (file)
@@ -1,27 +1,28 @@
-const handler = {\r
-    scheme: "http",\r
-    domainHost: true,\r
-    parse: function (components, options) {\r
-        //report missing host\r
-        if (!components.host) {\r
-            components.error = components.error || "HTTP URIs must have a host.";\r
-        }\r
-        return components;\r
-    },\r
-    serialize: function (components, options) {\r
-        //normalize the default port\r
-        if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") {\r
-            components.port = undefined;\r
-        }\r
-        //normalize the empty path\r
-        if (!components.path) {\r
-            components.path = "/";\r
-        }\r
-        //NOTE: We do not parse query strings for HTTP URIs\r
-        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,\r
-        //and not the HTTP spec.\r
-        return components;\r
-    }\r
-};\r
-export default handler;\r
+const handler = {
+    scheme: "http",
+    domainHost: true,
+    parse: function (components, options) {
+        //report missing host
+        if (!components.host) {
+            components.error = components.error || "HTTP URIs must have a host.";
+        }
+        return components;
+    },
+    serialize: function (components, options) {
+        const secure = String(components.scheme).toLowerCase() === "https";
+        //normalize the default port
+        if (components.port === (secure ? 443 : 80) || components.port === "") {
+            components.port = undefined;
+        }
+        //normalize the empty path
+        if (!components.path) {
+            components.path = "/";
+        }
+        //NOTE: We do not parse query strings for HTTP URIs
+        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
+        //and not the HTTP spec.
+        return components;
+    }
+};
+export default handler;
 //# sourceMappingURL=http.js.map
\ No newline at end of file