sm-utility 2.1.4 → 2.1.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.
package/excel/enums.d.ts CHANGED
@@ -3,7 +3,8 @@ export declare const enum ExcelFormat {
3
3
  PERCENTAGE = "0%",
4
4
  MONEY = "R$ 0.00",
5
5
  ZERO_DEFAULT = "0",
6
- NUMBER = "123"
6
+ NUMBER = "123",
7
+ FULL_DATE = "dd - mm - yyyy"
7
8
  }
8
9
  export declare const enum ExcelType {
9
10
  OPTIONS = "options"
@@ -30,6 +30,13 @@ class ExcelCreatorCustomizer {
30
30
  const year = date.getFullYear();
31
31
  return `${month} - ${year}`;
32
32
  }
33
+ case "dd - mm - yyyy" /* FULL_DATE */: {
34
+ const date = new Date(value);
35
+ const day = date.getDate().toString().padStart(2, '0');
36
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
37
+ const year = date.getFullYear();
38
+ return `${day} - ${month} - ${year}`;
39
+ }
33
40
  case "R$ 0.00" /* MONEY */:
34
41
  return parseFloat(value).toLocaleString("pt-BR", {
35
42
  style: "currency",
@@ -39,6 +46,8 @@ class ExcelCreatorCustomizer {
39
46
  return `${value}%`;
40
47
  case "0" /* ZERO_DEFAULT */:
41
48
  return (_a = value.toString()) !== null && _a !== void 0 ? _a : "0";
49
+ default:
50
+ return value;
42
51
  }
43
52
  }
44
53
  }
package/index.js CHANGED
@@ -19,3 +19,4 @@ __exportStar(require("./infrastructure"), exports);
19
19
  __exportStar(require("./logger"), exports);
20
20
  __exportStar(require("./request"), exports);
21
21
  __exportStar(require("./stubs"), exports);
22
+ __exportStar(require("./excel"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sm-utility",
3
- "version": "2.1.4",
3
+ "version": "2.1.7",
4
4
  "description": "reusable utility codes for sm projects",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",