zavadil-ts-common 1.2.70 → 1.2.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,5 @@ export default class UrlUtil {
2
2
  static deleteParamFromUrl(url: string, paramName: string): string;
3
3
  static extractParamFromUrl(url: string, name: string): string | null;
4
4
  static paramExistsInUrl(url: string, name: string): boolean;
5
+ static extractHostFromUrl(url: string): string | null;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-ts-common",
3
- "version": "1.2.70",
3
+ "version": "1.2.71",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -16,4 +16,9 @@ export default class UrlUtil {
16
16
  static paramExistsInUrl(url: string, name: string): boolean {
17
17
  return StringUtil.notBlank(UrlUtil.extractParamFromUrl(url, name));
18
18
  }
19
+ static extractHostFromUrl(url: string): string | null {
20
+ if (StringUtil.isBlank(url)) return null;
21
+ return new URL(url).host;
22
+ }
23
+
19
24
  }