zavadil-ts-common 1.2.70 → 1.2.72
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.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/util/UrlUtil.d.ts +1 -0
- package/package.json +1 -1
- package/src/util/UrlUtil.ts +6 -1
- package/src/util/index.ts +1 -0
package/dist/util/UrlUtil.d.ts
CHANGED
@@ -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
package/src/util/UrlUtil.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import {StringUtil} from "./StringUtil";
|
2
2
|
|
3
|
-
export
|
3
|
+
export class UrlUtil {
|
4
4
|
|
5
5
|
static deleteParamFromUrl(url: string, paramName: string): string {
|
6
6
|
const urlObj = new URL(url);
|
@@ -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
|
}
|
package/src/util/index.ts
CHANGED