ismx-nexo-node-app 0.4.143 → 0.4.144

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.
@@ -94,6 +94,8 @@ class ColorUtils {
94
94
  return color + alphaHex;
95
95
  }
96
96
  static isColor(color) {
97
+ if (!color || typeof color !== 'string')
98
+ return false;
97
99
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
98
100
  }
99
101
  }
@@ -7,7 +7,7 @@ class NumberUtils {
7
7
  static duration(seconds) {
8
8
  if (seconds == null)
9
9
  return null;
10
- const truncated = Math.trunc(seconds);
10
+ const truncated = Math.trunc(seconds + 1);
11
11
  const mins = Math.floor(truncated / 60);
12
12
  const secs = truncated % 60;
13
13
  const minsStr = mins.toString().padStart(2, '0');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.143",
3
+ "version": "0.4.144",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -87,6 +87,7 @@ export default abstract class ColorUtils {
87
87
  }
88
88
 
89
89
  static isColor(color: string): boolean {
90
+ if (!color || typeof color !== 'string') return false;
90
91
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
91
92
  }
92
93
  }
@@ -8,7 +8,7 @@ export default abstract class NumberUtils {
8
8
  static duration(seconds: null | undefined): null;
9
9
  static duration(seconds: number | null | undefined): string | null {
10
10
  if (seconds == null) return null;
11
- const truncated = Math.trunc(seconds);
11
+ const truncated = Math.trunc(seconds+1);
12
12
  const mins = Math.floor(truncated / 60);
13
13
  const secs = truncated % 60;
14
14
  const minsStr = mins.toString().padStart(2, '0');