asv-hlps 1.2.95 → 1.2.96

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/lib/cjs/utils.js CHANGED
@@ -345,10 +345,10 @@ const getPeriodDateColor = (inputDate, period = 30, colors) => {
345
345
  const today = (0, dayjs_1.default)(new Date());
346
346
  const expDate = new Date(inputDate);
347
347
  const diff = (0, dayjs_1.default)(expDate).diff(today, "day");
348
- if (colors.length >= 4) {
348
+ if ((colors === null || colors === void 0 ? void 0 : colors.length) >= 4) {
349
349
  if (diff <= month0) {
350
350
  // return "dark";
351
- return colors.length >= 6 ? colors[4] : "danger";
351
+ return (colors === null || colors === void 0 ? void 0 : colors.length) >= 6 ? colors[4] : "danger";
352
352
  }
353
353
  if (diff <= month3) {
354
354
  return colors[0];
@@ -363,7 +363,7 @@ const getPeriodDateColor = (inputDate, period = 30, colors) => {
363
363
  return colors[3];
364
364
  }
365
365
  if (diff > month12) {
366
- return colors.length >= 5 ? colors[4] : "info";
366
+ return (colors === null || colors === void 0 ? void 0 : colors.length) >= 5 ? colors[4] : "info";
367
367
  }
368
368
  }
369
369
  if (diff <= month0) {
package/lib/esm/utils.js CHANGED
@@ -293,10 +293,10 @@ export const getPeriodDateColor = (inputDate, period = 30, colors) => {
293
293
  const today = dayjs(new Date());
294
294
  const expDate = new Date(inputDate);
295
295
  const diff = dayjs(expDate).diff(today, "day");
296
- if (colors.length >= 4) {
296
+ if ((colors === null || colors === void 0 ? void 0 : colors.length) >= 4) {
297
297
  if (diff <= month0) {
298
298
  // return "dark";
299
- return colors.length >= 6 ? colors[4] : "danger";
299
+ return (colors === null || colors === void 0 ? void 0 : colors.length) >= 6 ? colors[4] : "danger";
300
300
  }
301
301
  if (diff <= month3) {
302
302
  return colors[0];
@@ -311,7 +311,7 @@ export const getPeriodDateColor = (inputDate, period = 30, colors) => {
311
311
  return colors[3];
312
312
  }
313
313
  if (diff > month12) {
314
- return colors.length >= 5 ? colors[4] : "info";
314
+ return (colors === null || colors === void 0 ? void 0 : colors.length) >= 5 ? colors[4] : "info";
315
315
  }
316
316
  }
317
317
  if (diff <= month0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.2.95",
3
+ "version": "1.2.96",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",