From 3e40faaaa3b88d73132d99d4ebd1b990c480b003 Mon Sep 17 00:00:00 2001 From: badosz0 Date: Thu, 29 Feb 2024 01:17:11 +0100 Subject: [PATCH] feat: jsr support --- jsr.json | 5 +++++ src/index.ts | 2 +- src/time.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 jsr.json diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..0146f46 --- /dev/null +++ b/jsr.json @@ -0,0 +1,5 @@ +{ + "name": "@badosz/holy-time", + "version": "3.4.5", + "exports": "./src/index.ts" +} diff --git a/src/index.ts b/src/index.ts index 45a2e43..7ef0aae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export { TimeZone } from './constants'; +export type { TimeZone } from './constants'; export { HolyTime as default } from './time'; export type { TimeResolvable, HumanUnit, IntervalUnit } from './types'; diff --git a/src/time.ts b/src/time.ts index 3c2a6a1..9050ad8 100644 --- a/src/time.ts +++ b/src/time.ts @@ -26,7 +26,7 @@ export class HolyTime { return date; } - timeZone = TIMEZONE_MAP[timeZone] ?? timeZone; + timeZone = TIMEZONE_MAP[timeZone as keyof typeof TIMEZONE_MAP] ?? timeZone; return new Date(date.toLocaleString('en-US', { timeZone })); }