cloud-url-resolver
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -42,4 +42,11 @@ const inBrowser = typeof window !== "undefined"; | ||
} | ||
return `${resolvedProtocol}://localhost:${port}`; | ||
let hostname; | ||
if (!origin) { | ||
hostname = "localhost"; | ||
} else { | ||
const url = new URL(origin); | ||
hostname = url.hostname; | ||
} | ||
return `${resolvedProtocol}://${hostname}:${port}`; | ||
} | ||
// # sourceMappingURL=index.js.map |
{ | ||
"name": "cloud-url-resolver", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Allow changing the port and protocol of any common development url", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -19,5 +19,5 @@ # cloud-url-resolver | ||
```ts | ||
import { resolve } from "cloud-url-resolver"; | ||
import { transform } from "cloud-url-resolver"; | ||
transform(3000, "http"); // returns "http://localhost:3000" if on localhost; otherwise, returns the transformed for the current platform | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7370
65