zavadil-ts-common 1.2.66 → 1.2.67

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.
@@ -1,5 +1,6 @@
1
1
  import { ObjectUtil } from "./ObjectUtil";
2
2
  export declare class NumberUtil extends ObjectUtil {
3
+ static notEmpty(n?: number | null): n is number;
3
4
  static parseNumber(str: string | null | undefined): number | null;
4
5
  static round(n: number, d?: number): number;
5
6
  static portionToPercent(p: number, d?: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-ts-common",
3
- "version": "1.2.66",
3
+ "version": "1.2.67",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -2,6 +2,10 @@ import { ObjectUtil } from "./ObjectUtil";
2
2
 
3
3
  export class NumberUtil extends ObjectUtil {
4
4
 
5
+ static notEmpty(n?: number | null): n is number {
6
+ return !ObjectUtil.isEmpty(n);
7
+ }
8
+
5
9
  static parseNumber(str: string | null | undefined): number | null {
6
10
  if (!str) return null;
7
11
  const n = Number(str);