From 40ed1ecb709857b016115d38158a057563ce2f6e Mon Sep 17 00:00:00 2001 From: Hari Acharya Date: Sat, 21 Mar 2026 19:40:12 +0545 Subject: [PATCH] fix: not a constructor issue fixed. --- src/nepali-date-converter.ts | 10 +++++++++- tsconfig.json | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nepali-date-converter.ts b/src/nepali-date-converter.ts index de97e01..be657a5 100644 --- a/src/nepali-date-converter.ts +++ b/src/nepali-date-converter.ts @@ -19,7 +19,7 @@ const setAdBs = Symbol('setADBS()') const setDayYearMonth = Symbol('setDayYearMonth()') export * from './date-config' -export default class NepaliDate { +export class NepaliDate { private [jsDateSymbol]: Date private [yearSymbol]: number private [dateSymbol]: number @@ -418,3 +418,11 @@ export default class NepaliDate { return this.format('ddd DD, MMMM YYYY') } } + +if (typeof module !== 'undefined' && module.exports) { + module.exports = NepaliDate; + module.exports.default = NepaliDate; + module.exports.NepaliDate = NepaliDate; +} + +export default NepaliDate; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 07ed651..53d4bc9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "module":"es2015", "lib": ["es2015", "es2016", "es2017", "dom"], "strict": true, + "esModuleInterop": true, "sourceMap": true, "declaration": true, "allowSyntheticDefaultImports": true,