zavadil-ts-common 1.2.53 → 1.2.54

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.53",
3
+ "version": "1.2.54",
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,6 +1,6 @@
1
1
  export class StringUtil {
2
2
 
3
- static toString(s: any) {
3
+ static toString(s: any): string {
4
4
  return typeof s === 'string' ? s : s?.toString?.() ?? '';
5
5
  }
6
6
 
@@ -9,7 +9,7 @@ export class StringUtil {
9
9
  return str.length === 0;
10
10
  }
11
11
 
12
- static notEmpty(str: string | null | undefined): boolean {
12
+ static notEmpty(str: string | null | undefined): str is string {
13
13
  return !StringUtil.isEmpty(str);
14
14
  }
15
15
 
@@ -17,7 +17,7 @@ export class StringUtil {
17
17
  return StringUtil.isEmpty(StringUtil.safeTrim(str));
18
18
  }
19
19
 
20
- static notBlank(str: string | null | undefined): boolean {
20
+ static notBlank(str: string | null | undefined): str is string {
21
21
  return !StringUtil.isBlank(str);
22
22
  }
23
23