zavadil-ts-common 2.2.5 → 2.2.7

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,14 +2,14 @@ import {HashUtil} from "./HashUtil";
2
2
  import {ObjectUtil} from "./ObjectUtil";
3
3
 
4
4
  export class StringUtil {
5
- static isString(s: any): boolean {
6
- return typeof s === "string";
5
+ static isString(str: any): str is string {
6
+ return typeof str === "string";
7
7
  }
8
8
 
9
9
  static toString(s: any): string {
10
10
  if (StringUtil.isString(s)) return s;
11
- if (StringUtil.isString(s.message)) return s.message; // Errors
12
- return s?.toString?.() ?? "";
11
+ if (StringUtil.isString(s?.message)) return s.message; // Errors
12
+ return StringUtil.getNonEmpty(s);
13
13
  }
14
14
 
15
15
  static isEmpty(str: string | null | undefined): str is null | undefined {
package/src/util/index.ts CHANGED
@@ -5,6 +5,7 @@ export { AsyncUtil } from './AsyncUtil';
5
5
  export { ByteUtil } from './ByteUtil';
6
6
  export { PagingUtil } from './PagingUtil';
7
7
  export { DateUtil } from './DateUtil';
8
+ export { DateUtilCs } from './DateUtilCs';
8
9
  export { NumberUtil } from './NumberUtil';
9
10
  export { JsonUtil } from './JsonUtil';
10
11
  export { HashUtil } from './HashUtil';