ggez-banking-sdk 0.1.23 → 0.1.24

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,13 +1,21 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.GenerateSourceID = GenerateSourceID;
7
- const dayjs_1 = __importDefault(require("dayjs"));
8
4
  function GenerateSourceID() {
9
5
  const now = new Date();
10
- const timestamp = `${(0, dayjs_1.default)(now).format("DDMMYYYY")}.${(0, dayjs_1.default)(now).format("HHmmss")}.${(0, dayjs_1.default)(now).format("SSS")}`;
6
+ // Helper function to format numbers as two digits
7
+ const pad = (number) => String(number).padStart(2, "0");
8
+ // Helper function to format milliseconds as three digits
9
+ const padMilliseconds = (number) => String(number).padStart(3, "0");
10
+ // Format date and time components
11
+ const day = pad(now.getDate());
12
+ const month = pad(now.getMonth() + 1); // Months are zero-based
13
+ const year = now.getFullYear();
14
+ const hours = pad(now.getHours());
15
+ const minutes = pad(now.getMinutes());
16
+ const seconds = pad(now.getSeconds());
17
+ const milliseconds = padMilliseconds(now.getMilliseconds());
18
+ const timestamp = `${day}${month}${year}.${hours}${minutes}${seconds}.${milliseconds}`;
11
19
  const userId = localStorage.getItem("user_id") ?? "0";
12
20
  const source_id = `U.${userId}.${timestamp}`;
13
21
  return source_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",