zavadil-ts-common 1.2.68 → 1.2.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-ts-common",
3
- "version": "1.2.68",
3
+ "version": "1.2.69",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,3 +1,5 @@
1
+ import {ObjectUtil} from "./ObjectUtil";
2
+
1
3
  export class StringUtil {
2
4
 
3
5
  static toString(s: any): string {
@@ -5,7 +7,7 @@ export class StringUtil {
5
7
  }
6
8
 
7
9
  static isEmpty(str: string | null | undefined): str is null | undefined {
8
- if (typeof str !== 'string') return StringUtil.isEmpty(StringUtil.toString(str));
10
+ if (ObjectUtil.isEmpty(str)) return true;
9
11
  return str.length === 0;
10
12
  }
11
13
 
@@ -70,7 +72,7 @@ export class StringUtil {
70
72
  }
71
73
 
72
74
  static safeTrim(str: string | null | undefined): string {
73
- if (StringUtil.isEmpty(str) || !str) return '';
75
+ if (StringUtil.isEmpty(str)) return '';
74
76
  return str.trim();
75
77
  }
76
78