diff --git a/docs/api/format.md b/docs/api/format.md index c7be7ea..5a31059 100644 --- a/docs/api/format.md +++ b/docs/api/format.md @@ -134,24 +134,33 @@ For a complete list of all supported locales with import examples, see [Supporte ### timeZone -**Type**: `TimeZone | "UTC"` +**Type**: `TimeZone | string` **Default**: `undefined` (local timezone) -Converts the date to the specified timezone before formatting. +Converts the date to the specified timezone before formatting. You can specify a timezone in three ways: ```typescript import { format } from 'date-and-time'; + +// Method 1: Individual timezone import import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; import New_York from 'date-and-time/timezones/America/New_York'; +// Method 2: Consolidated timezone import +import { Tokyo as TokyoTZ, New_York as NY } from 'date-and-time/timezone'; + const date = new Date(); -// Format in Tokyo timezone +// Using TimeZone object (individual import) format(date, 'YYYY-MM-DD HH:mm:ss [JST]', { timeZone: Tokyo }); // => 2025-08-23 23:30:45 JST -// Format in New York timezone -format(date, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: New_York }); +// Using TimeZone object (consolidated import) +format(date, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: NY }); +// => 2025-08-23 09:30:45 EST + +// Using IANA timezone name string (format only) +format(date, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: 'America/New_York' }); // => 2025-08-23 09:30:45 EST // Format in UTC @@ -314,16 +323,35 @@ format(date, '\\[YYYY-MM-DD HH:mm:ss\\]'); ```typescript import { format } from 'date-and-time'; import ja from 'date-and-time/locales/ja'; + +// Method 1: Individual timezone import import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; +// Method 2: Consolidated timezone import (alternative) +import { Tokyo as TokyoTZ } from 'date-and-time/timezone'; + const date = new Date(); -// Japanese with timezone +// Japanese with timezone (using individual import) format(date, 'YYYY年MMMM月D日dddd Ah:mm:ss [GMT]Z', { timeZone: Tokyo, locale: ja }); // => 2025年8月23日土曜日 午後11:30:45 GMT+0900 + +// Or using consolidated import +format(date, 'YYYY年MMMM月D日dddd Ah:mm:ss [GMT]Z', { + timeZone: TokyoTZ, + locale: ja +}); +// => 2025年8月23日土曜日 午後11:30:45 GMT+0900 + +// Or using IANA timezone name string +format(date, 'YYYY年MMMM月D日dddd Ah:mm:ss [GMT]Z', { + timeZone: 'Asia/Tokyo', + locale: ja +}); +// => 2025年8月23日土曜日 午後11:30:45 GMT+0900 ``` ### Business and Technical Formats @@ -342,7 +370,7 @@ format(date, 'ddd, DD MMM YYYY HH:mm:ss ZZ'); // => Sat, 23 Aug 2025 14:30:45 +09:00 // Log timestamp -format(date, '[YYYY-MM-DD HH:mm:ss.SSS]'); +format(date, '\\[YYYY-MM-DD HH:mm:ss.SSS]\\'); // => [2025-08-23 14:30:45.123] // File naming diff --git a/docs/api/parse.md b/docs/api/parse.md index 976516e..76f519c 100644 --- a/docs/api/parse.md +++ b/docs/api/parse.md @@ -170,6 +170,10 @@ parse('2025-08-23T14:30:00 +05:00', 'YYYY-MM-DD[T]HH:mm:ss ZZ', { timeZone: New_ // => Fri Aug 23 2025 14:30:00 GMT+0500 (New_York timeZone is ignored) ``` +:::warning Important Difference from format() +The `parse()` function only accepts TimeZone objects and the "UTC" string for the `timeZone` option. Unlike `format()`, which supports both TimeZone objects and IANA timezone name strings, `parse()` does not support string type timezone names. +::: + For a complete list of all supported timezones with import examples, see [Supported Timezones](../timezones). ### numeral diff --git a/docs/guide/quick-start.md b/docs/guide/quick-start.md index 3d6eb80..74540bb 100644 --- a/docs/guide/quick-start.md +++ b/docs/guide/quick-start.md @@ -83,23 +83,47 @@ For a complete list of all supported locales with import examples, see [Supporte ```typescript import { format, parse } from 'date-and-time'; + +// Method 1: Individual timezone imports import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; import New_York from 'date-and-time/timezones/America/New_York'; +// Method 2: Consolidated timezone imports (alternative) +import { Los_Angeles, London } from 'date-and-time/timezone'; + const date = new Date(); -// Format in different timezones +// Using TimeZone objects (Method 1 - individual import) format(date, 'YYYY-MM-DD HH:mm:ss [JST]', { timeZone: Tokyo }); // => 2025-08-23 23:30:45 JST -format(date, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: New_York }); +// Using TimeZone objects (Method 2 - consolidated import) +format(date, 'YYYY-MM-DD HH:mm:ss [PST]', { timeZone: Los_Angeles }); +// => 2025-08-23 06:30:45 PST + +// Using IANA timezone name strings (simplest approach) +format(date, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: 'America/New_York' }); // => 2025-08-23 09:30:45 EST // UTC formatting format(date, 'YYYY-MM-DD HH:mm:ss [UTC]', { timeZone: 'UTC' }); // => 2025-08-23 14:30:45 UTC + +// Parsing in timezone (TimeZone objects only) +parse('2025-08-23 23:30:45', 'YYYY-MM-DD HH:mm:ss', { timeZone: Tokyo }); +// => Fri Aug 23 2025 23:30:45 GMT+0900 ``` +### Three Ways to Specify Timezones + +The `format()` function supports three methods for specifying timezones: + +1. **TimeZone objects via individual imports** - Type-safe but requires multiple import statements +2. **TimeZone objects via consolidated imports** - Type-safe with better code organization +3. **IANA timezone name strings** - Simplest approach, no imports needed for timezone modules + +The `parse()` function only supports TimeZone objects and the "UTC" string for timezone specification. + For a complete list of all supported timezones with import examples, see [Supported Timezones](../timezones). ## Date Arithmetic diff --git a/docs/index.md b/docs/index.md index 17ce380..b6133dc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,7 +50,7 @@ features: ```typescript import { format, parse, addDays } from 'date-and-time'; import ja from 'date-and-time/locales/ja'; -import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; +import { Tokyo } from 'date-and-time/timezone'; const now = new Date(); @@ -62,10 +62,14 @@ format(now, 'YYYY/MM/DD HH:mm:ss'); format(now, 'YYYY年M月D日(ddd)', { locale: ja }); // => 2025年8月23日(金) -// Timezone-aware formatting +// Timezone-aware formatting (using TimeZone object) format(now, 'YYYY-MM-DD HH:mm:ss [JST]', { timeZone: Tokyo }); // => 2025-08-23 23:30:45 JST +// Timezone-aware formatting (using IANA timezone name string) +format(now, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: 'America/New_York' }); +// => 2025-08-23 09:30:45 EST + // Parsing const date = parse('2025/08/23 14:30:45', 'YYYY/MM/DD HH:mm:ss'); console.log(date) diff --git a/docs/migration.md b/docs/migration.md index 72c4384..da33e4f 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -37,7 +37,7 @@ format(new Date(), 'ddd, MMM DD YYYY hh:mm A [GMT]Z', { timeZone: 'UTC' }); // => Fri, Jan 02 2015 07:14 AM GMT+0000 ``` -Additionally, since the `timezone` plugin has been integrated into the main library, the `formatTZ` function is now obsolete. Timezones are now imported as modules rather than using `IANA time zone names` (except for UTC timezone). +Additionally, since the `timezone` plugin has been integrated into the main library, the `formatTZ` function is now obsolete. In v4.0/4.1, timezones must be imported as TimeZone objects from timezone modules. IANA timezone name strings are not supported in this version (except for UTC timezone). ```typescript import { format } from 'date-and-time'; @@ -47,6 +47,57 @@ format(now, 'dddd, MMMM D, YYYY [at] H:mm:ss.SSS [GMT]ZZ', { timeZone: New_York // => Wednesday, July 23, 2025 at 3:28:27.443 GMT-04:00 ``` +#### New in v4.2.0: Enhanced Timezone Support + +In addition to TimeZone objects, the `format()` function now supports specifying timezones using IANA timezone name strings. This provides flexibility in how you work with timezones: + +```typescript +import { format } from 'date-and-time'; + +const now = new Date(); + +// Using IANA timezone name string (simplest) +format(now, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: 'America/New_York' }); +// => 2025-08-23 09:30:45 EST + +// Using TimeZone object (recommended for type safety) +import New_York from 'date-and-time/timezones/America/New_York'; +format(now, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: New_York }); +// => 2025-08-23 09:30:45 EST + +// Using consolidated import (recommended for multiple timezones) +import { New_York as NY } from 'date-and-time/timezone'; +format(now, 'YYYY-MM-DD HH:mm:ss [EST]', { timeZone: NY }); +// => 2025-08-23 09:30:45 EST +``` + +**Note**: The `parse()` function does not support string type timezone names. Only TimeZone objects and the "UTC" string are supported for parsing. + +##### Consolidated Import + +For better code organization when working with multiple timezones, you can import all timezones from a single `date-and-time/timezone` module: + +```typescript +// Consolidated import (recommended for multiple timezones) +import { Tokyo, New_York, London, Sydney } from 'date-and-time/timezone'; + +const now = new Date(); + +format(now, 'YYYY-MM-DD HH:mm', { timeZone: Tokyo }); // JST +format(now, 'YYYY-MM-DD HH:mm', { timeZone: New_York }); // EST/EDT +format(now, 'YYYY-MM-DD HH:mm', { timeZone: London }); // GMT/BST +format(now, 'YYYY-MM-DD HH:mm', { timeZone: Sydney }); // AEDT/AEST +``` + +Alternatively, you can still import individual timezone modules directly: + +```typescript +import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; +import New_York from 'date-and-time/timezones/America/New_York'; +import London from 'date-and-time/timezones/Europe/London'; +import Sydney from 'date-and-time/timezones/Australia/Sydney'; +``` + ### parse The third argument has been changed from `boolean` to `ParserOptions`. With `ParserOptions`, you can now specify timezone and locale settings. If you previously set the third argument to `true` to parse input in UTC timezone, you can achieve the same output as follows: diff --git a/docs/timezones.md b/docs/timezones.md index e9a49bc..6ec5fc9 100644 --- a/docs/timezones.md +++ b/docs/timezones.md @@ -1,5 +1,67 @@ # Supported Timezones +## Import Methods + +There are three ways to import and use timezones with the date-and-time library: + +### Method 1: Individual Import + +Import each timezone you need directly from its module path. This approach is useful when you only need a few specific timezones. + +```typescript +import { format } from 'date-and-time'; +import Tokyo from 'date-and-time/timezones/Asia/Tokyo'; +import New_York from 'date-and-time/timezones/America/New_York'; + +const date = new Date(); + +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: Tokyo }); +// => 2025-08-23 23:30:45 + +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: New_York }); +// => 2025-08-23 09:30:45 +``` + +### Method 2: Consolidated Import + +Import multiple timezones from a single module using named imports. This approach is recommended when working with multiple timezones as it provides better code organization. + +```typescript +import { format } from 'date-and-time'; +import { Tokyo, New_York, London, Sydney } from 'date-and-time/timezone'; + +const date = new Date(); + +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: Tokyo }); // JST +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: New_York }); // EST/EDT +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: London }); // GMT/BST +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: Sydney }); // AEDT/AEST +``` + +Both Method 1 and Method 2 provide the same functionality - they differ only in code organization. + +### Method 3: IANA Timezone Name String + +Functions that accept `FormatterOptions` (such as `format()` and `transform()`) allow you to specify timezones using IANA timezone name strings directly. This is the simplest approach. + +```typescript +import { format } from 'date-and-time'; + +const date = new Date(); + +// Using IANA timezone name strings +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: 'Asia/Tokyo' }); +// => 2025-08-23 23:30:45 + +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: 'America/New_York' }); +// => 2025-08-23 09:30:45 + +format(date, 'YYYY-MM-DD HH:mm:ss', { timeZone: 'Europe/London' }); +// => 2025-08-23 14:30:45 +``` + +**Important Note**: The `parse()` function does not support string type timezone names because it uses `ParserOptions` instead of `FormatterOptions`. Only TimeZone objects and the "UTC" string are supported for parsing. + ## Regions 1. [Africa](#africa) diff --git a/package-lock.json b/package-lock.json index 8a552cf..b505114 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,30 +1,29 @@ { "name": "date-and-time", - "version": "4.1.2", + "version": "4.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "date-and-time", - "version": "4.1.2", + "version": "4.2.0", "license": "MIT", "devDependencies": { - "@eslint/js": "^9.39.2", "@rollup/plugin-alias": "^6.0.0", "@rollup/plugin-terser": "^0.4.4", - "@stylistic/eslint-plugin": "^5.6.1", - "@types/node": "^25.0.2", - "@vitest/coverage-v8": "^4.0.15", + "@stylistic/eslint-plugin": "^5.7.0", + "@types/node": "^25.0.9", + "@vitest/coverage-v8": "^4.0.17", "eslint": "^9.39.2", "glob": "^13.0.0", - "prettier": "^3.7.4", - "rollup": "^4.53.3", + "prettier": "^3.8.0", + "rollup": "^4.55.1", "rollup-plugin-dts": "^6.3.0", "rollup-plugin-esbuild": "^6.2.1", "tsx": "^4.21.0", - "typescript-eslint": "^8.49.0", + "typescript-eslint": "^8.53.0", "vitepress": "^1.6.4", - "vitest": "^4.0.15" + "vitest": "^4.0.17" }, "engines": { "node": ">=18" @@ -818,7 +817,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -846,7 +847,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -1134,9 +1137,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", - "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", + "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", "cpu": [ "arm" ], @@ -1148,9 +1151,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", - "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", + "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", "cpu": [ "arm64" ], @@ -1162,9 +1165,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", - "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", + "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", "cpu": [ "arm64" ], @@ -1176,9 +1179,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", - "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", + "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", "cpu": [ "x64" ], @@ -1190,9 +1193,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", - "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz", + "integrity": "sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==", "cpu": [ "arm64" ], @@ -1204,9 +1207,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", - "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz", + "integrity": "sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==", "cpu": [ "x64" ], @@ -1218,9 +1221,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", - "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz", + "integrity": "sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==", "cpu": [ "arm" ], @@ -1232,9 +1235,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.3.tgz", - "integrity": "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz", + "integrity": "sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==", "cpu": [ "arm" ], @@ -1246,9 +1249,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", - "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz", + "integrity": "sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==", "cpu": [ "arm64" ], @@ -1260,9 +1263,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.3.tgz", - "integrity": "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz", + "integrity": "sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==", "cpu": [ "arm64" ], @@ -1274,9 +1277,23 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.3.tgz", - "integrity": "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz", + "integrity": "sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz", + "integrity": "sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==", "cpu": [ "loong64" ], @@ -1288,9 +1305,23 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.3.tgz", - "integrity": "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz", + "integrity": "sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz", + "integrity": "sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==", "cpu": [ "ppc64" ], @@ -1302,9 +1333,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.3.tgz", - "integrity": "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz", + "integrity": "sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==", "cpu": [ "riscv64" ], @@ -1316,9 +1347,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.3.tgz", - "integrity": "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz", + "integrity": "sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==", "cpu": [ "riscv64" ], @@ -1330,9 +1361,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.3.tgz", - "integrity": "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz", + "integrity": "sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==", "cpu": [ "s390x" ], @@ -1344,9 +1375,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", - "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", + "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", "cpu": [ "x64" ], @@ -1358,9 +1389,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.3.tgz", - "integrity": "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz", + "integrity": "sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==", "cpu": [ "x64" ], @@ -1371,10 +1402,24 @@ "linux" ] }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz", + "integrity": "sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.3.tgz", - "integrity": "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz", + "integrity": "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==", "cpu": [ "arm64" ], @@ -1386,9 +1431,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.3.tgz", - "integrity": "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz", + "integrity": "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==", "cpu": [ "arm64" ], @@ -1400,9 +1445,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.3.tgz", - "integrity": "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz", + "integrity": "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==", "cpu": [ "ia32" ], @@ -1414,9 +1459,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.3.tgz", - "integrity": "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz", + "integrity": "sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==", "cpu": [ "x64" ], @@ -1428,9 +1473,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", - "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz", + "integrity": "sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==", "cpu": [ "x64" ], @@ -1513,23 +1558,23 @@ "license": "MIT" }, "node_modules/@standard-schema/spec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", - "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "dev": true, "license": "MIT" }, "node_modules/@stylistic/eslint-plugin": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.6.1.tgz", - "integrity": "sha512-JCs+MqoXfXrRPGbGmho/zGS/jMcn3ieKl/A8YImqib76C8kjgZwq5uUFzc30lJkMvcchuRn6/v8IApLxli3Jyw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.7.0.tgz", + "integrity": "sha512-PsSugIf9ip1H/mWKj4bi/BlEoerxXAda9ByRFsYuwsmr6af9NxJL0AaiNXs8Le7R21QR5KMiD/KdxZZ71LjAxQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.9.0", - "@typescript-eslint/types": "^8.47.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/types": "^8.52.0", + "eslint-visitor-keys": "^5.0.0", + "espree": "^11.0.0", "estraverse": "^5.3.0", "picomatch": "^4.0.3" }, @@ -1540,6 +1585,37 @@ "eslint": ">=9.0.0" } }, + "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz", + "integrity": "sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/espree": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.0.0.tgz", + "integrity": "sha512-+gMeWRrIh/NsG+3NaLeWHuyeyk70p2tbvZIWBYcqQ4/7Xvars6GYTZNhF1sIeLcc6Wb11He5ffz3hsHyXFrw5A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -1606,9 +1682,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.2.tgz", - "integrity": "sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==", + "version": "25.0.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.9.tgz", + "integrity": "sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw==", "dev": true, "license": "MIT", "dependencies": { @@ -1626,20 +1702,20 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.49.0.tgz", - "integrity": "sha512-JXij0vzIaTtCwu6SxTh8qBc66kmf1xs7pI4UOiMDFVct6q86G0Zs7KRcEoJgY3Cav3x5Tq0MF5jwgpgLqgKG3A==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.0.tgz", + "integrity": "sha512-eEXsVvLPu8Z4PkFibtuFJLJOTAV/nPdgtSjkGoPpddpFk3/ym2oy97jynY6ic2m6+nc5M8SE1e9v/mHKsulcJg==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.49.0", - "@typescript-eslint/type-utils": "8.49.0", - "@typescript-eslint/utils": "8.49.0", - "@typescript-eslint/visitor-keys": "8.49.0", - "ignore": "^7.0.0", + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.53.0", + "@typescript-eslint/type-utils": "8.53.0", + "@typescript-eslint/utils": "8.53.0", + "@typescript-eslint/visitor-keys": "8.53.0", + "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1649,7 +1725,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.49.0", + "@typescript-eslint/parser": "^8.53.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -1665,17 +1741,17 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.49.0.tgz", - "integrity": "sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.53.0.tgz", + "integrity": "sha512-npiaib8XzbjtzS2N4HlqPvlpxpmZ14FjSJrteZpPxGUaYPlvhzlzUZ4mZyABo0EFrOWnvyd0Xxroq//hKhtAWg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.49.0", - "@typescript-eslint/types": "8.49.0", - "@typescript-eslint/typescript-estree": "8.49.0", - "@typescript-eslint/visitor-keys": "8.49.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.53.0", + "@typescript-eslint/types": "8.53.0", + "@typescript-eslint/typescript-estree": "8.53.0", + "@typescript-eslint/visitor-keys": "8.53.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1690,15 +1766,15 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.49.0.tgz", - "integrity": "sha512-/wJN0/DKkmRUMXjZUXYZpD1NEQzQAAn9QWfGwo+Ai8gnzqH7tvqS7oNVdTjKqOcPyVIdZdyCMoqN66Ia789e7g==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.0.tgz", + "integrity": "sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.49.0", - "@typescript-eslint/types": "^8.49.0", - "debug": "^4.3.4" + "@typescript-eslint/tsconfig-utils": "^8.53.0", + "@typescript-eslint/types": "^8.53.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1712,14 +1788,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.49.0.tgz", - "integrity": "sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz", + "integrity": "sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.49.0", - "@typescript-eslint/visitor-keys": "8.49.0" + "@typescript-eslint/types": "8.53.0", + "@typescript-eslint/visitor-keys": "8.53.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1730,9 +1806,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.49.0.tgz", - "integrity": "sha512-8prixNi1/6nawsRYxet4YOhnbW+W9FK/bQPxsGB1D3ZrDzbJ5FXw5XmzxZv82X3B+ZccuSxo/X8q9nQ+mFecWA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz", + "integrity": "sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==", "dev": true, "license": "MIT", "engines": { @@ -1747,17 +1823,17 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.49.0.tgz", - "integrity": "sha512-KTExJfQ+svY8I10P4HdxKzWsvtVnsuCifU5MvXrRwoP2KOlNZ9ADNEWWsQTJgMxLzS5VLQKDjkCT/YzgsnqmZg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.53.0.tgz", + "integrity": "sha512-BBAUhlx7g4SmcLhn8cnbxoxtmS7hcq39xKCgiutL3oNx1TaIp+cny51s8ewnKMpVUKQUGb41RAUWZ9kxYdovuw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.49.0", - "@typescript-eslint/typescript-estree": "8.49.0", - "@typescript-eslint/utils": "8.49.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" + "@typescript-eslint/types": "8.53.0", + "@typescript-eslint/typescript-estree": "8.53.0", + "@typescript-eslint/utils": "8.53.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1772,9 +1848,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", - "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.0.tgz", + "integrity": "sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==", "dev": true, "license": "MIT", "engines": { @@ -1786,21 +1862,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.49.0.tgz", - "integrity": "sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz", + "integrity": "sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.49.0", - "@typescript-eslint/tsconfig-utils": "8.49.0", - "@typescript-eslint/types": "8.49.0", - "@typescript-eslint/visitor-keys": "8.49.0", - "debug": "^4.3.4", - "minimatch": "^9.0.4", - "semver": "^7.6.0", + "@typescript-eslint/project-service": "8.53.0", + "@typescript-eslint/tsconfig-utils": "8.53.0", + "@typescript-eslint/types": "8.53.0", + "@typescript-eslint/visitor-keys": "8.53.0", + "debug": "^4.4.3", + "minimatch": "^9.0.5", + "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1840,16 +1916,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.49.0.tgz", - "integrity": "sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.0.tgz", + "integrity": "sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.49.0", - "@typescript-eslint/types": "8.49.0", - "@typescript-eslint/typescript-estree": "8.49.0" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.53.0", + "@typescript-eslint/types": "8.53.0", + "@typescript-eslint/typescript-estree": "8.53.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1864,13 +1940,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.49.0.tgz", - "integrity": "sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz", + "integrity": "sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/types": "8.53.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -1899,18 +1975,17 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.15.tgz", - "integrity": "sha512-FUJ+1RkpTFW7rQITdgTi93qOCWJobWhBirEPCeXh2SW2wsTlFxy51apDz5gzG+ZEYt/THvWeNmhdAoS9DTwpCw==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.17.tgz", + "integrity": "sha512-/6zU2FLGg0jsd+ePZcwHRy3+WpNTBBhDY56P4JTRqUN/Dp6CvOEa9HrikcQ4KfV2b2kAHUFB4dl1SuocWXSFEw==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.0.15", - "ast-v8-to-istanbul": "^0.3.8", + "@vitest/utils": "4.0.17", + "ast-v8-to-istanbul": "^0.3.10", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.2.0", "magicast": "^0.5.1", "obug": "^2.1.1", @@ -1921,8 +1996,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "4.0.15", - "vitest": "4.0.15" + "@vitest/browser": "4.0.17", + "vitest": "4.0.17" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -1931,16 +2006,16 @@ } }, "node_modules/@vitest/expect": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.15.tgz", - "integrity": "sha512-Gfyva9/GxPAWXIWjyGDli9O+waHDC0Q0jaLdFP1qPAUUfo1FEXPXUfUkp3eZA0sSq340vPycSyOlYUeM15Ft1w==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.17.tgz", + "integrity": "sha512-mEoqP3RqhKlbmUmntNDDCJeTDavDR+fVYkSOw8qRwJFaW/0/5zA9zFeTrHqNtcmwh6j26yMmwx2PqUDPzt5ZAQ==", "dev": true, "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.0.0", "@types/chai": "^5.2.2", - "@vitest/spy": "4.0.15", - "@vitest/utils": "4.0.15", + "@vitest/spy": "4.0.17", + "@vitest/utils": "4.0.17", "chai": "^6.2.1", "tinyrainbow": "^3.0.3" }, @@ -1949,9 +2024,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.15.tgz", - "integrity": "sha512-SWdqR8vEv83WtZcrfLNqlqeQXlQLh2iilO1Wk1gv4eiHKjEzvgHb2OVc3mIPyhZE6F+CtfYjNlDJwP5MN6Km7A==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.17.tgz", + "integrity": "sha512-Ah3VAYmjcEdHg6+MwFE17qyLqBHZ+ni2ScKCiW2XrlSBV4H3Z7vYfPfz7CWQ33gyu76oc0Ai36+kgLU3rfF4nw==", "dev": true, "license": "MIT", "dependencies": { @@ -1962,13 +2037,13 @@ } }, "node_modules/@vitest/runner": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.15.tgz", - "integrity": "sha512-+A+yMY8dGixUhHmNdPUxOh0la6uVzun86vAbuMT3hIDxMrAOmn5ILBHm8ajrqHE0t8R9T1dGnde1A5DTnmi3qw==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.17.tgz", + "integrity": "sha512-JmuQyf8aMWoo/LmNFppdpkfRVHJcsgzkbCA+/Bk7VfNH7RE6Ut2qxegeyx2j3ojtJtKIbIGy3h+KxGfYfk28YQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.0.15", + "@vitest/utils": "4.0.17", "pathe": "^2.0.3" }, "funding": { @@ -1976,13 +2051,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.15.tgz", - "integrity": "sha512-A7Ob8EdFZJIBjLjeO0DZF4lqR6U7Ydi5/5LIZ0xcI+23lYlsYJAfGn8PrIWTYdZQRNnSRlzhg0zyGu37mVdy5g==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.17.tgz", + "integrity": "sha512-npPelD7oyL+YQM2gbIYvlavlMVWUfNNGZPcu0aEUQXt7FXTuqhmgiYupPnAanhKvyP6Srs2pIbWo30K0RbDtRQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.15", + "@vitest/pretty-format": "4.0.17", "magic-string": "^0.30.21", "pathe": "^2.0.3" }, @@ -1991,9 +2066,9 @@ } }, "node_modules/@vitest/spy": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.15.tgz", - "integrity": "sha512-+EIjOJmnY6mIfdXtE/bnozKEvTC4Uczg19yeZ2vtCz5Yyb0QQ31QWVQ8hswJ3Ysx/K2EqaNsVanjr//2+P3FHw==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.17.tgz", + "integrity": "sha512-I1bQo8QaP6tZlTomQNWKJE6ym4SHf3oLS7ceNjozxxgzavRAgZDc06T7kD8gb9bXKEgcLNt00Z+kZO6KaJ62Ew==", "dev": true, "license": "MIT", "funding": { @@ -2001,13 +2076,13 @@ } }, "node_modules/@vitest/utils": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.15.tgz", - "integrity": "sha512-HXjPW2w5dxhTD0dLwtYHDnelK3j8sR8cWIaLxr22evTyY6q8pRCjZSmhRWVjBaOVXChQd6AwMzi9pucorXCPZA==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.17.tgz", + "integrity": "sha512-RG6iy+IzQpa9SB8HAFHJ9Y+pTzI+h8553MrciN9eC6TFBErqrQaTas4vG+MVj8S4uKk8uTT2p0vgZPnTdxd96w==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.0.15", + "@vitest/pretty-format": "4.0.17", "tinyrainbow": "^3.0.3" }, "funding": { @@ -2331,7 +2406,9 @@ } }, "node_modules/ast-v8-to-istanbul": { - "version": "0.3.8", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-0.3.10.tgz", + "integrity": "sha512-p4K7vMz2ZSk3wN8l5o3y2bJAoZXT3VuJI5OLTATY/01CYWumWvwkUw0SqDBnNq6IiTO3qDa1eSQDibAV8g7XOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2385,9 +2462,9 @@ } }, "node_modules/chai": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.1.tgz", - "integrity": "sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", "dev": true, "license": "MIT", "engines": { @@ -2743,6 +2820,8 @@ }, "node_modules/estree-walker": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, "license": "MIT", "dependencies": { @@ -2758,9 +2837,9 @@ } }, "node_modules/expect-type": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", - "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -3067,19 +3146,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "5.0.6", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.23", - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/istanbul-reports": { "version": "3.2.0", "dev": true, @@ -3094,6 +3160,8 @@ }, "node_modules/js-tokens": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", "dev": true, "license": "MIT" }, @@ -3555,9 +3623,9 @@ } }, "node_modules/prettier": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", - "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.0.tgz", + "integrity": "sha512-yEPsovQfpxYfgWNhCfECjG5AQaO+K3dp6XERmOepyPDVqcJm+bjyCVO3pmU+nAPe0N5dDvekfGezt/EIiRe1TA==", "dev": true, "license": "MIT", "bin": { @@ -3638,9 +3706,9 @@ "license": "MIT" }, "node_modules/rollup": { - "version": "4.53.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.3.tgz", - "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", + "integrity": "sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==", "dev": true, "license": "MIT", "dependencies": { @@ -3654,28 +3722,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.53.3", - "@rollup/rollup-android-arm64": "4.53.3", - "@rollup/rollup-darwin-arm64": "4.53.3", - "@rollup/rollup-darwin-x64": "4.53.3", - "@rollup/rollup-freebsd-arm64": "4.53.3", - "@rollup/rollup-freebsd-x64": "4.53.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", - "@rollup/rollup-linux-arm-musleabihf": "4.53.3", - "@rollup/rollup-linux-arm64-gnu": "4.53.3", - "@rollup/rollup-linux-arm64-musl": "4.53.3", - "@rollup/rollup-linux-loong64-gnu": "4.53.3", - "@rollup/rollup-linux-ppc64-gnu": "4.53.3", - "@rollup/rollup-linux-riscv64-gnu": "4.53.3", - "@rollup/rollup-linux-riscv64-musl": "4.53.3", - "@rollup/rollup-linux-s390x-gnu": "4.53.3", - "@rollup/rollup-linux-x64-gnu": "4.53.3", - "@rollup/rollup-linux-x64-musl": "4.53.3", - "@rollup/rollup-openharmony-arm64": "4.53.3", - "@rollup/rollup-win32-arm64-msvc": "4.53.3", - "@rollup/rollup-win32-ia32-msvc": "4.53.3", - "@rollup/rollup-win32-x64-gnu": "4.53.3", - "@rollup/rollup-win32-x64-msvc": "4.53.3", + "@rollup/rollup-android-arm-eabi": "4.55.1", + "@rollup/rollup-android-arm64": "4.55.1", + "@rollup/rollup-darwin-arm64": "4.55.1", + "@rollup/rollup-darwin-x64": "4.55.1", + "@rollup/rollup-freebsd-arm64": "4.55.1", + "@rollup/rollup-freebsd-x64": "4.55.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.55.1", + "@rollup/rollup-linux-arm-musleabihf": "4.55.1", + "@rollup/rollup-linux-arm64-gnu": "4.55.1", + "@rollup/rollup-linux-arm64-musl": "4.55.1", + "@rollup/rollup-linux-loong64-gnu": "4.55.1", + "@rollup/rollup-linux-loong64-musl": "4.55.1", + "@rollup/rollup-linux-ppc64-gnu": "4.55.1", + "@rollup/rollup-linux-ppc64-musl": "4.55.1", + "@rollup/rollup-linux-riscv64-gnu": "4.55.1", + "@rollup/rollup-linux-riscv64-musl": "4.55.1", + "@rollup/rollup-linux-s390x-gnu": "4.55.1", + "@rollup/rollup-linux-x64-gnu": "4.55.1", + "@rollup/rollup-linux-x64-musl": "4.55.1", + "@rollup/rollup-openbsd-x64": "4.55.1", + "@rollup/rollup-openharmony-arm64": "4.55.1", + "@rollup/rollup-win32-arm64-msvc": "4.55.1", + "@rollup/rollup-win32-ia32-msvc": "4.55.1", + "@rollup/rollup-win32-x64-gnu": "4.55.1", + "@rollup/rollup-win32-x64-msvc": "4.55.1", "fsevents": "~2.3.2" } }, @@ -3748,7 +3819,9 @@ "peer": true }, "node_modules/semver": { - "version": "7.7.2", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "license": "ISC", "bin": { @@ -3970,24 +4043,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, "node_modules/tinyglobby/node_modules/picomatch": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", @@ -4021,9 +4076,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", "dev": true, "license": "MIT", "engines": { @@ -4078,16 +4133,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.49.0.tgz", - "integrity": "sha512-zRSVH1WXD0uXczCXw+nsdjGPUdx4dfrs5VQoHnUWmv1U3oNlAKv4FUNdLDhVUg+gYn+a5hUESqch//Rv5wVhrg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.53.0.tgz", + "integrity": "sha512-xHURCQNxZ1dsWn0sdOaOfCSQG0HKeqSj9OexIxrz6ypU6wHYOdX2I3D2b8s8wFSsSOYJb+6q283cLiLlkEsBYw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.49.0", - "@typescript-eslint/parser": "8.49.0", - "@typescript-eslint/typescript-estree": "8.49.0", - "@typescript-eslint/utils": "8.49.0" + "@typescript-eslint/eslint-plugin": "8.53.0", + "@typescript-eslint/parser": "8.53.0", + "@typescript-eslint/typescript-estree": "8.53.0", + "@typescript-eslint/utils": "8.53.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4319,19 +4374,19 @@ } }, "node_modules/vitest": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.15.tgz", - "integrity": "sha512-n1RxDp8UJm6N0IbJLQo+yzLZ2sQCDyl1o0LeugbPWf8+8Fttp29GghsQBjYJVmWq3gBFfe9Hs1spR44vovn2wA==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.17.tgz", + "integrity": "sha512-FQMeF0DJdWY0iOnbv466n/0BudNdKj1l5jYgl5JVTwjSsZSlqyXFt/9+1sEyhR6CLowbZpV7O1sCHrzBhucKKg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "4.0.15", - "@vitest/mocker": "4.0.15", - "@vitest/pretty-format": "4.0.15", - "@vitest/runner": "4.0.15", - "@vitest/snapshot": "4.0.15", - "@vitest/spy": "4.0.15", - "@vitest/utils": "4.0.15", + "@vitest/expect": "4.0.17", + "@vitest/mocker": "4.0.17", + "@vitest/pretty-format": "4.0.17", + "@vitest/runner": "4.0.17", + "@vitest/snapshot": "4.0.17", + "@vitest/spy": "4.0.17", + "@vitest/utils": "4.0.17", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", @@ -4359,10 +4414,10 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.0.15", - "@vitest/browser-preview": "4.0.15", - "@vitest/browser-webdriverio": "4.0.15", - "@vitest/ui": "4.0.15", + "@vitest/browser-playwright": "4.0.17", + "@vitest/browser-preview": "4.0.17", + "@vitest/browser-webdriverio": "4.0.17", + "@vitest/ui": "4.0.17", "happy-dom": "*", "jsdom": "*" }, @@ -4397,13 +4452,13 @@ } }, "node_modules/vitest/node_modules/@vitest/mocker": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.15.tgz", - "integrity": "sha512-CZ28GLfOEIFkvCFngN8Sfx5h+Se0zN+h4B7yOsPVCcgtiO7t5jt9xQh2E1UkFep+eb9fjyMfuC5gBypwb07fvQ==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.17.tgz", + "integrity": "sha512-+ZtQhLA3lDh1tI2wxe3yMsGzbp7uuJSWBM1iTIKCbppWTSBN09PUC+L+fyNlQApQoR+Ps8twt2pbSSXg2fQVEQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "4.0.15", + "@vitest/spy": "4.0.17", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, @@ -4424,13 +4479,13 @@ } }, "node_modules/vitest/node_modules/vite": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.6.tgz", - "integrity": "sha512-tI2l/nFHC5rLh7+5+o7QjKjSR04ivXDF4jcgV0f/bTQ+OJiITy5S6gaynVsEM+7RqzufMnVbIon6Sr5x1SDYaQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.25.0", + "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", diff --git a/package.json b/package.json index aa49b1b..72bf8b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "date-and-time", - "version": "4.1.2", + "version": "4.2.0", "description": "The simplest, most intuitive date and time library", "keywords": [ "date", @@ -24,6 +24,11 @@ "import": "./dist/plugin.js", "require": "./dist/plugin.cjs" }, + "./timezone": { + "types": "./dist/timezone.d.ts", + "import": "./dist/timezone.js", + "require": "./dist/timezone.cjs" + }, "./locales/*": { "types": "./dist/locales/*.d.ts", "import": "./dist/locales/*.js", @@ -63,6 +68,7 @@ "test": "vitest run", "test:coverage": "vitest run --coverage", "timezone": "tsx tools/timezone.ts", + "ts": "tsc --noEmit", "zonename": "tsx tools/zonename.ts" }, "author": "KNOWLEDGECODE", @@ -81,22 +87,21 @@ "type": "module", "sideEffects": false, "devDependencies": { - "@eslint/js": "^9.39.2", "@rollup/plugin-alias": "^6.0.0", "@rollup/plugin-terser": "^0.4.4", - "@stylistic/eslint-plugin": "^5.6.1", - "@types/node": "^25.0.2", - "@vitest/coverage-v8": "^4.0.15", + "@stylistic/eslint-plugin": "^5.7.0", + "@types/node": "^25.0.9", + "@vitest/coverage-v8": "^4.0.17", "eslint": "^9.39.2", "glob": "^13.0.0", - "prettier": "^3.7.4", - "rollup": "^4.53.3", + "prettier": "^3.8.0", + "rollup": "^4.55.1", "rollup-plugin-dts": "^6.3.0", "rollup-plugin-esbuild": "^6.2.1", "tsx": "^4.21.0", - "typescript-eslint": "^8.49.0", + "typescript-eslint": "^8.53.0", "vitepress": "^1.6.4", - "vitest": "^4.0.15" + "vitest": "^4.0.17" }, "overrides": { "esbuild": "^0.25.0" diff --git a/rollup.config.ts b/rollup.config.ts index d7cb06b..7ce0826 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -27,6 +27,7 @@ const ts = () => { return [ config('src/index.ts', 'dist'), config('src/plugin.ts', 'dist'), + config('src/timezone.ts', 'dist'), config(Object.fromEntries(globSync('src/numerals/**/*.ts').map(input => [replacePath(input), input])), 'dist'), globSync('src/locales/**/*.ts').map(input => config(input, outputDir(input))), globSync('src/plugins/**/*.ts').map(input => config(input, outputDir(input))), @@ -48,6 +49,7 @@ const types = () => { return [ config('src/index.ts', 'dist'), config('src/plugin.ts', 'dist'), + config('src/timezone.ts', 'dist'), config(Object.fromEntries(globSync('src/numerals/**/*.ts').map(input => [replacePath(input), input])), 'dist'), globSync('src/locales/**/*.ts').map(input => config(input, outputDir(input))), globSync('src/plugins/**/*.ts').map(input => config(input, outputDir(input))), diff --git a/src/addDays.ts b/src/addDays.ts index 84e5dc7..aebcab8 100644 --- a/src/addDays.ts +++ b/src/addDays.ts @@ -1,6 +1,6 @@ import { toParts, fromParts } from './datetime.ts'; -import { isTimeZone, isUTC, createTimezoneDate } from './timezone.ts'; -import type { TimeZone } from './timezone.ts'; +import { isTimeZone, isUTC, createTimezoneDate } from './zone.ts'; +import type { TimeZone } from './zone.ts'; /** * Adds the specified number of days to a Date object. diff --git a/src/addMonths.ts b/src/addMonths.ts index 161988b..9f4a0be 100644 --- a/src/addMonths.ts +++ b/src/addMonths.ts @@ -1,6 +1,6 @@ import { toParts, fromParts } from './datetime.ts'; -import { isTimeZone, isUTC, createTimezoneDate } from './timezone.ts'; -import type { TimeZone } from './timezone.ts'; +import { isTimeZone, isUTC, createTimezoneDate } from './zone.ts'; +import type { TimeZone } from './zone.ts'; /** * Adds the specified number of months to a Date object. diff --git a/src/addYears.ts b/src/addYears.ts index 0e0db11..255a7cb 100644 --- a/src/addYears.ts +++ b/src/addYears.ts @@ -1,5 +1,5 @@ import { addMonths } from './addMonths.ts'; -import type { TimeZone } from './timezone.ts'; +import type { TimeZone } from './zone.ts'; /** * Adds the specified number of years to a Date object. diff --git a/src/datetime.ts b/src/datetime.ts index 7a37b7d..bcad93c 100644 --- a/src/datetime.ts +++ b/src/datetime.ts @@ -1,4 +1,5 @@ import { getDateTimeFormat } from './dtf.ts'; +import { isUTC } from './zone.ts'; export interface DateTimeParts { weekday: number; @@ -13,7 +14,7 @@ export interface DateTimeParts { } export const toParts = (dateObj: Date, zoneName: string): DateTimeParts => { - if (zoneName.toUpperCase() === 'UTC') { + if (isUTC(zoneName)) { return { weekday: dateObj.getUTCDay(), year: dateObj.getUTCFullYear(), @@ -102,11 +103,11 @@ export interface DateLike { */ getMilliseconds(): number; /** - * Returns the day of the week (0-6; where 0 is Sunday). + * Returns the day of the week (0-6, where 0 is Sunday). */ getDay(): number; /** - * Returns the time value in milliseconds since the Unix epoch (January 1; 1970). + * Returns the time value in milliseconds since the Unix epoch (January 1, 1970). */ getTime(): number; /** diff --git a/src/format.ts b/src/format.ts index 42f76a5..39769f7 100644 --- a/src/format.ts +++ b/src/format.ts @@ -3,7 +3,7 @@ import { DateTime } from './datetime.ts'; import { formatter as defaultFormatter } from './formatter.ts'; import en from './locales/en.ts'; import latn from './numerals/latn.ts'; -import { isTimeZone, isUTC } from './timezone.ts'; +import { isTimeZone } from './zone.ts'; import type { CompiledObject } from './compile.ts'; import type { FormatterOptions } from './formatter.ts'; @@ -18,15 +18,14 @@ const comment = /^\[(.*)\]$/; */ export function format(dateObj: Date, arg: string | CompiledObject, options?: FormatterOptions) { const pattern = (typeof arg === 'string' ? compile(arg) : arg).slice(1); - const timeZone = isTimeZone(options?.timeZone) || isUTC(options?.timeZone) ? options.timeZone : undefined; - const zoneName = typeof timeZone === 'string' ? timeZone : timeZone?.zone_name ?? ''; + const zoneName = isTimeZone(options?.timeZone) ? options.timeZone.zone_name : options?.timeZone; const dateTime = zoneName ? new DateTime(dateObj, zoneName) : dateObj; const formatterOptions = { hour12: options?.hour12 ?? 'h12', hour24: options?.hour24 ?? 'h23', numeral: options?.numeral ?? latn, calendar: options?.calendar ?? 'gregory', - timeZone, + timeZone: options?.timeZone, locale: options?.locale ?? en }; const formatters = [...options?.plugins ?? [], defaultFormatter]; diff --git a/src/formatter.ts b/src/formatter.ts index 8e7bea6..da25768 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -2,7 +2,7 @@ import type { CompiledObject } from './compile.ts'; import type { DateLike } from './datetime.ts'; import type { Locale } from './locale.ts'; import type { Numeral } from './numeral.ts'; -import type { TimeZone } from './timezone.ts'; +import type { TimeZone } from './zone.ts'; export interface FormatterPluginOptions { /** @@ -31,12 +31,12 @@ export interface FormatterPluginOptions { */ calendar: 'buddhist' | 'gregory'; - /** - * The time zone to use for formatting dates and times. - * This can be a specific time zone object or 'UTC' to use Coordinated Universal Time. - * If not specified, it defaults to undefined, which means the local time zone will be used. - */ - timeZone: TimeZone | 'UTC' | undefined; +/** + * The time zone to use for formatting dates and times. + * This can be a specific time zone object, an IANA time zone name, or 'UTC' to use Coordinated Universal Time. + * If not specified, it defaults to undefined, which means the local time zone will be used. + */ + timeZone: TimeZone | string | undefined; /** * The locale to use for formatting dates and times. @@ -72,12 +72,12 @@ class DefaultFormatter extends FormatterPlugin { MMMM (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMonthList({ style: 'long', compiledObj }); - return list[d.getMonth()] || ''; + return list[d.getMonth()] ?? ''; } MMM (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMonthList({ style: 'short', compiledObj }); - return list[d.getMonth()] || ''; + return list[d.getMonth()] ?? ''; } MM (d: DateLike) { @@ -106,22 +106,22 @@ class DefaultFormatter extends FormatterPlugin { AA (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMeridiemList({ style: 'long', compiledObj, case: 'uppercase' }); - return list[+(d.getHours() > 11)] || ''; + return list[+(d.getHours() > 11)] ?? ''; } A (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMeridiemList({ style: 'short', compiledObj, case: 'uppercase' }); - return list[+(d.getHours() > 11)] || ''; + return list[+(d.getHours() > 11)] ?? ''; } aa (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMeridiemList({ style: 'long', compiledObj, case: 'lowercase' }); - return list[+(d.getHours() > 11)] || ''; + return list[+(d.getHours() > 11)] ?? ''; } a (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getMeridiemList({ style: 'short', compiledObj, case: 'lowercase' }); - return list[+(d.getHours() > 11)] || ''; + return list[+(d.getHours() > 11)] ?? ''; } hh (d: DateLike, options: FormatterPluginOptions) { @@ -162,17 +162,17 @@ class DefaultFormatter extends FormatterPlugin { dddd (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getDayOfWeekList({ style: 'long', compiledObj }); - return list[d.getDay()] || ''; + return list[d.getDay()] ?? ''; } ddd (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getDayOfWeekList({ style: 'short', compiledObj }); - return list[d.getDay()] || ''; + return list[d.getDay()] ?? ''; } dd (d: DateLike, options: FormatterPluginOptions, compiledObj: CompiledObject) { const list = options.locale.getDayOfWeekList({ style: 'narrow', compiledObj }); - return list[d.getDay()] || ''; + return list[d.getDay()] ?? ''; } Z (d: DateLike) { diff --git a/src/parse.ts b/src/parse.ts index df4e6ac..ba7ff78 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -1,4 +1,4 @@ -import { isTimeZone, isUTC, createTimezoneDate } from './timezone.ts'; +import { isTimeZone, isUTC, createTimezoneDate } from './zone.ts'; import { validatePreparseResult } from './isValid.ts'; import { preparse } from './preparse.ts'; import type { CompiledObject } from './compile.ts'; diff --git a/src/parser.ts b/src/parser.ts index 506db9b..ee01648 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,7 +1,7 @@ import type { CompiledObject } from './compile.ts'; import type { Locale } from './locale.ts'; import type { Numeral } from './numeral.ts'; -import type { TimeZone } from './timezone.ts'; +import type { TimeZone } from './zone.ts'; type ParserToken = 'Y' | 'M' | 'D' | 'H' | 'A' | 'h' | 'm' | 's' | 'S' | 'Z'; diff --git a/src/plugin.ts b/src/plugin.ts index 0d9d8f3..847775e 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -6,4 +6,4 @@ export type { CompiledObject } from './compile.ts'; export type { DateLike } from './datetime.ts'; export type { Locale } from './locale.ts'; export type { Numeral } from './numeral.ts'; -export type { TimeZone } from './timezone.ts'; +export type { TimeZone } from './zone.ts'; diff --git a/src/plugins/zonename.ts b/src/plugins/zonename.ts index aa76333..a54fa33 100644 --- a/src/plugins/zonename.ts +++ b/src/plugins/zonename.ts @@ -1,5 +1,6 @@ import timeZoneNames from '@/zonenames.ts'; import { FormatterPlugin } from '@/plugin.ts'; +import { isTimeZone } from '@/zone.ts'; import type { FormatterPluginOptions, DateLike } from '@/plugin.ts'; const getLongTimezoneName = (time: number, zoneName?: string) => { @@ -16,12 +17,12 @@ const getShortTimezoneName = (time: number, zoneName?: string) => { class Formatter extends FormatterPlugin { z (d: DateLike, options: FormatterPluginOptions) { - const zoneName = options.timeZone === 'UTC' ? 'UTC' : options.timeZone?.zone_name; + const zoneName = isTimeZone(options.timeZone) ? options.timeZone.zone_name : options.timeZone; return getShortTimezoneName(d.getTime(), zoneName); } zz (d: DateLike, options: FormatterPluginOptions) { - const zoneName = options.timeZone === 'UTC' ? 'UTC' : options.timeZone?.zone_name; + const zoneName = isTimeZone(options.timeZone) ? options.timeZone.zone_name : options.timeZone; return getLongTimezoneName(d.getTime(), zoneName); } } diff --git a/src/preparse.ts b/src/preparse.ts index c85f66f..8534674 100644 --- a/src/preparse.ts +++ b/src/preparse.ts @@ -1,5 +1,5 @@ import { compile } from './compile.ts'; -import { isTimeZone, isUTC } from './timezone.ts'; +import { isTimeZone, isUTC } from './zone.ts'; import { parser as defaultParser } from './parser.ts'; import en from './locales/en.ts'; import latn from './numerals/latn.ts'; diff --git a/src/timezone.ts b/src/timezone.ts index 453a60c..160a2e7 100644 --- a/src/timezone.ts +++ b/src/timezone.ts @@ -1,34 +1,2091 @@ -import { getDateTimeFormat } from './dtf.ts'; +import { TimeZone } from '@/zone.ts'; -export interface TimeZone { - zone_name: string; - gmt_offset: number[]; -} +export const Abidjan: TimeZone = { + zone_name: 'Africa/Abidjan', + gmt_offset: [0, -968] +}; + +export const Accra: TimeZone = { + zone_name: 'Africa/Accra', + gmt_offset: [1800, 1200, 0, -52] +}; + +export const Adak: TimeZone = { + zone_name: 'America/Adak', + gmt_offset: [44002, -32400, -36000, -39600, -42398] +}; + +export const Addis_Ababa: TimeZone = { + zone_name: 'Africa/Addis_Ababa', + gmt_offset: [10800, 9320, 9288] +}; + +export const Adelaide: TimeZone = { + zone_name: 'Australia/Adelaide', + gmt_offset: [37800, 34200, 33260, 32400] +}; + +export const Aden: TimeZone = { + zone_name: 'Asia/Aden', + gmt_offset: [10800, 10794] +}; + +export const Algiers: TimeZone = { + zone_name: 'Africa/Algiers', + gmt_offset: [7200, 3600, 732, 561, 0] +}; + +export const Almaty: TimeZone = { + zone_name: 'Asia/Almaty', + gmt_offset: [25200, 21600, 18468, 18000] +}; + +export const Amman: TimeZone = { + zone_name: 'Asia/Amman', + gmt_offset: [10800, 8624, 7200] +}; + +export const Amsterdam: TimeZone = { + zone_name: 'Europe/Amsterdam', + gmt_offset: [7200, 4800, 4772, 3600, 1200, 1172] +}; + +export const Anadyr: TimeZone = { + zone_name: 'Asia/Anadyr', + gmt_offset: [50400, 46800, 43200, 42596, 39600] +}; + +export const Anchorage: TimeZone = { + zone_name: 'America/Anchorage', + gmt_offset: [50424, -28800, -32400, -35976, -36000] +}; + +export const Andorra: TimeZone = { + zone_name: 'Europe/Andorra', + gmt_offset: [7200, 3600, 364, 0] +}; + +export const Anguilla: TimeZone = { + zone_name: 'America/Anguilla', + gmt_offset: [-14400, -15136] +}; + +export const Antananarivo: TimeZone = { + zone_name: 'Indian/Antananarivo', + gmt_offset: [14400, 11404, 10800] +}; + +export const Antigua: TimeZone = { + zone_name: 'America/Antigua', + gmt_offset: [-14400, -14832, -18000] +}; + +export const Apia: TimeZone = { + zone_name: 'Pacific/Apia', + gmt_offset: [50400, 46800, 45184, -36000, -39600, -41216, -41400] +}; + +export const Aqtau: TimeZone = { + zone_name: 'Asia/Aqtau', + gmt_offset: [21600, 18000, 14400, 12064] +}; + +export const Aqtobe: TimeZone = { + zone_name: 'Asia/Aqtobe', + gmt_offset: [21600, 18000, 14400, 13720] +}; + +export const Araguaina: TimeZone = { + zone_name: 'America/Araguaina', + gmt_offset: [-7200, -10800, -11568] +}; + +export const Aruba: TimeZone = { + zone_name: 'America/Aruba', + gmt_offset: [-14400, -16200, -16824] +}; + +export const Ashgabat: TimeZone = { + zone_name: 'Asia/Ashgabat', + gmt_offset: [21600, 18000, 14400, 14012] +}; + +export const Asmara: TimeZone = { + zone_name: 'Africa/Asmara', + gmt_offset: [10800, 9332, 9320] +}; + +export const Astrakhan: TimeZone = { + zone_name: 'Europe/Astrakhan', + gmt_offset: [18000, 14400, 11532, 10800] +}; + +export const Asuncion: TimeZone = { + zone_name: 'America/Asuncion', + gmt_offset: [-10800, -13840, -14400] +}; + +export const Athens: TimeZone = { + zone_name: 'Europe/Athens', + gmt_offset: [10800, 7200, 5692, 3600] +}; + +export const Atikokan: TimeZone = { + zone_name: 'America/Atikokan', + gmt_offset: [-18000, -21600, -21988] +}; + +export const Atyrau: TimeZone = { + zone_name: 'Asia/Atyrau', + gmt_offset: [21600, 18000, 14400, 12464, 10800] +}; + +export const Auckland: TimeZone = { + zone_name: 'Pacific/Auckland', + gmt_offset: [46800, 45000, 43200, 41944, 41400] +}; + +export const Azores: TimeZone = { + zone_name: 'Atlantic/Azores', + gmt_offset: [3600, 0, -3600, -6160, -6872, -7200] +}; + +export const Baghdad: TimeZone = { + zone_name: 'Asia/Baghdad', + gmt_offset: [14400, 10800, 10660, 10656] +}; + +export const Bahia: TimeZone = { + zone_name: 'America/Bahia', + gmt_offset: [-7200, -9244, -10800] +}; + +export const Bahia_Banderas: TimeZone = { + zone_name: 'America/Bahia_Banderas', + gmt_offset: [-18000, -21600, -25200, -25260] +}; + +export const Bahrain: TimeZone = { + zone_name: 'Asia/Bahrain', + gmt_offset: [14400, 12600, 12140, 10800] +}; + +export const Baku: TimeZone = { + zone_name: 'Asia/Baku', + gmt_offset: [18000, 14400, 11964, 10800] +}; + +export const Bamako: TimeZone = { + zone_name: 'Africa/Bamako', + gmt_offset: [0, -1920, -3600] +}; + +export const Bangkok: TimeZone = { + zone_name: 'Asia/Bangkok', + gmt_offset: [25200, 24124] +}; + +export const Bangui: TimeZone = { + zone_name: 'Africa/Bangui', + gmt_offset: [4460, 3600] +}; + +export const Banjul: TimeZone = { + zone_name: 'Africa/Banjul', + gmt_offset: [0, -3600, -3996] +}; + +export const Barbados: TimeZone = { + zone_name: 'America/Barbados', + gmt_offset: [-10800, -12600, -14309, -14400] +}; + +export const Barnaul: TimeZone = { + zone_name: 'Asia/Barnaul', + gmt_offset: [28800, 25200, 21600, 20100] +}; + +export const Beirut: TimeZone = { + zone_name: 'Asia/Beirut', + gmt_offset: [10800, 8520, 7200] +}; + +export const Belem: TimeZone = { + zone_name: 'America/Belem', + gmt_offset: [-7200, -10800, -11636] +}; + +export const Belgrade: TimeZone = { + zone_name: 'Europe/Belgrade', + gmt_offset: [7200, 4920, 3600] +}; + +export const Belize: TimeZone = { + zone_name: 'America/Belize', + gmt_offset: [-18000, -19800, -21168, -21600] +}; + +export const Berlin: TimeZone = { + zone_name: 'Europe/Berlin', + gmt_offset: [10800, 7200, 3600, 3208] +}; + +export const Bermuda: TimeZone = { + zone_name: 'Atlantic/Bermuda', + gmt_offset: [-10800, -11958, -14400, -15558] +}; + +export const Beulah: TimeZone = { + zone_name: 'America/North_Dakota/Beulah', + gmt_offset: [-18000, -21600, -24427, -25200] +}; + +export const Bishkek: TimeZone = { + zone_name: 'Asia/Bishkek', + gmt_offset: [25200, 21600, 18000, 17904] +}; + +export const Bissau: TimeZone = { + zone_name: 'Africa/Bissau', + gmt_offset: [0, -3600, -3740] +}; + +export const Blanc_Sablon: TimeZone = { + zone_name: 'America/Blanc-Sablon', + gmt_offset: [-10800, -13708, -14400] +}; + +export const Blantyre: TimeZone = { + zone_name: 'Africa/Blantyre', + gmt_offset: [8470, 8460, 8400, 7200] +}; + +export const Boa_Vista: TimeZone = { + zone_name: 'America/Boa_Vista', + gmt_offset: [-10800, -14400, -14560] +}; + +export const Bogota: TimeZone = { + zone_name: 'America/Bogota', + gmt_offset: [-14400, -17776, -18000] +}; + +export const Boise: TimeZone = { + zone_name: 'America/Boise', + gmt_offset: [-21600, -25200, -27889, -28800] +}; + +export const Bougainville: TimeZone = { + zone_name: 'Pacific/Bougainville', + gmt_offset: [39600, 37336, 36000, 35312, 32400] +}; + +export const Bratislava: TimeZone = { + zone_name: 'Europe/Bratislava', + gmt_offset: [7200, 3600, 3464, 0] +}; + +export const Brazzaville: TimeZone = { + zone_name: 'Africa/Brazzaville', + gmt_offset: [3668, 3600] +}; + +export const Brisbane: TimeZone = { + zone_name: 'Australia/Brisbane', + gmt_offset: [39600, 36728, 36000] +}; + +export const Broken_Hill: TimeZone = { + zone_name: 'Australia/Broken_Hill', + gmt_offset: [37800, 36000, 34200, 33948, 32400] +}; + +export const Brunei: TimeZone = { + zone_name: 'Asia/Brunei', + gmt_offset: [28800, 27580, 27000] +}; + +export const Brussels: TimeZone = { + zone_name: 'Europe/Brussels', + gmt_offset: [7200, 3600, 1050, 0] +}; + +export const Bucharest: TimeZone = { + zone_name: 'Europe/Bucharest', + gmt_offset: [10800, 7200, 6264] +}; + +export const Budapest: TimeZone = { + zone_name: 'Europe/Budapest', + gmt_offset: [7200, 4580, 3600] +}; + +export const Buenos_Aires: TimeZone = { + zone_name: 'America/Argentina/Buenos_Aires', + gmt_offset: [-7200, -10800, -14028, -14400, -15408] +}; + +export const Bujumbura: TimeZone = { + zone_name: 'Africa/Bujumbura', + gmt_offset: [7200, 7048] +}; + +export const Busingen: TimeZone = { + zone_name: 'Europe/Busingen', + gmt_offset: [7200, 3600, 2048, 1786] +}; + +export const Cairo: TimeZone = { + zone_name: 'Africa/Cairo', + gmt_offset: [10800, 7509, 7200] +}; + +export const Cambridge_Bay: TimeZone = { + zone_name: 'America/Cambridge_Bay', + gmt_offset: [0, -18000, -21600, -25200] +}; + +export const Campo_Grande: TimeZone = { + zone_name: 'America/Campo_Grande', + gmt_offset: [-10800, -13108, -14400] +}; + +export const Canary: TimeZone = { + zone_name: 'Atlantic/Canary', + gmt_offset: [3600, 0, -3600, -3696] +}; + +export const Cancun: TimeZone = { + zone_name: 'America/Cancun', + gmt_offset: [-14400, -18000, -20824, -21600] +}; + +export const Cape_Verde: TimeZone = { + zone_name: 'Atlantic/Cape_Verde', + gmt_offset: [-3600, -5644, -7200] +}; + +export const Caracas: TimeZone = { + zone_name: 'America/Caracas', + gmt_offset: [-14400, -16060, -16064, -16200] +}; + +export const Casablanca: TimeZone = { + zone_name: 'Africa/Casablanca', + gmt_offset: [3600, 0, -1820] +}; + +export const Casey: TimeZone = { + zone_name: 'Antarctica/Casey', + gmt_offset: [39600, 28800, 0] +}; + +export const Catamarca: TimeZone = { + zone_name: 'America/Argentina/Catamarca', + gmt_offset: [-7200, -10800, -14400, -15408, -15788] +}; + +export const Cayenne: TimeZone = { + zone_name: 'America/Cayenne', + gmt_offset: [-10800, -12560, -14400] +}; + +export const Cayman: TimeZone = { + zone_name: 'America/Cayman', + gmt_offset: [-18000, -18430, -19532] +}; + +export const Center: TimeZone = { + zone_name: 'America/North_Dakota/Center', + gmt_offset: [-18000, -21600, -24312, -25200] +}; + +export const Ceuta: TimeZone = { + zone_name: 'Africa/Ceuta', + gmt_offset: [7200, 3600, 0, -1276] +}; + +export const Chagos: TimeZone = { + zone_name: 'Indian/Chagos', + gmt_offset: [21600, 18000, 17380] +}; + +export const Chatham: TimeZone = { + zone_name: 'Pacific/Chatham', + gmt_offset: [49500, 45900, 44100, 44028] +}; + +export const Chicago: TimeZone = { + zone_name: 'America/Chicago', + gmt_offset: [-18000, -21036, -21600] +}; + +export const Chihuahua: TimeZone = { + zone_name: 'America/Chihuahua', + gmt_offset: [-18000, -21600, -25200, -25460] +}; + +export const Chisinau: TimeZone = { + zone_name: 'Europe/Chisinau', + gmt_offset: [14400, 10800, 7200, 6920, 6900, 6264, 3600] +}; + +export const Chita: TimeZone = { + zone_name: 'Asia/Chita', + gmt_offset: [36000, 32400, 28800, 27232] +}; + +export const Christmas: TimeZone = { + zone_name: 'Indian/Christmas', + gmt_offset: [25372, 25200] +}; + +export const Chuuk: TimeZone = { + zone_name: 'Pacific/Chuuk', + gmt_offset: [36428, 36000, 32400, -49972] +}; + +export const Ciudad_Juarez: TimeZone = { + zone_name: 'America/Ciudad_Juarez', + gmt_offset: [-18000, -21600, -25200, -25556] +}; + +export const Cocos: TimeZone = { + zone_name: 'Indian/Cocos', + gmt_offset: [23400, 23260] +}; + +export const Colombo: TimeZone = { + zone_name: 'Asia/Colombo', + gmt_offset: [23400, 21600, 19800, 19172, 19164] +}; + +export const Comoro: TimeZone = { + zone_name: 'Indian/Comoro', + gmt_offset: [10800, 10384] +}; + +export const Conakry: TimeZone = { + zone_name: 'Africa/Conakry', + gmt_offset: [0, -3292, -3600] +}; + +export const Copenhagen: TimeZone = { + zone_name: 'Europe/Copenhagen', + gmt_offset: [7200, 3600, 3020] +}; + +export const Cordoba: TimeZone = { + zone_name: 'America/Argentina/Cordoba', + gmt_offset: [-7200, -10800, -14400, -15408] +}; + +export const Costa_Rica: TimeZone = { + zone_name: 'America/Costa_Rica', + gmt_offset: [-18000, -20173, -21600] +}; + +export const Coyhaique: TimeZone = { + zone_name: 'America/Coyhaique', + gmt_offset: [-10800, -14400, -16965, -17296, -18000] +}; + +export const Creston: TimeZone = { + zone_name: 'America/Creston', + gmt_offset: [-25200, -27964, -28800] +}; + +export const Cuiaba: TimeZone = { + zone_name: 'America/Cuiaba', + gmt_offset: [-10800, -13460, -14400] +}; + +export const Curacao: TimeZone = { + zone_name: 'America/Curacao', + gmt_offset: [-14400, -16200, -16547] +}; + +export const Dakar: TimeZone = { + zone_name: 'Africa/Dakar', + gmt_offset: [0, -3600, -4184] +}; + +export const Damascus: TimeZone = { + zone_name: 'Asia/Damascus', + gmt_offset: [10800, 8712, 7200] +}; + +export const Danmarkshavn: TimeZone = { + zone_name: 'America/Danmarkshavn', + gmt_offset: [0, -4480, -7200, -10800] +}; + +export const Dar_es_Salaam: TimeZone = { + zone_name: 'Africa/Dar_es_Salaam', + gmt_offset: [10800, 9900, 9428] +}; + +export const Darwin: TimeZone = { + zone_name: 'Australia/Darwin', + gmt_offset: [37800, 34200, 32400, 31400] +}; + +export const Davis: TimeZone = { + zone_name: 'Antarctica/Davis', + gmt_offset: [25200, 18000, 0] +}; + +export const Dawson: TimeZone = { + zone_name: 'America/Dawson', + gmt_offset: [-25200, -28800, -32400, -33460] +}; + +export const Dawson_Creek: TimeZone = { + zone_name: 'America/Dawson_Creek', + gmt_offset: [-25200, -28800, -28856] +}; + +export const Denver: TimeZone = { + zone_name: 'America/Denver', + gmt_offset: [-21600, -25196, -25200] +}; + +export const Detroit: TimeZone = { + zone_name: 'America/Detroit', + gmt_offset: [-14400, -18000, -19931, -21600] +}; + +export const Dhaka: TimeZone = { + zone_name: 'Asia/Dhaka', + gmt_offset: [25200, 23400, 21700, 21600, 21200, 19800] +}; + +export const Dili: TimeZone = { + zone_name: 'Asia/Dili', + gmt_offset: [32400, 30140, 28800] +}; + +export const Djibouti: TimeZone = { + zone_name: 'Africa/Djibouti', + gmt_offset: [10800, 10356] +}; + +export const Dominica: TimeZone = { + zone_name: 'America/Dominica', + gmt_offset: [-14400, -14736] +}; + +export const Douala: TimeZone = { + zone_name: 'Africa/Douala', + gmt_offset: [3600, 2328] +}; + +export const Dubai: TimeZone = { + zone_name: 'Asia/Dubai', + gmt_offset: [14400, 13272] +}; + +export const Dublin: TimeZone = { + zone_name: 'Europe/Dublin', + gmt_offset: [3600, 2079, 0, -1521] +}; + +export const DumontDUrville: TimeZone = { + zone_name: 'Antarctica/DumontDUrville', + gmt_offset: [36000, 0] +}; + +export const Dushanbe: TimeZone = { + zone_name: 'Asia/Dushanbe', + gmt_offset: [25200, 21600, 18000, 16512] +}; + +export const Easter: TimeZone = { + zone_name: 'Pacific/Easter', + gmt_offset: [-18000, -21600, -25200, -26248] +}; + +export const Edmonton: TimeZone = { + zone_name: 'America/Edmonton', + gmt_offset: [-21600, -25200, -27232] +}; + +export const Efate: TimeZone = { + zone_name: 'Pacific/Efate', + gmt_offset: [43200, 40396, 39600] +}; + +export const Eirunepe: TimeZone = { + zone_name: 'America/Eirunepe', + gmt_offset: [-14400, -16768, -18000] +}; + +export const El_Aaiun: TimeZone = { + zone_name: 'Africa/El_Aaiun', + gmt_offset: [3600, 0, -3168, -3600] +}; + +export const El_Salvador: TimeZone = { + zone_name: 'America/El_Salvador', + gmt_offset: [-18000, -21408, -21600] +}; + +export const Eucla: TimeZone = { + zone_name: 'Australia/Eucla', + gmt_offset: [35100, 31500, 30928] +}; + +export const Fakaofo: TimeZone = { + zone_name: 'Pacific/Fakaofo', + gmt_offset: [46800, -39600, -41096] +}; + +export const Famagusta: TimeZone = { + zone_name: 'Asia/Famagusta', + gmt_offset: [10800, 8148, 7200] +}; + +export const Faroe: TimeZone = { + zone_name: 'Atlantic/Faroe', + gmt_offset: [3600, 0, -1624] +}; + +export const Fiji: TimeZone = { + zone_name: 'Pacific/Fiji', + gmt_offset: [46800, 43200, 42944] +}; + +export const Fort_Nelson: TimeZone = { + zone_name: 'America/Fort_Nelson', + gmt_offset: [-25200, -28800, -29447] +}; + +export const Fortaleza: TimeZone = { + zone_name: 'America/Fortaleza', + gmt_offset: [-7200, -9240, -10800] +}; + +export const Freetown: TimeZone = { + zone_name: 'Africa/Freetown', + gmt_offset: [0, -2400, -3180, -3600] +}; + +export const Funafuti: TimeZone = { + zone_name: 'Pacific/Funafuti', + gmt_offset: [43200, 43012] +}; + +export const Gaborone: TimeZone = { + zone_name: 'Africa/Gaborone', + gmt_offset: [10800, 7200, 6220, 5400] +}; + +export const Galapagos: TimeZone = { + zone_name: 'Pacific/Galapagos', + gmt_offset: [-18000, -21504, -21600] +}; + +export const Gambier: TimeZone = { + zone_name: 'Pacific/Gambier', + gmt_offset: [-32388, -32400] +}; + +export const Gaza: TimeZone = { + zone_name: 'Asia/Gaza', + gmt_offset: [10800, 8272, 7200] +}; + +export const Gibraltar: TimeZone = { + zone_name: 'Europe/Gibraltar', + gmt_offset: [7200, 3600, 0, -1284] +}; + +export const Glace_Bay: TimeZone = { + zone_name: 'America/Glace_Bay', + gmt_offset: [-10800, -14388, -14400] +}; + +export const Goose_Bay: TimeZone = { + zone_name: 'America/Goose_Bay', + gmt_offset: [-7200, -9000, -9052, -10800, -12600, -12652, -14400, -14500] +}; + +export const Grand_Turk: TimeZone = { + zone_name: 'America/Grand_Turk', + gmt_offset: [-14400, -17072, -18000, -18430] +}; + +export const Grenada: TimeZone = { + zone_name: 'America/Grenada', + gmt_offset: [-14400, -14820] +}; + +export const Guadalcanal: TimeZone = { + zone_name: 'Pacific/Guadalcanal', + gmt_offset: [39600, 38388] +}; + +export const Guadeloupe: TimeZone = { + zone_name: 'America/Guadeloupe', + gmt_offset: [-14400, -14768] +}; + +export const Guam: TimeZone = { + zone_name: 'Pacific/Guam', + gmt_offset: [39600, 36000, 34740, 32400, -51660] +}; + +export const Guatemala: TimeZone = { + zone_name: 'America/Guatemala', + gmt_offset: [-18000, -21600, -21724] +}; + +export const Guayaquil: TimeZone = { + zone_name: 'America/Guayaquil', + gmt_offset: [-14400, -18000, -18840, -19160] +}; + +export const Guernsey: TimeZone = { + zone_name: 'Europe/Guernsey', + gmt_offset: [7200, 3600, 0, -609] +}; + +export const Guyana: TimeZone = { + zone_name: 'America/Guyana', + gmt_offset: [-10800, -13500, -13959, -14400] +}; + +export const Halifax: TimeZone = { + zone_name: 'America/Halifax', + gmt_offset: [-10800, -14400, -15264] +}; + +export const Harare: TimeZone = { + zone_name: 'Africa/Harare', + gmt_offset: [7452, 7200] +}; + +export const Havana: TimeZone = { + zone_name: 'America/Havana', + gmt_offset: [-14400, -18000, -19768, -19776] +}; + +export const Hebron: TimeZone = { + zone_name: 'Asia/Hebron', + gmt_offset: [10800, 8423, 7200] +}; + +export const Helsinki: TimeZone = { + zone_name: 'Europe/Helsinki', + gmt_offset: [10800, 7200, 5989] +}; + +export const Hermosillo: TimeZone = { + zone_name: 'America/Hermosillo', + gmt_offset: [-21600, -25200, -26632] +}; + +export const Ho_Chi_Minh: TimeZone = { + zone_name: 'Asia/Ho_Chi_Minh', + gmt_offset: [32400, 28800, 25590, 25200] +}; + +export const Hobart: TimeZone = { + zone_name: 'Australia/Hobart', + gmt_offset: [39600, 36000, 35356] +}; + +export const Hong_Kong: TimeZone = { + zone_name: 'Asia/Hong_Kong', + gmt_offset: [32400, 30600, 28800, 27402] +}; + +export const Honolulu: TimeZone = { + zone_name: 'Pacific/Honolulu', + gmt_offset: [-34200, -36000, -37800, -37886] +}; + +export const Hovd: TimeZone = { + zone_name: 'Asia/Hovd', + gmt_offset: [28800, 25200, 21996, 21600] +}; + +export const Indianapolis: TimeZone = { + zone_name: 'America/Indiana/Indianapolis', + gmt_offset: [-14400, -18000, -20678, -21600] +}; + +export const Inuvik: TimeZone = { + zone_name: 'America/Inuvik', + gmt_offset: [0, -21600, -25200, -28800] +}; + +export const Iqaluit: TimeZone = { + zone_name: 'America/Iqaluit', + gmt_offset: [0, -14400, -18000, -21600] +}; + +export const Irkutsk: TimeZone = { + zone_name: 'Asia/Irkutsk', + gmt_offset: [32400, 28800, 25200, 25025] +}; + +export const Isle_of_Man: TimeZone = { + zone_name: 'Europe/Isle_of_Man', + gmt_offset: [7200, 3600, 0, -1075] +}; + +export const Istanbul: TimeZone = { + zone_name: 'Europe/Istanbul', + gmt_offset: [14400, 10800, 7200, 7016, 6952] +}; + +export const Jakarta: TimeZone = { + zone_name: 'Asia/Jakarta', + gmt_offset: [32400, 28800, 27000, 26400, 25632, 25200] +}; + +export const Jamaica: TimeZone = { + zone_name: 'America/Jamaica', + gmt_offset: [-14400, -18000, -18430] +}; + +export const Jayapura: TimeZone = { + zone_name: 'Asia/Jayapura', + gmt_offset: [34200, 33768, 32400] +}; + +export const Jersey: TimeZone = { + zone_name: 'Europe/Jersey', + gmt_offset: [7200, 3600, 0, -506] +}; + +export const Jerusalem: TimeZone = { + zone_name: 'Asia/Jerusalem', + gmt_offset: [14400, 10800, 8454, 8440, 7200] +}; + +export const Johannesburg: TimeZone = { + zone_name: 'Africa/Johannesburg', + gmt_offset: [10800, 7200, 6720, 5400] +}; + +export const Juba: TimeZone = { + zone_name: 'Africa/Juba', + gmt_offset: [10800, 7588, 7200] +}; + +export const Jujuy: TimeZone = { + zone_name: 'America/Argentina/Jujuy', + gmt_offset: [-7200, -10800, -14400, -15408, -15672] +}; + +export const Juneau: TimeZone = { + zone_name: 'America/Juneau', + gmt_offset: [54139, -25200, -28800, -32261, -32400] +}; + +export const Kabul: TimeZone = { + zone_name: 'Asia/Kabul', + gmt_offset: [16608, 16200, 14400] +}; + +export const Kaliningrad: TimeZone = { + zone_name: 'Europe/Kaliningrad', + gmt_offset: [14400, 10800, 7200, 4920, 3600] +}; + +export const Kamchatka: TimeZone = { + zone_name: 'Asia/Kamchatka', + gmt_offset: [46800, 43200, 39600, 38076] +}; + +export const Kampala: TimeZone = { + zone_name: 'Africa/Kampala', + gmt_offset: [10800, 9900, 9000, 7780] +}; + +export const Kanton: TimeZone = { + zone_name: 'Pacific/Kanton', + gmt_offset: [46800, 0, -39600, -43200] +}; + +export const Karachi: TimeZone = { + zone_name: 'Asia/Karachi', + gmt_offset: [23400, 21600, 19800, 18000, 16092] +}; + +export const Kathmandu: TimeZone = { + zone_name: 'Asia/Kathmandu', + gmt_offset: [20700, 20476, 19800] +}; + +export const Kerguelen: TimeZone = { + zone_name: 'Indian/Kerguelen', + gmt_offset: [18000, 0] +}; + +export const Khandyga: TimeZone = { + zone_name: 'Asia/Khandyga', + gmt_offset: [39600, 36000, 32533, 32400, 28800] +}; + +export const Khartoum: TimeZone = { + zone_name: 'Africa/Khartoum', + gmt_offset: [10800, 7808, 7200] +}; + +export const Kigali: TimeZone = { + zone_name: 'Africa/Kigali', + gmt_offset: [7216, 7200] +}; + +export const Kinshasa: TimeZone = { + zone_name: 'Africa/Kinshasa', + gmt_offset: [3672, 3600] +}; + +export const Kiritimati: TimeZone = { + zone_name: 'Pacific/Kiritimati', + gmt_offset: [50400, -36000, -37760, -38400] +}; + +export const Kirov: TimeZone = { + zone_name: 'Europe/Kirov', + gmt_offset: [18000, 14400, 11928, 10800] +}; + +export const Knox: TimeZone = { + zone_name: 'America/Indiana/Knox', + gmt_offset: [-18000, -20790, -21600] +}; + +export const Kolkata: TimeZone = { + zone_name: 'Asia/Kolkata', + gmt_offset: [23400, 21208, 21200, 19800, 19270] +}; + +export const Kosrae: TimeZone = { + zone_name: 'Pacific/Kosrae', + gmt_offset: [43200, 39600, 39116, 36000, 32400, -47284] +}; + +export const Kralendijk: TimeZone = { + zone_name: 'America/Kralendijk', + gmt_offset: [-10800, -14400, -15865] +}; + +export const Krasnoyarsk: TimeZone = { + zone_name: 'Asia/Krasnoyarsk', + gmt_offset: [28800, 25200, 22286, 21600] +}; + +export const Kuala_Lumpur: TimeZone = { + zone_name: 'Asia/Kuala_Lumpur', + gmt_offset: [32400, 28800, 27000, 26400, 25200, 24925, 24406] +}; + +export const Kuching: TimeZone = { + zone_name: 'Asia/Kuching', + gmt_offset: [32400, 30000, 28800, 27000, 26480] +}; + +export const Kuwait: TimeZone = { + zone_name: 'Asia/Kuwait', + gmt_offset: [11516, 10800] +}; + +export const Kwajalein: TimeZone = { + zone_name: 'Pacific/Kwajalein', + gmt_offset: [43200, 40160, 39600, 36000, 32400, -43200] +}; + +export const Kyiv: TimeZone = { + zone_name: 'Europe/Kyiv', + gmt_offset: [14400, 10800, 7324, 7200, 3600] +}; + +export const La_Paz: TimeZone = { + zone_name: 'America/La_Paz', + gmt_offset: [-12756, -14400, -16356] +}; + +export const La_Rioja: TimeZone = { + zone_name: 'America/Argentina/La_Rioja', + gmt_offset: [-7200, -10800, -14400, -15408, -16044] +}; + +export const Lagos: TimeZone = { + zone_name: 'Africa/Lagos', + gmt_offset: [3600, 1800, 815, 0] +}; + +export const Libreville: TimeZone = { + zone_name: 'Africa/Libreville', + gmt_offset: [3600, 2268] +}; + +export const Lima: TimeZone = { + zone_name: 'America/Lima', + gmt_offset: [-14400, -18000, -18492, -18516] +}; + +export const Lindeman: TimeZone = { + zone_name: 'Australia/Lindeman', + gmt_offset: [39600, 36000, 35756] +}; + +export const Lisbon: TimeZone = { + zone_name: 'Europe/Lisbon', + gmt_offset: [7200, 3600, 0, -2205] +}; + +export const Ljubljana: TimeZone = { + zone_name: 'Europe/Ljubljana', + gmt_offset: [7200, 3600, 3484] +}; + +export const Lome: TimeZone = { + zone_name: 'Africa/Lome', + gmt_offset: [292, 0] +}; + +export const London: TimeZone = { + zone_name: 'Europe/London', + gmt_offset: [7200, 3600, 0, -75] +}; + +export const Longyearbyen: TimeZone = { + zone_name: 'Arctic/Longyearbyen', + gmt_offset: [10800, 7200, 3600, 3208] +}; + +export const Lord_Howe: TimeZone = { + zone_name: 'Australia/Lord_Howe', + gmt_offset: [41400, 39600, 38180, 37800, 36000] +}; + +export const Los_Angeles: TimeZone = { + zone_name: 'America/Los_Angeles', + gmt_offset: [-25200, -28378, -28800] +}; + +export const Louisville: TimeZone = { + zone_name: 'America/Kentucky/Louisville', + gmt_offset: [-14400, -18000, -20582, -21600] +}; + +export const Lower_Princes: TimeZone = { + zone_name: 'America/Lower_Princes', + gmt_offset: [-10800, -14400, -15865] +}; + +export const Luanda: TimeZone = { + zone_name: 'Africa/Luanda', + gmt_offset: [3600, 3176, 3124] +}; + +export const Lubumbashi: TimeZone = { + zone_name: 'Africa/Lubumbashi', + gmt_offset: [7200, 6592, 3600] +}; + +export const Lusaka: TimeZone = { + zone_name: 'Africa/Lusaka', + gmt_offset: [7200, 6788] +}; + +export const Luxembourg: TimeZone = { + zone_name: 'Europe/Luxembourg', + gmt_offset: [7200, 3600, 1476, 0] +}; + +export const Macau: TimeZone = { + zone_name: 'Asia/Macau', + gmt_offset: [36000, 32400, 28800, 27250] +}; + +export const Maceio: TimeZone = { + zone_name: 'America/Maceio', + gmt_offset: [-7200, -8572, -10800] +}; + +export const Macquarie: TimeZone = { + zone_name: 'Antarctica/Macquarie', + gmt_offset: [39600, 36000, 0] +}; + +export const Madeira: TimeZone = { + zone_name: 'Atlantic/Madeira', + gmt_offset: [3600, 0, -3600, -4056] +}; + +export const Madrid: TimeZone = { + zone_name: 'Europe/Madrid', + gmt_offset: [7200, 3600, 0, -884] +}; + +export const Magadan: TimeZone = { + zone_name: 'Asia/Magadan', + gmt_offset: [43200, 39600, 36192, 36000] +}; + +export const Mahe: TimeZone = { + zone_name: 'Indian/Mahe', + gmt_offset: [14400, 13308] +}; + +export const Majuro: TimeZone = { + zone_name: 'Pacific/Majuro', + gmt_offset: [43200, 41088, 39600, 36000, 32400] +}; + +export const Makassar: TimeZone = { + zone_name: 'Asia/Makassar', + gmt_offset: [32400, 28800, 28656] +}; + +export const Malabo: TimeZone = { + zone_name: 'Africa/Malabo', + gmt_offset: [3600, 2108, 0] +}; + +export const Maldives: TimeZone = { + zone_name: 'Indian/Maldives', + gmt_offset: [18000, 17640] +}; + +export const Malta: TimeZone = { + zone_name: 'Europe/Malta', + gmt_offset: [7200, 3600, 3484] +}; + +export const Managua: TimeZone = { + zone_name: 'America/Managua', + gmt_offset: [-18000, -20708, -20712, -21600] +}; + +export const Manaus: TimeZone = { + zone_name: 'America/Manaus', + gmt_offset: [-10800, -14400, -14404] +}; + +export const Manila: TimeZone = { + zone_name: 'Asia/Manila', + gmt_offset: [32400, 29032, 28800, -57368] +}; + +export const Maputo: TimeZone = { + zone_name: 'Africa/Maputo', + gmt_offset: [7818, 7200] +}; + +export const Marengo: TimeZone = { + zone_name: 'America/Indiana/Marengo', + gmt_offset: [-14400, -18000, -20723, -21600] +}; + +export const Mariehamn: TimeZone = { + zone_name: 'Europe/Mariehamn', + gmt_offset: [10800, 7200, 5989] +}; + +export const Marigot: TimeZone = { + zone_name: 'America/Marigot', + gmt_offset: [-10800, -14400, -15865] +}; + +export const Marquesas: TimeZone = { + zone_name: 'Pacific/Marquesas', + gmt_offset: [-33480, -34200] +}; + +export const Martinique: TimeZone = { + zone_name: 'America/Martinique', + gmt_offset: [-10800, -14400, -14660] +}; + +export const Maseru: TimeZone = { + zone_name: 'Africa/Maseru', + gmt_offset: [10800, 7200, 6600] +}; + +export const Matamoros: TimeZone = { + zone_name: 'America/Matamoros', + gmt_offset: [-18000, -21600, -23400] +}; + +export const Mauritius: TimeZone = { + zone_name: 'Indian/Mauritius', + gmt_offset: [18000, 14400, 13800] +}; + +export const Mawson: TimeZone = { + zone_name: 'Antarctica/Mawson', + gmt_offset: [21600, 18000, 0] +}; + +export const Mayotte: TimeZone = { + zone_name: 'Indian/Mayotte', + gmt_offset: [10856, 10800] +}; + +export const Mazatlan: TimeZone = { + zone_name: 'America/Mazatlan', + gmt_offset: [-21600, -25200, -25540] +}; + +export const Mbabane: TimeZone = { + zone_name: 'Africa/Mbabane', + gmt_offset: [7464, 7200] +}; + +export const McMurdo: TimeZone = { + zone_name: 'Antarctica/McMurdo', + gmt_offset: [46800, 43200] +}; + +export const Melbourne: TimeZone = { + zone_name: 'Australia/Melbourne', + gmt_offset: [39600, 36000, 34792] +}; + +export const Mendoza: TimeZone = { + zone_name: 'America/Argentina/Mendoza', + gmt_offset: [-7200, -10800, -14400, -15408, -16516] +}; + +export const Menominee: TimeZone = { + zone_name: 'America/Menominee', + gmt_offset: [-18000, -21027, -21600] +}; + +export const Merida: TimeZone = { + zone_name: 'America/Merida', + gmt_offset: [-18000, -21508, -21600] +}; + +export const Metlakatla: TimeZone = { + zone_name: 'America/Metlakatla', + gmt_offset: [54822, -25200, -28800, -31578, -32400] +}; + +export const Mexico_City: TimeZone = { + zone_name: 'America/Mexico_City', + gmt_offset: [-18000, -21600, -23796, -25200] +}; + +export const Midway: TimeZone = { + zone_name: 'Pacific/Midway', + gmt_offset: [-36000, -39600, -42568] +}; + +export const Minsk: TimeZone = { + zone_name: 'Europe/Minsk', + gmt_offset: [14400, 10800, 7200, 6616, 6600, 3600] +}; + +export const Miquelon: TimeZone = { + zone_name: 'America/Miquelon', + gmt_offset: [-7200, -10800, -13480, -14400] +}; + +export const Mogadishu: TimeZone = { + zone_name: 'Africa/Mogadishu', + gmt_offset: [10888, 10800, 9000] +}; + +export const Monaco: TimeZone = { + zone_name: 'Europe/Monaco', + gmt_offset: [7200, 3600, 1772, 561, 0] +}; + +export const Moncton: TimeZone = { + zone_name: 'America/Moncton', + gmt_offset: [-10800, -14400, -15548, -18000] +}; + +export const Monrovia: TimeZone = { + zone_name: 'Africa/Monrovia', + gmt_offset: [0, -2588, -2670] +}; + +export const Monterrey: TimeZone = { + zone_name: 'America/Monterrey', + gmt_offset: [-18000, -21600, -24076, -25200] +}; + +export const Montevideo: TimeZone = { + zone_name: 'America/Montevideo', + gmt_offset: [-5400, -7200, -9000, -10800, -12600, -13491, -14400] +}; + +export const Monticello: TimeZone = { + zone_name: 'America/Kentucky/Monticello', + gmt_offset: [-14400, -18000, -20364, -21600] +}; + +export const Montserrat: TimeZone = { + zone_name: 'America/Montserrat', + gmt_offset: [-14400, -14932] +}; + +export const Moscow: TimeZone = { + zone_name: 'Europe/Moscow', + gmt_offset: [18000, 16279, 14400, 12679, 10800, 9079, 9017, 7200] +}; + +export const Muscat: TimeZone = { + zone_name: 'Asia/Muscat', + gmt_offset: [14400, 14064] +}; + +export const Nairobi: TimeZone = { + zone_name: 'Africa/Nairobi', + gmt_offset: [10800, 9900, 9000, 8836] +}; + +export const Nassau: TimeZone = { + zone_name: 'America/Nassau', + gmt_offset: [-14400, -18000, -18570] +}; + +export const Nauru: TimeZone = { + zone_name: 'Pacific/Nauru', + gmt_offset: [43200, 41400, 40060, 32400] +}; + +export const Ndjamena: TimeZone = { + zone_name: 'Africa/Ndjamena', + gmt_offset: [7200, 3612, 3600] +}; + +export const New_Salem: TimeZone = { + zone_name: 'America/North_Dakota/New_Salem', + gmt_offset: [-18000, -21600, -24339, -25200] +}; + +export const New_York: TimeZone = { + zone_name: 'America/New_York', + gmt_offset: [-14400, -17762, -18000] +}; + +export const Niamey: TimeZone = { + zone_name: 'Africa/Niamey', + gmt_offset: [3600, 508, 0, -3600] +}; + +export const Nicosia: TimeZone = { + zone_name: 'Asia/Nicosia', + gmt_offset: [10800, 8008, 7200] +}; + +export const Niue: TimeZone = { + zone_name: 'Pacific/Niue', + gmt_offset: [-39600, -40780, -40800] +}; + +export const Nome: TimeZone = { + zone_name: 'America/Nome', + gmt_offset: [46702, -28800, -32400, -36000, -39600, -39698] +}; + +export const Norfolk: TimeZone = { + zone_name: 'Pacific/Norfolk', + gmt_offset: [45000, 43200, 41400, 40320, 40312, 39600] +}; + +export const Noronha: TimeZone = { + zone_name: 'America/Noronha', + gmt_offset: [-3600, -7200, -7780] +}; + +export const Nouakchott: TimeZone = { + zone_name: 'Africa/Nouakchott', + gmt_offset: [0, -3600, -3828] +}; + +export const Noumea: TimeZone = { + zone_name: 'Pacific/Noumea', + gmt_offset: [43200, 39948, 39600] +}; + +export const Novokuznetsk: TimeZone = { + zone_name: 'Asia/Novokuznetsk', + gmt_offset: [28800, 25200, 21600, 20928] +}; + +export const Novosibirsk: TimeZone = { + zone_name: 'Asia/Novosibirsk', + gmt_offset: [28800, 25200, 21600, 19900] +}; + +export const Nuuk: TimeZone = { + zone_name: 'America/Nuuk', + gmt_offset: [-3600, -7200, -10800, -12416] +}; + +export const Ojinaga: TimeZone = { + zone_name: 'America/Ojinaga', + gmt_offset: [-18000, -21600, -25060, -25200] +}; + +export const Omsk: TimeZone = { + zone_name: 'Asia/Omsk', + gmt_offset: [25200, 21600, 18000, 17610] +}; + +export const Oral: TimeZone = { + zone_name: 'Asia/Oral', + gmt_offset: [21600, 18000, 14400, 12324, 10800] +}; + +export const Oslo: TimeZone = { + zone_name: 'Europe/Oslo', + gmt_offset: [7200, 3600, 2580] +}; + +export const Ouagadougou: TimeZone = { + zone_name: 'Africa/Ouagadougou', + gmt_offset: [0, -364] +}; + +export const Pago_Pago: TimeZone = { + zone_name: 'Pacific/Pago_Pago', + gmt_offset: [45432, -39600, -40968] +}; + +export const Palau: TimeZone = { + zone_name: 'Pacific/Palau', + gmt_offset: [32400, 32276, -54124] +}; + +export const Palmer: TimeZone = { + zone_name: 'Antarctica/Palmer', + gmt_offset: [0, -7200, -10800, -14400] +}; + +export const Panama: TimeZone = { + zone_name: 'America/Panama', + gmt_offset: [-18000, -19088, -19176] +}; + +export const Paramaribo: TimeZone = { + zone_name: 'America/Paramaribo', + gmt_offset: [-10800, -12600, -13236, -13240, -13252] +}; + +export const Paris: TimeZone = { + zone_name: 'Europe/Paris', + gmt_offset: [7200, 3600, 561, 0] +}; + +export const Perth: TimeZone = { + zone_name: 'Australia/Perth', + gmt_offset: [32400, 28800, 27804] +}; + +export const Petersburg: TimeZone = { + zone_name: 'America/Indiana/Petersburg', + gmt_offset: [-14400, -18000, -20947, -21600] +}; + +export const Phnom_Penh: TimeZone = { + zone_name: 'Asia/Phnom_Penh', + gmt_offset: [32400, 28800, 25590, 25200, 25180] +}; + +export const Phoenix: TimeZone = { + zone_name: 'America/Phoenix', + gmt_offset: [-21600, -25200, -26898] +}; + +export const Pitcairn: TimeZone = { + zone_name: 'Pacific/Pitcairn', + gmt_offset: [-28800, -30600, -31220] +}; + +export const Podgorica: TimeZone = { + zone_name: 'Europe/Podgorica', + gmt_offset: [7200, 4920, 3600] +}; + +export const Pohnpei: TimeZone = { + zone_name: 'Pacific/Pohnpei', + gmt_offset: [39600, 37972, 36000, 32400, -48428] +}; + +export const Pontianak: TimeZone = { + zone_name: 'Asia/Pontianak', + gmt_offset: [32400, 28800, 27000, 26240, 25200] +}; + +export const Port_Moresby: TimeZone = { + zone_name: 'Pacific/Port_Moresby', + gmt_offset: [36000, 35320, 35312] +}; + +export const Port_of_Spain: TimeZone = { + zone_name: 'America/Port_of_Spain', + gmt_offset: [-14400, -14764] +}; + +export const Port_au_Prince: TimeZone = { + zone_name: 'America/Port-au-Prince', + gmt_offset: [-14400, -17340, -17360, -18000] +}; + +export const Porto_Velho: TimeZone = { + zone_name: 'America/Porto_Velho', + gmt_offset: [-10800, -14400, -15336] +}; + +export const Porto_Novo: TimeZone = { + zone_name: 'Africa/Porto-Novo', + gmt_offset: [3600, 628, 0] +}; + +export const Prague: TimeZone = { + zone_name: 'Europe/Prague', + gmt_offset: [7200, 3600, 3464, 0] +}; + +export const Puerto_Rico: TimeZone = { + zone_name: 'America/Puerto_Rico', + gmt_offset: [-10800, -14400, -15865] +}; + +export const Punta_Arenas: TimeZone = { + zone_name: 'America/Punta_Arenas', + gmt_offset: [-10800, -14400, -16965, -17020, -18000] +}; + +export const Pyongyang: TimeZone = { + zone_name: 'Asia/Pyongyang', + gmt_offset: [32400, 30600, 30180] +}; + +export const Qatar: TimeZone = { + zone_name: 'Asia/Qatar', + gmt_offset: [14400, 12368, 10800] +}; + +export const Qostanay: TimeZone = { + zone_name: 'Asia/Qostanay', + gmt_offset: [21600, 18000, 15268, 14400] +}; + +export const Qyzylorda: TimeZone = { + zone_name: 'Asia/Qyzylorda', + gmt_offset: [21600, 18000, 15712, 14400] +}; + +export const Rankin_Inlet: TimeZone = { + zone_name: 'America/Rankin_Inlet', + gmt_offset: [0, -18000, -21600] +}; + +export const Rarotonga: TimeZone = { + zone_name: 'Pacific/Rarotonga', + gmt_offset: [48056, -34200, -36000, -37800, -38344] +}; + +export const Recife: TimeZone = { + zone_name: 'America/Recife', + gmt_offset: [-7200, -8376, -10800] +}; + +export const Regina: TimeZone = { + zone_name: 'America/Regina', + gmt_offset: [-21600, -25116, -25200] +}; + +export const Resolute: TimeZone = { + zone_name: 'America/Resolute', + gmt_offset: [0, -18000, -21600] +}; + +export const Reunion: TimeZone = { + zone_name: 'Indian/Reunion', + gmt_offset: [14400, 13312] +}; + +export const Reykjavik: TimeZone = { + zone_name: 'Atlantic/Reykjavik', + gmt_offset: [0, -3600, -5280] +}; + +export const Riga: TimeZone = { + zone_name: 'Europe/Riga', + gmt_offset: [14400, 10800, 9394, 7200, 5794, 3600] +}; + +export const Rio_Branco: TimeZone = { + zone_name: 'America/Rio_Branco', + gmt_offset: [-14400, -16272, -18000] +}; + +export const Rio_Gallegos: TimeZone = { + zone_name: 'America/Argentina/Rio_Gallegos', + gmt_offset: [-7200, -10800, -14400, -15408, -16612] +}; + +export const Riyadh: TimeZone = { + zone_name: 'Asia/Riyadh', + gmt_offset: [11212, 10800] +}; + +export const Rome: TimeZone = { + zone_name: 'Europe/Rome', + gmt_offset: [7200, 3600, 2996] +}; + +export const Rothera: TimeZone = { + zone_name: 'Antarctica/Rothera', + gmt_offset: [0, -10800] +}; + +export const Saipan: TimeZone = { + zone_name: 'Pacific/Saipan', + gmt_offset: [39600, 36000, 34980, 32400, -51420] +}; + +export const Sakhalin: TimeZone = { + zone_name: 'Asia/Sakhalin', + gmt_offset: [43200, 39600, 36000, 34248, 32400] +}; + +export const Salta: TimeZone = { + zone_name: 'America/Argentina/Salta', + gmt_offset: [-7200, -10800, -14400, -15408, -15700] +}; + +export const Samara: TimeZone = { + zone_name: 'Europe/Samara', + gmt_offset: [18000, 14400, 12020, 10800] +}; + +export const Samarkand: TimeZone = { + zone_name: 'Asia/Samarkand', + gmt_offset: [21600, 18000, 16073, 14400] +}; + +export const San_Juan: TimeZone = { + zone_name: 'America/Argentina/San_Juan', + gmt_offset: [-7200, -10800, -14400, -15408, -16444] +}; + +export const San_Luis: TimeZone = { + zone_name: 'America/Argentina/San_Luis', + gmt_offset: [-7200, -10800, -14400, -15408, -15924] +}; + +export const San_Marino: TimeZone = { + zone_name: 'Europe/San_Marino', + gmt_offset: [7200, 3600, 2996] +}; + +export const Santarem: TimeZone = { + zone_name: 'America/Santarem', + gmt_offset: [-10800, -13128, -14400] +}; + +export const Santiago: TimeZone = { + zone_name: 'America/Santiago', + gmt_offset: [-10800, -14400, -16965, -18000] +}; + +export const Santo_Domingo: TimeZone = { + zone_name: 'America/Santo_Domingo', + gmt_offset: [-14400, -16200, -16776, -16800, -18000] +}; + +export const Sao_Paulo: TimeZone = { + zone_name: 'America/Sao_Paulo', + gmt_offset: [-7200, -10800, -11188] +}; + +export const Sao_Tome: TimeZone = { + zone_name: 'Africa/Sao_Tome', + gmt_offset: [3600, 1616, 0, -2205] +}; + +export const Sarajevo: TimeZone = { + zone_name: 'Europe/Sarajevo', + gmt_offset: [7200, 4420, 3600] +}; + +export const Saratov: TimeZone = { + zone_name: 'Europe/Saratov', + gmt_offset: [18000, 14400, 11058, 10800] +}; + +export const Scoresbysund: TimeZone = { + zone_name: 'America/Scoresbysund', + gmt_offset: [0, -3600, -5272, -7200] +}; + +export const Seoul: TimeZone = { + zone_name: 'Asia/Seoul', + gmt_offset: [36000, 34200, 32400, 30600, 30472] +}; + +export const Shanghai: TimeZone = { + zone_name: 'Asia/Shanghai', + gmt_offset: [32400, 29143, 28800] +}; + +export const Simferopol: TimeZone = { + zone_name: 'Europe/Simferopol', + gmt_offset: [14400, 10800, 8184, 8160, 7200, 3600] +}; + +export const Singapore: TimeZone = { + zone_name: 'Asia/Singapore', + gmt_offset: [32400, 28800, 27000, 26400, 25200, 24925] +}; + +export const Sitka: TimeZone = { + zone_name: 'America/Sitka', + gmt_offset: [53927, -25200, -28800, -32400, -32473] +}; + +export const Skopje: TimeZone = { + zone_name: 'Europe/Skopje', + gmt_offset: [7200, 5144, 3600] +}; + +export const Sofia: TimeZone = { + zone_name: 'Europe/Sofia', + gmt_offset: [10800, 7200, 7016, 5596, 3600] +}; + +export const South_Georgia: TimeZone = { + zone_name: 'Atlantic/South_Georgia', + gmt_offset: [-7200, -8768] +}; + +export const Srednekolymsk: TimeZone = { + zone_name: 'Asia/Srednekolymsk', + gmt_offset: [43200, 39600, 36892, 36000] +}; + +export const St_Barthelemy: TimeZone = { + zone_name: 'America/St_Barthelemy', + gmt_offset: [-10800, -14400, -15865] +}; + +export const St_Helena: TimeZone = { + zone_name: 'Atlantic/St_Helena', + gmt_offset: [0, -1368] +}; + +export const St_Johns: TimeZone = { + zone_name: 'America/St_Johns', + gmt_offset: [-5400, -9000, -9052, -12600, -12652] +}; + +export const St_Kitts: TimeZone = { + zone_name: 'America/St_Kitts', + gmt_offset: [-14400, -15052] +}; + +export const St_Lucia: TimeZone = { + zone_name: 'America/St_Lucia', + gmt_offset: [-14400, -14640] +}; + +export const St_Thomas: TimeZone = { + zone_name: 'America/St_Thomas', + gmt_offset: [-14400, -15584] +}; + +export const St_Vincent: TimeZone = { + zone_name: 'America/St_Vincent', + gmt_offset: [-14400, -14696] +}; + +export const Stanley: TimeZone = { + zone_name: 'Atlantic/Stanley', + gmt_offset: [-7200, -10800, -13884, -14400] +}; + +export const Stockholm: TimeZone = { + zone_name: 'Europe/Stockholm', + gmt_offset: [7200, 4332, 3614, 3600] +}; + +export const Swift_Current: TimeZone = { + zone_name: 'America/Swift_Current', + gmt_offset: [-21600, -25200, -25880] +}; + +export const Sydney: TimeZone = { + zone_name: 'Australia/Sydney', + gmt_offset: [39600, 36292, 36000] +}; + +export const Syowa: TimeZone = { + zone_name: 'Antarctica/Syowa', + gmt_offset: [10800, 0] +}; + +export const Tahiti: TimeZone = { + zone_name: 'Pacific/Tahiti', + gmt_offset: [-35896, -36000] +}; + +export const Taipei: TimeZone = { + zone_name: 'Asia/Taipei', + gmt_offset: [32400, 29160, 28800] +}; + +export const Tallinn: TimeZone = { + zone_name: 'Europe/Tallinn', + gmt_offset: [14400, 10800, 7200, 5940, 3600] +}; + +export const Tarawa: TimeZone = { + zone_name: 'Pacific/Tarawa', + gmt_offset: [43200, 41524] +}; + +export const Tashkent: TimeZone = { + zone_name: 'Asia/Tashkent', + gmt_offset: [25200, 21600, 18000, 16631] +}; + +export const Tbilisi: TimeZone = { + zone_name: 'Asia/Tbilisi', + gmt_offset: [18000, 14400, 10800, 10751] +}; + +export const Tegucigalpa: TimeZone = { + zone_name: 'America/Tegucigalpa', + gmt_offset: [-18000, -20932, -21600] +}; + +export const Tehran: TimeZone = { + zone_name: 'Asia/Tehran', + gmt_offset: [18000, 16200, 14400, 12600, 12344] +}; + +export const Tell_City: TimeZone = { + zone_name: 'America/Indiana/Tell_City', + gmt_offset: [-14400, -18000, -20823, -21600] +}; + +export const Thimphu: TimeZone = { + zone_name: 'Asia/Thimphu', + gmt_offset: [21600, 21516, 19800] +}; + +export const Thule: TimeZone = { + zone_name: 'America/Thule', + gmt_offset: [-10800, -14400, -16508] +}; + +export const Tijuana: TimeZone = { + zone_name: 'America/Tijuana', + gmt_offset: [-25200, -28084, -28800] +}; + +export const Tirane: TimeZone = { + zone_name: 'Europe/Tirane', + gmt_offset: [7200, 4760, 3600] +}; + +export const Tokyo: TimeZone = { + zone_name: 'Asia/Tokyo', + gmt_offset: [36000, 33539, 32400] +}; + +export const Tomsk: TimeZone = { + zone_name: 'Asia/Tomsk', + gmt_offset: [28800, 25200, 21600, 20391] +}; + +export const Tongatapu: TimeZone = { + zone_name: 'Pacific/Tongatapu', + gmt_offset: [50400, 46800, 44400, 44352] +}; + +export const Toronto: TimeZone = { + zone_name: 'America/Toronto', + gmt_offset: [-14400, -18000, -19052] +}; + +export const Tortola: TimeZone = { + zone_name: 'America/Tortola', + gmt_offset: [-14400, -15508] +}; + +export const Tripoli: TimeZone = { + zone_name: 'Africa/Tripoli', + gmt_offset: [7200, 3600, 3164] +}; + +export const Troll: TimeZone = { + zone_name: 'Antarctica/Troll', + gmt_offset: [7200, 0] +}; + +export const Tucuman: TimeZone = { + zone_name: 'America/Argentina/Tucuman', + gmt_offset: [-7200, -10800, -14400, -15408, -15652] +}; + +export const Tunis: TimeZone = { + zone_name: 'Africa/Tunis', + gmt_offset: [7200, 3600, 2444, 561] +}; + +export const Ulaanbaatar: TimeZone = { + zone_name: 'Asia/Ulaanbaatar', + gmt_offset: [32400, 28800, 25652, 25200] +}; + +export const Ulyanovsk: TimeZone = { + zone_name: 'Europe/Ulyanovsk', + gmt_offset: [18000, 14400, 11616, 10800, 7200] +}; + +export const Urumqi: TimeZone = { + zone_name: 'Asia/Urumqi', + gmt_offset: [21600, 21020] +}; + +export const Ushuaia: TimeZone = { + zone_name: 'America/Argentina/Ushuaia', + gmt_offset: [-7200, -10800, -14400, -15408, -16392] +}; + +export const Ust_Nera: TimeZone = { + zone_name: 'Asia/Ust-Nera', + gmt_offset: [43200, 39600, 36000, 34374, 32400, 28800] +}; + +export const Vaduz: TimeZone = { + zone_name: 'Europe/Vaduz', + gmt_offset: [7200, 3600, 2284] +}; + +export const Vancouver: TimeZone = { + zone_name: 'America/Vancouver', + gmt_offset: [-25200, -28800, -29548] +}; + +export const Vatican: TimeZone = { + zone_name: 'Europe/Vatican', + gmt_offset: [7200, 3600, 2996] +}; + +export const Vevay: TimeZone = { + zone_name: 'America/Indiana/Vevay', + gmt_offset: [-14400, -18000, -20416, -21600] +}; + +export const Vienna: TimeZone = { + zone_name: 'Europe/Vienna', + gmt_offset: [7200, 3921, 3600] +}; + +export const Vientiane: TimeZone = { + zone_name: 'Asia/Vientiane', + gmt_offset: [32400, 28800, 25590, 25200, 24624] +}; + +export const Vilnius: TimeZone = { + zone_name: 'Europe/Vilnius', + gmt_offset: [14400, 10800, 7200, 6076, 5736, 5040, 3600] +}; + +export const Vincennes: TimeZone = { + zone_name: 'America/Indiana/Vincennes', + gmt_offset: [-14400, -18000, -21007, -21600] +}; + +export const Vladivostok: TimeZone = { + zone_name: 'Asia/Vladivostok', + gmt_offset: [39600, 36000, 32400, 31651] +}; + +export const Volgograd: TimeZone = { + zone_name: 'Europe/Volgograd', + gmt_offset: [18000, 14400, 10800, 10660] +}; + +export const Vostok: TimeZone = { + zone_name: 'Antarctica/Vostok', + gmt_offset: [25200, 18000, 0] +}; + +export const Wake: TimeZone = { + zone_name: 'Pacific/Wake', + gmt_offset: [43200, 39988] +}; + +export const Wallis: TimeZone = { + zone_name: 'Pacific/Wallis', + gmt_offset: [44120, 43200] +}; + +export const Warsaw: TimeZone = { + zone_name: 'Europe/Warsaw', + gmt_offset: [10800, 7200, 5040, 3600] +}; + +export const Whitehorse: TimeZone = { + zone_name: 'America/Whitehorse', + gmt_offset: [-25200, -28800, -32400, -32412] +}; + +export const Winamac: TimeZone = { + zone_name: 'America/Indiana/Winamac', + gmt_offset: [-14400, -18000, -20785, -21600] +}; + +export const Windhoek: TimeZone = { + zone_name: 'Africa/Windhoek', + gmt_offset: [10800, 7200, 5400, 4104, 3600] +}; + +export const Winnipeg: TimeZone = { + zone_name: 'America/Winnipeg', + gmt_offset: [-18000, -21600, -23316] +}; + +export const Yakutat: TimeZone = { + zone_name: 'America/Yakutat', + gmt_offset: [52865, -28800, -32400, -33535] +}; -export const isTimeZone = (timeZone?: TimeZone | 'UTC'): timeZone is TimeZone => { - return typeof timeZone === 'object' && 'zone_name' in timeZone && 'gmt_offset' in timeZone; +export const Yakutsk: TimeZone = { + zone_name: 'Asia/Yakutsk', + gmt_offset: [36000, 32400, 31138, 28800] }; -export const isUTC = (timeZone?: TimeZone | 'UTC'): timeZone is 'UTC' => { - return timeZone === 'UTC'; +export const Yangon: TimeZone = { + zone_name: 'Asia/Yangon', + gmt_offset: [32400, 23400, 23087] }; -const getTimezoneOffset = (utcTime: number, timeZone: TimeZone): number => { - const utc = getDateTimeFormat('UTC'); - const tz = getDateTimeFormat(timeZone.zone_name); - const offset = timeZone.gmt_offset; +export const Yekaterinburg: TimeZone = { + zone_name: 'Asia/Yekaterinburg', + gmt_offset: [21600, 18000, 14553, 14400, 13505] +}; - // Try to find the correct offset by checking the current and previous days. - for (let i = 0; i < 2; i++) { - const targetString = utc.format(utcTime - i * 86400 * 1000); +export const Yerevan: TimeZone = { + zone_name: 'Asia/Yerevan', + gmt_offset: [18000, 14400, 10800, 10680] +}; - for (let j = 0, len = offset.length; j < len; j++) { - if (tz.format(utcTime - (offset[j] + i * 86400) * 1000) === targetString) { - return offset[j]; - } - } - } - return NaN; +export const Zagreb: TimeZone = { + zone_name: 'Europe/Zagreb', + gmt_offset: [7200, 3832, 3600] }; -export const createTimezoneDate = (utcTime: number, timeZone: TimeZone) => new Date(utcTime - getTimezoneOffset(utcTime, timeZone) * 1000); +export const Zurich: TimeZone = { + zone_name: 'Europe/Zurich', + gmt_offset: [7200, 3600, 2048, 1786] +}; diff --git a/src/zone.ts b/src/zone.ts new file mode 100644 index 0000000..f1e07fb --- /dev/null +++ b/src/zone.ts @@ -0,0 +1,34 @@ +import { getDateTimeFormat } from './dtf.ts'; + +export interface TimeZone { + zone_name: string; + gmt_offset: number[]; +} + +export const isTimeZone = (timeZone: unknown): timeZone is TimeZone => { + return !!timeZone && typeof timeZone === 'object' && 'zone_name' in timeZone && 'gmt_offset' in timeZone; +}; + +export const isUTC = (timeZone: unknown): timeZone is 'UTC' => { + return typeof timeZone === 'string' && timeZone.toUpperCase() === 'UTC'; +}; + +const getTimezoneOffset = (utcTime: number, timeZone: TimeZone): number => { + const utc = getDateTimeFormat('UTC'); + const tz = getDateTimeFormat(timeZone.zone_name); + const offset = timeZone.gmt_offset; + + // Try to find the correct offset by checking the current and previous days. + for (let i = 0; i < 2; i++) { + const targetString = utc.format(utcTime - i * 86400 * 1000); + + for (let j = 0, len = offset.length; j < len; j++) { + if (tz.format(utcTime - (offset[j] + i * 86400) * 1000) === targetString) { + return offset[j]; + } + } + } + return NaN; +}; + +export const createTimezoneDate = (utcTime: number, timeZone: TimeZone) => new Date(utcTime - getTimezoneOffset(utcTime, timeZone) * 1000); diff --git a/src/zonenames.ts b/src/zonenames.ts index e1d5478..d630fae 100644 --- a/src/zonenames.ts +++ b/src/zonenames.ts @@ -189,8 +189,8 @@ export default { 'Pohnpei Time': 'PONT', 'Qyzylorda Standard Time': 'QYZT', 'Qyzylorda Summer Time': 'QYZST', - 'Rothera Time': 'ROTT', 'Réunion Time': 'RET', + 'Rothera Time': 'ROTT', 'Sakhalin Standard Time': 'SAKT', 'Sakhalin Summer Time': 'SAKST', 'Samara Standard Time': 'SAMT', diff --git a/tests/format.spec.ts b/tests/format.spec.ts index e3c22c4..d0efb11 100644 --- a/tests/format.spec.ts +++ b/tests/format.spec.ts @@ -2,6 +2,7 @@ import { describe, expect, test, beforeAll } from 'vitest'; import { format, compile } from '@/index.ts'; import Los_Angeles from '@/timezones/America/Los_Angeles.ts'; import Tokyo from '@/timezones/Asia/Tokyo.ts'; +import { Los_Angeles as los_angeles, Tokyo as tokyo } from '@/timezone.ts'; describe('YYYY', () => { beforeAll(() => (process.env.TZ = 'UTC')); @@ -750,7 +751,11 @@ describe('options', () => { test('timeZone', () => { const now = new Date(2025, 1 - 1, 1, 0); expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: Los_Angeles })).toBe('2024-12-31 16:00:00.000 -0800 Tu'); + expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: los_angeles })).toBe('2024-12-31 16:00:00.000 -0800 Tu'); + expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: 'America/Los_Angeles' })).toBe('2024-12-31 16:00:00.000 -0800 Tu'); expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: Tokyo })).toBe('2025-01-01 09:00:00.000 +0900 We'); + expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: tokyo })).toBe('2025-01-01 09:00:00.000 +0900 We'); + expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: 'Asia/Tokyo' })).toBe('2025-01-01 09:00:00.000 +0900 We'); expect(format(now, 'YYYY-MM-DD HH:mm:ss.SSS Z dd', { timeZone: 'UTC' })).toBe('2025-01-01 00:00:00.000 +0000 We'); }); }); diff --git a/tests/parse.spec.ts b/tests/parse.spec.ts index f547027..4f9f731 100644 --- a/tests/parse.spec.ts +++ b/tests/parse.spec.ts @@ -5,6 +5,7 @@ import Los_Angeles from '@/timezones/America/Los_Angeles.ts'; import Tokyo from '@/timezones/Asia/Tokyo.ts'; import Adelaide from '@/timezones/Australia/Adelaide.ts'; import Apia from '@/timezones/Pacific/Apia.ts'; +import { Los_Angeles as los_angeles, Tokyo as tokyo, Adelaide as adelaide, Apia as apia } from '@/timezone.ts'; test('YYYY', () => { expect(Number.isNaN(parse('0000', 'YYYY').getTime())).toBe(true); @@ -532,7 +533,9 @@ describe('options', () => { test('timeZone', () => { const now = new Date(Date.UTC(2025, 1 - 1, 1, 0)); expect(parse('2024-12-31 16:00:00', 'YYYY-MM-DD HH:mm:ss', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2024-12-31 16:00:00', 'YYYY-MM-DD HH:mm:ss', { timeZone: los_angeles })).toEqual(now); expect(parse('2025-01-01 09:00:00', 'YYYY-MM-DD HH:mm:ss', { timeZone: Tokyo })).toEqual(now); + expect(parse('2025-01-01 09:00:00', 'YYYY-MM-DD HH:mm:ss', { timeZone: tokyo })).toEqual(now); expect(parse('2025-01-01 00:00:00', 'YYYY-MM-DD HH:mm:ss', { timeZone: 'UTC' })).toEqual(now); const dummyTimeZone = { @@ -548,31 +551,37 @@ describe('timeZone Los_Angeles', () => { test('before DST', () => { const now = new Date('2021-03-14T09:59:59.999Z'); expect(parse('2021-03-14 01:59:59.999', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-03-14 01:59:59.999', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); test('start DST 1', () => { const now = new Date('2021-03-14T10:00:00.000Z'); expect(parse('2021-03-14 02:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-03-14 02:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); test('start DST 2', () => { const now = new Date('2021-03-14T10:00:00.000Z'); expect(parse('2021-03-14 03:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-03-14 03:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); test('before of PST', () => { const now = new Date('2021-11-07T08:59:59.999Z'); expect(parse('2021-11-07 01:59:59.999', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-11-07 01:59:59.999', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); test('end of DST', () => { const now = new Date('2021-11-07T10:00:00.000Z'); expect(parse('2021-11-07 02:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-11-07 02:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); test('after of DST', () => { const now = new Date('2021-11-07T11:00:00.000Z'); expect(parse('2021-11-07 03:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: Los_Angeles })).toEqual(now); + expect(parse('2021-11-07 03:00:00.000', 'YYYY-MM-DD HH:mm:ss.SSS', { timeZone: los_angeles })).toEqual(now); }); }); @@ -584,6 +593,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 9, 2, 16, 29, 59, 999)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); test('start of DST 1', () => { @@ -593,6 +603,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 9, 2, 16, 30, 0, 0)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); test('start of DST 2', () => { @@ -602,6 +613,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 9, 2, 17, 29, 59, 999)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); test('start of DST 3', () => { @@ -611,6 +623,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 9, 2, 16, 30, 0, 0)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); test('end of DST', () => { @@ -620,6 +633,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 3, 3, 16, 29, 59, 999)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); test('after DST', () => { @@ -629,6 +643,7 @@ describe('timeZone Adelaide', () => { const dateObj = new Date(Date.UTC(2021, 3, 3, 17, 30, 0, 0)); expect(parse(dateString, formatString, { timeZone: Adelaide }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: adelaide }).getTime()).toBe(dateObj.getTime()); }); }); @@ -641,6 +656,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1892, 7 - 1, 4, 23, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('1.2', () => { @@ -649,6 +665,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1892, 7 - 1, 4, 0, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('2.1', () => { @@ -657,6 +674,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1910, 12 - 1, 31, 23, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('2.2', () => { @@ -665,6 +683,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1910, 12 - 1, 31, 23, 56, 56); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('3.1', () => { @@ -673,6 +692,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1949, 12 - 1, 31, 23, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('3.2', () => { @@ -681,6 +701,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(1950, 1 - 1, 1, 0, 30, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('4.1', () => { @@ -689,6 +710,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2010, 9 - 1, 25, 23, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('4.2', () => { @@ -697,6 +719,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2010, 9 - 1, 26, 1, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('5.1', () => { @@ -705,6 +728,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 4 - 1, 2, 3, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('5.2', () => { @@ -713,6 +737,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 4 - 1, 2, 3, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('6.1', () => { @@ -721,6 +746,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 9 - 1, 24, 2, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('6.2', () => { @@ -729,6 +755,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 9 - 1, 24, 4, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('7.1', () => { @@ -737,6 +764,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 12 - 1, 29, 23, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('7.2', () => { @@ -745,6 +773,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2011, 12 - 1, 31, 0, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('8.1', () => { @@ -753,6 +782,7 @@ describe('timeZone Apia', () => { const dateObj = new Date(2012, 4 - 1, 1, 3, 59, 59); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); test('8.2', () => { @@ -761,5 +791,6 @@ describe('timeZone Apia', () => { const dateObj = new Date(2012, 4 - 1, 1, 3, 0, 0); expect(parse(dateString, formatString, { timeZone: Apia }).getTime()).toBe(dateObj.getTime()); + expect(parse(dateString, formatString, { timeZone: apia }).getTime()).toBe(dateObj.getTime()); }); }); diff --git a/tests/timezones/timezones.spec.ts b/tests/timezones/timezones.spec.ts index ea45561..e3f669a 100644 --- a/tests/timezones/timezones.spec.ts +++ b/tests/timezones/timezones.spec.ts @@ -1,7 +1,7 @@ import { expect, test, describe } from 'vitest'; import { readdir } from 'node:fs/promises'; import { join } from 'node:path'; -import type { TimeZone } from '@/timezone.ts'; +import type { TimeZone } from '@/zone.ts'; const importModules = async (path: string) => { const items = await readdir(path, { recursive: true, withFileTypes: true }); diff --git a/tools/timezone.ts b/tools/timezone.ts index d790ad4..1301dc7 100644 --- a/tools/timezone.ts +++ b/tools/timezone.ts @@ -1,14 +1,13 @@ /** * @description - * This script extracts GMT offset values from a CSV file obtained from timezonedb.com, - * creates subdirectories for each timezone under the src/timezones directory, - * and outputs timezone data as TypeScript files. + * This script generates timezone data files from a CSV file obtained from timezonedb.com, + * creates individual timezone files, and an integrated timezone file for easier imports. */ import { readFile, mkdir, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import prettier from 'prettier'; -import type { TimeZone } from '@/timezone.ts'; +import type { TimeZone } from '@/zone.ts'; const createTimeZones = (csv: string) => { const map = new Map(); @@ -35,7 +34,7 @@ const getPath = (timezone: TimeZone) => { const re = /[^/]+$/; return { dir: join('src', 'timezones', timezone.zone_name.replace(re, '')), - name: `${re.exec(timezone.zone_name)?.[0] ?? ''}.ts` + name: re.exec(timezone.zone_name)?.[0] ?? '' }; }; @@ -47,6 +46,26 @@ const format = (timezone: TimeZone) => { return prettier.format(code, { parser: 'typescript', singleQuote: true, trailingComma: 'none' }); }; +const sortMap = (map: Map) => { + return Array.from(map.values()).sort((a, b) => getPath(a).name.localeCompare(getPath(b).name)); +}; + +const formatAll = (map: Map) => { + const code = []; + + code.push('import { TimeZone } from \'@/zone.ts\';'); + + for (const timezone of sortMap(map)) { + const name = getPath(timezone).name.replace(/-/g, '_'); + + code.push(`export const ${name}: TimeZone = { + zone_name: '${timezone.zone_name}', + gmt_offset: ${JSON.stringify(timezone.gmt_offset.sort((a, b) => b - a))} + };`); + } + return prettier.format(code.join('\n\n'), { parser: 'typescript', singleQuote: true, trailingComma: 'none' }); +}; + const path = process.argv[2]; if (!path) { @@ -57,9 +76,13 @@ if (!path) { const csv = await readFile(path, 'utf8'); const map = createTimeZones(csv); +// Generate individual timezone files for (const timezone of map.values()) { const { dir, name } = getPath(timezone); await mkdir(dir, { recursive: true }); - await writeFile(join(dir, name), await format(timezone)); + await writeFile(join(dir, `${name}.ts`), await format(timezone)); } + +// Generate integrated timezone file +await writeFile(join('src', 'timezone.ts'), await formatAll(map));