ortoni-report 4.0.3 → 4.0.5

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.
@@ -4,7 +4,7 @@ export declare function safeStringify(obj: any, indent?: number): string;
4
4
  export declare function ensureHtmlExtension(filename: string): string;
5
5
  export declare function escapeHtml(unsafe: string): string;
6
6
  export declare function formatDateUTC(date: Date): string;
7
- export declare function formatDateLocal(dateInput: Date | string): string;
7
+ export declare function formatDateLocal(dateInput: Date | string | undefined | null): string;
8
8
  export declare function formatDateNoTimezone(isoString: string): string;
9
9
  type SuiteAndTitle = {
10
10
  hierarchy: string;
@@ -52,17 +52,26 @@ export function formatDateUTC(date) {
52
52
  return date.toISOString();
53
53
  }
54
54
  export function formatDateLocal(dateInput) {
55
- const date = typeof dateInput === "string" ? new Date(dateInput) : dateInput;
56
- const options = {
57
- year: "numeric",
58
- month: "short",
59
- day: "2-digit",
60
- hour: "2-digit",
61
- minute: "2-digit",
62
- hour12: true,
63
- timeZoneName: "short", // or "Asia/Kolkata"
64
- };
65
- return new Intl.DateTimeFormat(undefined, options).format(date);
55
+ if (!dateInput)
56
+ return "N/A";
57
+ try {
58
+ const date = typeof dateInput === "string" ? new Date(dateInput) : dateInput;
59
+ if (isNaN(date.getTime())) {
60
+ return "N/A";
61
+ }
62
+ const options = {
63
+ year: "numeric",
64
+ month: "short",
65
+ day: "2-digit",
66
+ hour: "2-digit",
67
+ minute: "2-digit",
68
+ hour12: true,
69
+ };
70
+ return new Intl.DateTimeFormat("en-US", options).format(date);
71
+ }
72
+ catch (e) {
73
+ return "N/A";
74
+ }
66
75
  }
67
76
  export function formatDateNoTimezone(isoString) {
68
77
  const date = new Date(isoString);
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "ortoni-report",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "Playwright Report By LetCode with Koushik",
5
5
  "scripts": {
6
6
  "tsc": "tsc",
7
7
  "build": "tsup",
8
- "release": "npm publish"
8
+ "release": "npm publish",
9
+ "pack": "npm pack && node ./copy-build.mjs"
9
10
  },
10
11
  "bin": {
11
12
  "ortoni-report": "./dist/cli.js"
@@ -44,10 +45,10 @@
44
45
  "typescript": "^4.9.4"
45
46
  },
46
47
  "peerDependencies": {
47
- "@playwright/test": "^1.54.0",
48
+ "@playwright/test": "^1.58.0",
48
49
  "ansi-to-html": "^0.7.2",
49
50
  "commander": "^12.1.0",
50
- "express": "^4.21.1",
51
+ "express": "^4.22.0",
51
52
  "sqlite": "^5.1.1",
52
53
  "sqlite3": "^5.1.7"
53
54
  },
package/readme.md CHANGED
@@ -63,7 +63,7 @@ A comprehensive and visually appealing HTML report generator tailored for Playwr
63
63
  - **Meta Information**: Add custom user or environment metadata to reports.
64
64
  - **CLI**: Open the reporter anytime using the built-in CLI
65
65
  - **Open Markdown**: View markdown - Copy and use it in your AI prompt
66
- - **Supports GitHub Actions** - [Refer the project for example](https://github.com/ortoniKC/pw-test)
66
+ - **Supports CI/CD** - [Sample Jenkinsfile](Jenkinsfile.sample) | [Refer the project for GitHub Actions](https://github.com/ortoniKC/pw-test)
67
67
 
68
68
  ---
69
69