diff --git a/.env b/.env new file mode 100644 index 0000000..f389f0e --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +################################################################################ +# As additional safeguards to reveal potential time zone related bugs, +# please comment out the below`TZ` environment (one at a time) to fake the +# local timezone in extreme edge cases. +# (Note: this is in POSIX format, so "+"/"-" means behind/ahead instead of another way around) +# +# TZ=GMT+23 +# TZ=GMT-1 diff --git a/.github/workflows/check-published-scheduled.yml b/.github/workflows/check-published-scheduled.yml index 3c232bf..28120ee 100644 --- a/.github/workflows/check-published-scheduled.yml +++ b/.github/workflows/check-published-scheduled.yml @@ -1,14 +1,13 @@ name: Check Published on: - workflow_dispatch: schedule: - cron: '30 20 * * *' jobs: checkPublished: - runs-on: ubuntu-latest name: Check Published + runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96253c4..46f8693 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ['20.x', '21.x'] + node-version: ['22.x', '24.x'] steps: - name: Checkout Code uses: actions/checkout@v4 @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ['20.x', '21.x'] + node-version: ['22.x', '24.x'] steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f36d827..927ae3a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -24,8 +24,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7e0b7ae..a7239f1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,7 +20,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' - name: Install Dependencies run: npm ci --ignore-scripts diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index fe3b172..e392636 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' - name: Check Label uses: checkdigit/github-actions/check-label@main @@ -25,8 +25,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check Imports uses: checkdigit/github-actions/check-imports@main - - name: Install latest npm - run: npm install -g npm@latest - name: Install Dependencies run: npm ci --ignore-scripts - name: Audit Signatures diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba5807c..af539a3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,10 +14,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' - - name: Install latest npm - run: npm install -g npm@latest - name: Install Dependencies run: npm ci --ignore-scripts - name: Audit Signatures diff --git a/LICENSE.txt b/LICENSE.txt index b986a9c..e1810f9 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2022-2024 Check Digit, LLC. +Copyright (c) 2022-2025 Check Digit, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d64c0f6..741f425 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,20 @@ # Check Digit Time Library -Copyright (c) 2022-2024 [Check Digit, LLC](https://checkdigit.com) +Copyright (c) 2022-2025 [Check Digit, LLC](https://checkdigit.com) -The Check Digit time library is the officially sanctioned method for Check Digit services to deal with time. It is a partial implementation of the new TC39 Temporal proposal -and date manipulation functions provided by date-fns. Features: +The Check Digit time library is the officially sanctioned method for Check Digit services to deal with time. It has date manipulation functions provided by date-fns. Features: -- Nanosecond precision date times, simulated with Node's built-in high-resolution timer -- Tests that verify compliance with latest TC39 polyfill -- Designed to be removed once Temporal is included, by default, within V8. -- Implements most of Temporal.Instant, except timezone/calendar functionality -- Implements Temporal.Now.instant() - Stripped down `date-fns` functions - `date-fns-tz` for timezone support - `formatUtc` for formatting UTC dates -Temporal (vs the millisecond precision of standard Date built-in) is useful for webservices recording the time of events, where concurrent activity may occur and millisecond precision does not provide adequate uniqueness and ordering. - The [`date-fns`](https://date-fns.org) library is included. The only locale currently supported is `en-US`, but otherwise contains all -available functionality as of v3.6.0. +available functionality as of v4.1.0 except that the code in `fp` folder are excluded, which contain functional programming related stuff that is not used at the moment. Additionally, the [`date-fns-tz`](https://github.com/marnusw/date-fns-tz) library is included. Contains all -available functionality as of v1.3.7 except that the code in `fp` folder is excluded, which contains functional programming related stuff that is not used at the moment. +available functionality as of v3.2.0 except that the code in `fp` folder are excluded, which contain functional programming related stuff that is not used at the moment. -### `formatUtc` +## `formatUtc` The `formatUtc` function is a wrapper around `date-fns-tz`'s `format` function, but with the following differences: @@ -30,58 +22,44 @@ The `formatUtc` function is a wrapper around `date-fns-tz`'s `format` function, Generally speaking, `formatUtc` should be used in place of `format` or `tzFormat`, unless non-UTC time zones are required. -### Important note about `Instant.toString()` - -Unlike built-in `Date.toISOString()`, `Instant.toString()` will not add fractional second digits if those values are zero. - -E.g. - -``` -new Date(0).toISOString() -> 1970-01-01T00:00:00.100Z - -vs - -Temporal.Instant(0n).toString() -> 1970-01-01T00:00:00.1Z -``` - -### Why not just use the polyfill? - -The polyfill is not production ready. The implementation is designed to be used in the browser so cannot make use of Node's high-resolution timer to more accurately simulate nanosecond precision time. Crucially, the polyfill does not guarantee always increasing nanosecond precision times on subsequent calls, which makes it a non-starter for recording the time of events in production webservices. - -### Installing and usage +## Installing and usage `npm install @checkdigit/time` then: -``` -import { Temporal } from '@checkdigit/time'; // delete this once Temporal becomes a built-in - -// print out nanosecond-precision ISO8601 datetime -console.log('Current time', Temporal.Now.instant().toString()); -``` - For `date-fns` functionality: -``` +```typescript import { formatUtc } from '@checkdigit/time'; console.log(formatUtc(new Date(), 'yyyy-MM-dd')); ``` -### Documentation - -The stage 3 proposal can be found here: https://github.com/tc39/proposal-temporal - -The reference documentation is here: https://tc39.es/proposal-temporal/docs/ +## Documentation The documentation for `date-fns` is here: https://date-fns.org/ The documentation for `date-fns-tz` is here: https://github.com/marnusw/date-fns-tz -### Maintenance notes: +## Migration guide + +following are the main steps to sync up with the latest date-fns/date-fns-tz + +- clone 3rd party repo +- remove test/fp stuff +- copy/override into @checkdigit/time repo's corresponding folder +- update CHANGELOG.md (it helps to understand the changes since the last update and to prepare accordingly) +- replace imports from '.js' to '.ts' +- Add comments in the beginning of the files to silence ts/lint errors if it forces overwhelming changes otherwise +- check things which compiles but may have other issues, e.g. import { type ZZZ } => import type { ZZZ } +- adjust tsconfig.json compilerOptions if necessary +- apply previous patch (e.g. daylight saving timezone, etc.) +- pass existing local tests +- beta-test across dependent repos to make sure it still works + +## Critical maintenance notes (VERY IMPORTANT!!!): When updating the latest code from the original repositories, except making all the necessary changes to make them fully typescript compatible, please remember to carry over the patches to overcome the following issues: -- spring-forward support -- nanosecond support +- hours is incorrect when it's close to daylight saving timezone threshold Please search for `[PATCH:]` in the existing codebase. diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..14050fa --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,14 @@ +import checkdigitConfig from '@checkdigit/eslint-config'; + +export default [ + ...checkdigitConfig, + { + files: ['src/date-fns/**', 'src/date-fns-tz/**'], + rules: { + '@checkdigit/file-path-comment': 'off', + 'markdown/no-missing-label-refs': 'off', + 'markdown/fenced-code-language': 'off', + 'unicorn/filename-case': 'off', + }, + }, +]; diff --git a/package-lock.json b/package-lock.json index e40c1da..c38ce9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,33 +1,21 @@ { "name": "@checkdigit/time", - "version": "4.0.0", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@checkdigit/time", - "version": "4.0.0", + "version": "5.0.0", "license": "MIT", "devDependencies": { - "@checkdigit/eslint-config": "^9.2.0", - "@checkdigit/jest-config": "^6.0.0", - "@checkdigit/prettier-config": "^5.3.0", - "@checkdigit/typescript-config": "^7.0.1", - "@js-temporal/polyfill": "^0.4.4", - "rimraf": "^5.0.5" + "@checkdigit/eslint-config": "^11.2.7", + "@checkdigit/prettier-config": "^6.3.0", + "@checkdigit/typescript-config": "^9.1.1", + "rimraf": "^6.0.1" }, "engines": { - "node": ">=20.11" - } - }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" + "node": ">=22.14" } }, "node_modules/@ampproject/remapping": { @@ -35,6 +23,7 @@ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -44,2355 +33,2584 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@checkdigit/eslint-config": { + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/@checkdigit/eslint-config/-/eslint-config-11.2.7.tgz", + "integrity": "sha512-WqJk4kf7sbpAmgz9Rdw1tB3+XQx24kTbq1y5hoBJ/nO0Zk+XOwmngFUgu2jDRdqkq4pO9zm1WatguwZLThk6qw==", "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, + "license": "MIT", "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "node": ">=22.14" }, - "engines": { - "node": ">=4" + "peerDependencies": { + "@checkdigit/eslint-plugin": "7.14.0", + "@eslint/compat": "1.2.9", + "@eslint/eslintrc": "3.3.1", + "@eslint/js": "9.27.0", + "@eslint/json": "0.12.0", + "@eslint/markdown": "6.4.0", + "eslint": "9.27.0", + "eslint-config-prettier": "10.1.5", + "eslint-import-resolver-typescript": "4.4.1", + "eslint-plugin-eslint-comments": "3.2.0", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-n": "17.18.0", + "eslint-plugin-no-only-tests": "3.3.0", + "eslint-plugin-no-secrets": "2.2.1", + "eslint-plugin-sonarjs": "3.0.2", + "eslint-plugin-unicorn": "59.0.1", + "eslint-plugin-yml": "1.18.0", + "typescript-eslint": "8.33.0" } }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/@checkdigit/eslint-plugin": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@checkdigit/eslint-plugin/-/eslint-plugin-7.14.0.tgz", + "integrity": "sha512-R58XSpdqULjt09KlgRXM9WoPM2AUmLLzqOJiaBoiUs7Rk83acCUsrLFHUK2/2y0nqFuZYWQYRkie1qfQfRap2g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, + "@typescript-eslint/type-utils": "^8.23.0", + "@typescript-eslint/utils": "^8.23.0", + "http-status-codes": "^2.3.0", + "ts-api-utils": "^2.0.1" + }, "engines": { - "node": ">=0.8.0" + "node": ">=22.14" + }, + "peerDependencies": { + "eslint": ">=9 <10" } }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/@checkdigit/prettier-config": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@checkdigit/prettier-config/-/prettier-config-6.3.0.tgz", + "integrity": "sha512-efv1d9zWqJjUtsf7pck34xSk+uPSUK3Me4oBLqqZYJuJToq7h6PlKW4Tv3flPEpNVcU1O5KmgJhE0tsBe8ej8w==", "dev": true, - "peer": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=22.11" + }, + "peerDependencies": { + "@prettier/plugin-xml": "3.4.1", + "prettier": "3.5.3", + "prettier-plugin-packagejson": "2.5.10", + "prettier-plugin-svelte": "3.3.3", + "prettier-plugin-tailwindcss": "0.6.11" } }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@checkdigit/typescript-config": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@checkdigit/typescript-config/-/typescript-config-9.1.1.tgz", + "integrity": "sha512-LRW7rzHZWOJ1UEYDy6qVxIFbnC670YKP+xeBfeicni7BtxoBgpZeIvuKA2KI2Kbuk2oM2wsK2DYD6DHqf6KCRQ==", "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" + "license": "MIT", + "bin": { + "builder": "bin/builder.mjs" }, "engines": { - "node": ">=4" + "node": ">=22.14" + }, + "peerDependencies": { + "@swc-node/register": "1.10.10", + "@types/node": ">=22", + "esbuild": "0.25.1", + "typescript": ">=5.8.2 <5.9.0" } }, - "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "node_modules/@emnapi/core": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", + "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==", "dev": true, + "license": "MIT", + "optional": true, "peer": true, - "engines": { - "node": ">=6.9.0" + "dependencies": { + "@emnapi/wasi-threads": "1.0.2", + "tslib": "^2.4.0" } }, - "node_modules/@babel/core": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", - "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", + "node_modules/@emnapi/runtime": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.3.tgz", + "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==", "dev": true, + "license": "MIT", + "optional": true, "peer": true, "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.24.0", - "@babel/parser": "^7.24.0", - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" + "tslib": "^2.4.0" } }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/@emnapi/wasi-threads": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz", + "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==", "dev": true, + "license": "MIT", + "optional": true, "peer": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", + "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", + "cpu": [ + "ppc64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], "peer": true, - "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/@esbuild/android-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", + "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", + "cpu": [ + "arm" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "peer": true, - "bin": { - "jsesc": "bin/jsesc" - }, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "node_modules/@esbuild/android-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", + "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "peer": true, - "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/@esbuild/android-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", + "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "peer": true, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": ">=18" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", + "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "peer": true, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", + "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "peer": true, - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", + "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "peer": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", + "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "peer": true, - "dependencies": { - "@babel/types": "^7.22.15" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "node_modules/@esbuild/linux-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", + "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", + "cpu": [ + "arm" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">=18" } }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", - "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", + "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", + "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", + "cpu": [ + "ia32" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", + "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", + "cpu": [ + "loong64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", + "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", + "cpu": [ + "mips64el" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", + "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", + "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", + "cpu": [ + "riscv64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/helpers": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", - "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", + "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", + "cpu": [ + "s390x" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "node_modules/@esbuild/linux-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", + "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", + "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", + "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", + "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "peer": true, - "dependencies": { - "color-name": "1.1.3" + "engines": { + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", + "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "peer": true, "engines": { - "node": ">=0.8.0" + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", + "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], "peer": true, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", + "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", + "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", + "cpu": [ + "ia32" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "bin": { - "parser": "bin/babel-parser.js" - }, "engines": { - "node": ">=6.0.0" + "node": ">=18" } }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "node_modules/@esbuild/win32-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", + "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=18" } }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "eslint-visitor-keys": "^3.4.3" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "node_modules/@eslint/compat": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.9.tgz", + "integrity": "sha512-gCdSY54n7k+driCadyMNv8JSPzYLeDVM/ikZRtvtROBpRdFSkS8W9A82MqsaY7lZuwL0wiapgD0NT1xT0hyJsA==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^9.10.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "node_modules/@eslint/config-array": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "node_modules/@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@types/json-schema": "^7.0.15" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "node_modules/@eslint/eslintrc": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "node_modules/@eslint/js": { + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", + "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://eslint.org/donate" } }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "node_modules/@eslint/json": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/json/-/json-0.12.0.tgz", + "integrity": "sha512-n/7dz8HFStpEe4o5eYk0tdkBdGUS/ZGb0GQCeDWN1ZmRq67HMHK4vC33b0rQlTT6xdZoX935P4vstiWVk5Ying==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@eslint/core": "^0.12.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanwhocodes/momoa": "^3.3.4", + "natural-compare": "^1.4.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "node_modules/@eslint/markdown": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@eslint/markdown/-/markdown-6.4.0.tgz", + "integrity": "sha512-J07rR8uBSNFJ9iliNINrchilpkmCihPmTVotpThUeKEn5G8aBBZnkjNBy/zovhJA5LBk1vWU9UDlhqKSc/dViQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@eslint/core": "^0.10.0", + "@eslint/plugin-kit": "^0.2.5", + "mdast-util-from-markdown": "^2.0.2", + "mdast-util-frontmatter": "^2.0.1", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-frontmatter": "^2.0.0", + "micromark-extension-gfm": "^3.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "node_modules/@eslint/markdown/node_modules/@eslint/core": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@types/json-schema": "^7.0.15" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", - "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "node_modules/@eslint/plugin-kit": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", + "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@eslint/core": "^0.13.0", + "levn": "^0.4.1" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/traverse": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", - "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", + "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@types/json-schema": "^7.0.15" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, + "license": "Apache-2.0", "peer": true, "engines": { - "node": ">=4" + "node": ">=18.18.0" } }, - "node_modules/@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=18.18.0" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "peer": true - }, - "node_modules/@checkdigit/eslint-config": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@checkdigit/eslint-config/-/eslint-config-9.2.0.tgz", - "integrity": "sha512-hGYugfyWu/OLDpWd9nX4daMzJjirpYYjSTXwVbK8H/4cQhYebmj2MGV7V69AvGsQdpWpl01t+CuvMlHk+MRQ1Q==", + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", "dev": true, + "license": "Apache-2.0", + "peer": true, "engines": { - "node": ">=20.11" + "node": ">=18.18" }, - "peerDependencies": { - "@checkdigit/eslint-plugin": "5.5.3", - "@typescript-eslint/eslint-plugin": "7.2.0", - "@typescript-eslint/parser": "7.2.0", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-eslint-comments": "3.2.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-jest": "27.9.0", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-no-only-tests": "3.1.0", - "eslint-plugin-no-secrets": "0.8.9", - "eslint-plugin-sonarjs": "0.24.0", - "eslint-plugin-unicorn": "51.0.1" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@checkdigit/eslint-plugin": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@checkdigit/eslint-plugin/-/eslint-plugin-5.5.3.tgz", - "integrity": "sha512-eRwJemE0XSgQ98xQ+HqZMIgcQ0cMU2R/By/tjKmB/ui+MTbBAm+OEHOQcVWd8SdVs2TIrgTmCTmum0UrIil03Q==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "peer": true, "engines": { - "node": ">=18" + "node": ">=12.22" }, - "peerDependencies": { - "eslint": ">=8 <9" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@checkdigit/jest-config": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@checkdigit/jest-config/-/jest-config-6.0.0.tgz", - "integrity": "sha512-VZd3mzzZatAvRoz5fKuYJCS7L8BatJllyiOYxpHsOAAe2WwjBRx0W9KoJcq0e8DQDA8l8DsNn1XURy1kIBwKNQ==", + "node_modules/@humanwhocodes/momoa": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-3.3.8.tgz", + "integrity": "sha512-/3PZzor2imi/RLLcnHztkwA79txiVvW145Ve2cp5dxRcH5qOUNJPToasqLFHniTfw4B4lT7jGDdBOPXbXYlIMQ==", "dev": true, + "license": "Apache-2.0", + "peer": true, "engines": { - "node": ">=20.11" - }, - "peerDependencies": { - "@jest/globals": "29.7.0", - "dotenv": ">=16", - "jest": "29.7.0", - "ts-jest": "29.1.2" + "node": ">=18" } }, - "node_modules/@checkdigit/prettier-config": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@checkdigit/prettier-config/-/prettier-config-5.3.0.tgz", - "integrity": "sha512-S2Q/v8aLiH3ROxvgAawhhZkt3t0a2S7fmF+E+GCWOiYXkSXm02+8QvNZVIMyx7xgwK2MpRQv0bdJuyWjsLe7MQ==", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, + "license": "Apache-2.0", + "peer": true, "engines": { - "node": ">=20.11" + "node": ">=18.18" }, - "peerDependencies": { - "prettier": "3.2.5" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@checkdigit/typescript-config": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@checkdigit/typescript-config/-/typescript-config-7.0.1.tgz", - "integrity": "sha512-CM3y0s22VLSsD+HlOK/0eQCIJZgPH1SHd6b9xrsS+iYgI3jO2T10I9vMQpGZfkxOB/iIL3Ob7ktWJeIOPff/xw==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "bin": { - "builder": "bin/builder.mjs" + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": ">=20.11" + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" }, - "peerDependencies": { - "@types/node": ">=20.11", - "esbuild": "0.20.2", - "typescript": ">=5.4.3 <5.5.0" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", - "cpu": [ - "ppc64" - ], + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "optional": true, - "os": [ - "aix" - ], + "license": "MIT", "peer": true, "engines": { - "node": ">=12" + "node": ">=6.0.0" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "cpu": [ - "arm" - ], + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "optional": true, - "os": [ - "android" - ], + "license": "MIT", "peer": true, "engines": { - "node": ">=12" + "node": ">=6.0.0" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", - "cpu": [ - "arm64" - ], + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.11.tgz", + "integrity": "sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "android" - ], "peer": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.9.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, "engines": { - "node": ">=12" + "node": ">= 8" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", - "cpu": [ - "x64" - ], + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "optional": true, - "os": [ - "android" - ], + "license": "MIT", "peer": true, "engines": { - "node": ">=12" + "node": ">= 8" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", - "cpu": [ - "arm64" - ], + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "license": "MIT", "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, "engines": { - "node": ">=12" + "node": ">= 8" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-5.3.0.tgz", + "integrity": "sha512-hXem5ZAguS7IlSiHg/LK0tEfLj4eUo+9U6DaFwwBEGd0L0VIF9LmuiHydRyOrdnnmi9iAAFMAn/wl2cUoiuruA==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-5.3.0.tgz", + "integrity": "sha512-wgSwfsZkRbuYCIBLxeg1bYrtKnirAy+IJF0lwfz4z08clgdNBDbfGECJe/cd0csIZPpRcvPFe8317yf31sWhtA==", "cpu": [ - "arm64" + "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "freebsd" + "darwin" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-5.3.0.tgz", + "integrity": "sha512-kzeE2WHgcRMmWjB071RdwEV5Pwke4o0WWslCKoh8if1puvxIxfzu3o7g6P2+v77BP5qop4cri+uvLABSO0WZjg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-5.3.0.tgz", + "integrity": "sha512-I8np34yZP/XfIkZNDbw3rweqVgfjmHYpNX3xnJZWg+f4mgO9/UNWBwetSaqXeDZqvIch/aHak+q4HVrQhQKCqg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-5.3.0.tgz", + "integrity": "sha512-u2ndfeEUrW898eXM+qPxIN8TvTPjI90NDQBRgaxxkOfNw3xaotloeiZGz5+Yzlfxgvxr9DY9FdYkqhUhSnGhOw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-5.3.0.tgz", + "integrity": "sha512-TzbjmFkcnESGuVItQ2diKacX8vu5G0bH3BHmIlmY4OSRLyoAlrJFwGKAHmh6C9+Amfcjo2rx8vdm7swzmsGC6Q==", "cpu": [ - "ia32" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-5.3.0.tgz", + "integrity": "sha512-NH3pjAqh8nuN29iRuRfTY42Vn03ctoR9VE8llfoUKUfhHUjFHYOXK5VSkhjj1usG8AeuesvqrQnLptCRQVTi/Q==", "cpu": [ - "loong64" + "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-5.3.0.tgz", + "integrity": "sha512-tuZtkK9sJYh2MC2uhol1M/8IMTB6ZQ5jmqP2+k5XNXnOb/im94Y5uV/u2lXwVyIuKHZZHtr+0d1HrOiNahoKpw==", "cpu": [ - "mips64el" + "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-5.3.0.tgz", + "integrity": "sha512-VzhPYmZCtoES/ThcPdGSmMop7JlwgqtSvlgtKCW15ByV2JKyl8kHAHnPSBfpIooXb0ehFnRdxFtL9qtAEWy01g==", "cpu": [ - "ppc64" + "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-5.3.0.tgz", + "integrity": "sha512-Hi39cWzul24rGljN4Vf1lxjXzQdCrdxO5oCT7KJP4ndSlqIUODJnfnMAP1YhcnIRvNvk+5E6sZtnEmFUd/4d8Q==", "cpu": [ - "riscv64" + "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-5.3.0.tgz", + "integrity": "sha512-ddujvHhP3chmHnSXRlkPVUeYj4/B7eLZwL4yUid+df3WCbVh6DgoT9RmllZn21AhxgKtMdekDdyVJYKFd8tl4A==", "cpu": [ - "s390x" + "wasm32" ], "dev": true, + "license": "MIT", "optional": true, - "os": [ - "linux" - ], "peer": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.9" + }, "engines": { - "node": ">=12" + "node": ">=14.0.0" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-5.3.0.tgz", + "integrity": "sha512-j1YYPLvUkMVNKmIFQZZJ7q6Do4cI3htUnyxNLwDSBVhSohvPIK2VG+IdtOAlWZGa7v+phEZsHfNbXVwB0oPYFQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], - "peer": true, - "engines": { - "node": ">=12" - } + "peer": true }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-5.3.0.tgz", + "integrity": "sha512-LT9eOPPUqfZscQRd5mc08RBeDWOQf+dnOrKnanMallTGPe6g7+rcAlFTA8SWoJbcD45PV8yArFtCmSQSpzHZmg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "netbsd" + "win32" ], + "peer": true + }, + "node_modules/@pkgr/core": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.2.tgz", + "integrity": "sha512-fdDH1LSGfZdTH2sxdpVMw31BanV28K/Gry0cVFxaNP77neJSkd82mM8ErPNYs9e+0O7SdHBLTDzDgwUuy18RnQ==", + "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "node_modules/@prettier/plugin-xml": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-3.4.1.tgz", + "integrity": "sha512-Uf/6/+9ez6z/IvZErgobZ2G9n1ybxF5BhCd7eMcKqfoWuOzzNUxBipNo3QAP8kRC1VD18TIo84no7LhqtyDcTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@xml-tools/parser": "^1.0.11" + }, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz", + "integrity": "sha512-IwQk4yfwLdibDlrXVE04jTZYlLnwsTT2PIOQQGNLWfjavGifnk1JD1LcZjZaBTRcxZu2FfPfNLOE04DSu9lqtQ==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@swc-node/core": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.13.3.tgz", + "integrity": "sha512-OGsvXIid2Go21kiNqeTIn79jcaX4l0G93X2rAnas4LFoDyA9wAwVK7xZdm+QsKoMn5Mus2yFLCc4OtX2dD/PWA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@swc/core": ">= 1.4.13", + "@swc/types": ">= 0.1" + } + }, + "node_modules/@swc-node/register": { + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.10.10.tgz", + "integrity": "sha512-jYWaI2WNEKz8KZL3sExd2KVL1JMma1/J7z+9iTpv0+fRN7LGMF8VTGGuHI2bug/ztpdZU1G44FG/Kk6ElXL9CQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@swc-node/core": "^1.13.3", + "@swc-node/sourcemap-support": "^0.5.1", + "colorette": "^2.0.20", + "debug": "^4.3.5", + "oxc-resolver": "^5.0.0", + "pirates": "^4.0.6", + "tslib": "^2.6.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@swc/core": ">= 1.4.13", + "typescript": ">= 4.3" + } + }, + "node_modules/@swc-node/sourcemap-support": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.5.1.tgz", + "integrity": "sha512-JxIvIo/Hrpv0JCHSyRpetAdQ6lB27oFYhv0PKCNf1g2gUXOjpeR1exrXccRxLMuAV5WAmGFBwRnNOJqN38+qtg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "source-map-support": "^0.5.21", + "tslib": "^2.6.3" + } + }, + "node_modules/@swc/core": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.11.31.tgz", + "integrity": "sha512-mAby9aUnKRjMEA7v8cVZS9Ah4duoRBnX7X6r5qrhTxErx+68MoY1TPrVwj/66/SWN3Bl+jijqAqoB8Qx0QE34A==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@swc/counter": "^0.1.3", + "@swc/types": "^0.1.21" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-darwin-arm64": "1.11.31", + "@swc/core-darwin-x64": "1.11.31", + "@swc/core-linux-arm-gnueabihf": "1.11.31", + "@swc/core-linux-arm64-gnu": "1.11.31", + "@swc/core-linux-arm64-musl": "1.11.31", + "@swc/core-linux-x64-gnu": "1.11.31", + "@swc/core-linux-x64-musl": "1.11.31", + "@swc/core-win32-arm64-msvc": "1.11.31", + "@swc/core-win32-ia32-msvc": "1.11.31", + "@swc/core-win32-x64-msvc": "1.11.31" + }, + "peerDependencies": { + "@swc/helpers": ">=0.5.17" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } + } + }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.11.31.tgz", + "integrity": "sha512-NTEaYOts0OGSbJZc0O74xsji+64JrF1stmBii6D5EevWEtrY4wlZhm8SiP/qPrOB+HqtAihxWIukWkP2aSdGSQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "Apache-2.0 AND MIT", "optional": true, "os": [ - "openbsd" + "darwin" ], "peer": true, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "node_modules/@swc/core-darwin-x64": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.11.31.tgz", + "integrity": "sha512-THSGaSwT96JwXDwuXQ6yFBbn+xDMdyw7OmBpnweAWsh5DhZmQkALEm1DgdQO3+rrE99MkmzwAfclc0UmYro/OA==", "cpu": [ "x64" ], "dev": true, + "license": "Apache-2.0 AND MIT", "optional": true, "os": [ - "sunos" + "darwin" ], "peer": true, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "node_modules/@swc/core-linux-arm-gnueabihf": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.11.31.tgz", + "integrity": "sha512-laKtQFnW7KHgE57Hx32os2SNAogcuIDxYE+3DYIOmDMqD7/1DCfJe6Rln2N9WcOw6HuDbDpyQavIwZNfSAa8vQ==", "cpu": [ - "arm64" + "arm" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ - "win32" + "linux" ], "peer": true, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "node_modules/@swc/core-linux-arm64-gnu": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.11.31.tgz", + "integrity": "sha512-T+vGw9aPE1YVyRxRr1n7NAdkbgzBzrXCCJ95xAZc/0+WUwmL77Z+js0J5v1KKTRxw4FvrslNCOXzMWrSLdwPSA==", "cpu": [ - "ia32" + "arm64" ], "dev": true, + "license": "Apache-2.0 AND MIT", "optional": true, "os": [ - "win32" + "linux" ], "peer": true, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "node_modules/@swc/core-linux-arm64-musl": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.11.31.tgz", + "integrity": "sha512-Mztp5NZkyd5MrOAG+kl+QSn0lL4Uawd4CK4J7wm97Hs44N9DHGIG5nOz7Qve1KZo407Y25lTxi/PqzPKHo61zQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "Apache-2.0 AND MIT", "optional": true, "os": [ - "win32" + "linux" ], "peer": true, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "node_modules/@swc/core-linux-x64-gnu": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.11.31.tgz", + "integrity": "sha512-DDVE0LZcXOWwOqFU1Xi7gdtiUg3FHA0vbGb3trjWCuI1ZtDZHEQYL4M3/2FjqKZtIwASrDvO96w91okZbXhvMg==", + "cpu": [ + "x64" + ], "dev": true, + "license": "Apache-2.0 AND MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "node": ">=10" } }, - "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "node_modules/@swc/core-linux-x64-musl": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.11.31.tgz", + "integrity": "sha512-mJA1MzPPRIfaBUHZi0xJQ4vwL09MNWDeFtxXb0r4Yzpf0v5Lue9ymumcBPmw/h6TKWms+Non4+TDquAsweuKSw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "Apache-2.0 AND MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">=10" } }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "node_modules/@swc/core-win32-arm64-msvc": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.11.31.tgz", + "integrity": "sha512-RdtakUkNVAb/FFIMw3LnfNdlH1/ep6KgiPDRlmyUfd0WdIQ3OACmeBegEFNFTzi7gEuzy2Yxg4LWf4IUVk8/bg==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "Apache-2.0 AND MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=10" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@swc/core-win32-ia32-msvc": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.11.31.tgz", + "integrity": "sha512-hErXdCGsg7swWdG1fossuL8542I59xV+all751mYlBoZ8kOghLSKObGQTkBbuNvc0sUKWfWg1X0iBuIhAYar+w==", + "cpu": [ + "ia32" + ], "dev": true, + "license": "Apache-2.0 AND MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": ">=10" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@swc/core-win32-x64-msvc": { + "version": "1.11.31", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.11.31.tgz", + "integrity": "sha512-5t7SGjUBMMhF9b5j17ml/f/498kiBJNf4vZFNM421UGUEETdtjPN9jZIuQrowBkoFGJTCVL/ECM4YRtTH30u/A==", + "cpu": [ + "x64" + ], "dev": true, + "license": "Apache-2.0 AND MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": ">=10" } }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", "dev": true, - "peer": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } + "license": "Apache-2.0", + "peer": true }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "node_modules/@swc/types": { + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.22.tgz", + "integrity": "sha512-D13mY/ZA4PPEFSy6acki9eBT/3WgjMoRqNcdpIvjaYLQ44Xk5BdaL7UkDxAh6Z9UOe7tCCp67BVmZCojYp9owg==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" + "@swc/counter": "^0.1.3" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@tybys/wasm-util": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", "dev": true, + "license": "MIT", + "optional": true, "peer": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "tslib": "^2.4.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "@types/ms": "*" } }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, - "peer": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } + "license": "MIT", + "peer": true }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } + "license": "MIT", + "peer": true }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "license": "MIT", + "peer": true, + "dependencies": { + "@types/unist": "*" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "license": "MIT", + "peer": true + }, + "node_modules/@types/node": { + "version": "22.15.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.30.tgz", + "integrity": "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~6.21.0" } }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT", + "peer": true }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.33.0.tgz", + "integrity": "sha512-CACyQuqSHt7ma3Ns601xykeBK/rDeZa3w6IS6UtMQbixO5DWy+8TilKkviGDH6jtWCo8FGRKEK5cLLkPvEammQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/type-utils": "8.33.0", + "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", + "graphemer": "^1.4.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.33.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/project-service": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.33.0.tgz", + "integrity": "sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "ansi-regex": "^6.0.1" + "@typescript-eslint/tsconfig-utils": "^8.33.0", + "@typescript-eslint/types": "^8.33.0", + "debug": "^4.3.4" }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.33.0.tgz", + "integrity": "sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0" }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.0.tgz", + "integrity": "sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.33.0.tgz", + "integrity": "sha512-lScnHNCBqL1QayuSrWeqAL5GmqNdVUQAAMTaCwdYEdWfIrSrOGzyLGRCHXcCixa5NK6i5l0AfSO2oBSjCjf4XQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "sprintf-js": "~1.0.2" + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/utils": "8.33.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.33.0.tgz", + "integrity": "sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.0.tgz", + "integrity": "sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "@typescript-eslint/project-service": "8.33.0", + "@typescript-eslint/tsconfig-utils": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.33.0.tgz", + "integrity": "sha512-lPFuQaLA9aSNa7D5u2EpRiqdAUhzShwGg/nhpBlc4GR6kcTABttCuyjFs8BcEZ8VWrjCBof/bePhP3Q3fS+Yrw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-locate": "^4.1.0" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0" }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.0.tgz", + "integrity": "sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-try": "^2.0.0" + "@typescript-eslint/types": "8.33.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">=6" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" + "balanced-match": "^1.0.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "peer": true, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=8" + "node": ">= 4" } }, - "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "node_modules/@typescript-eslint/parser": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.33.0.tgz", + "integrity": "sha512-JaehZvf6m0yqYp34+RVnihBAChkqeH+tqqhS0GuX1qgPpwLvmTPheKEs6OeCK6hVJgXZHJ2vbjnC9j119auStQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", + "debug": "^4.3.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/core/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "peer": true, - "engines": { - "node": ">=8" + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/project-service": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.33.0.tgz", + "integrity": "sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" + "@typescript-eslint/tsconfig-utils": "^8.33.0", + "@typescript-eslint/types": "^8.33.0", + "debug": "^4.3.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.33.0.tgz", + "integrity": "sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.0.tgz", + "integrity": "sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "jest-get-type": "^29.6.3" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.33.0.tgz", + "integrity": "sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.0.tgz", + "integrity": "sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" + "@typescript-eslint/project-service": "8.33.0", + "@typescript-eslint/tsconfig-utils": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.0.tgz", + "integrity": "sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^6.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "@typescript-eslint/types": "8.33.0", + "eslint-visitor-keys": "^4.2.0" }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "balanced-match": "^1.0.0" } }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "node_modules/@typescript-eslint/project-service": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz", + "integrity": "sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" + "@typescript-eslint/tsconfig-utils": "^8.34.1", + "@typescript-eslint/types": "^8.34.1", + "debug": "^4.3.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", + "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.1.tgz", + "integrity": "sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.34.1.tgz", + "integrity": "sha512-Tv7tCCr6e5m8hP4+xFugcrwTOucB8lshffJ6zf1mF1TbU67R+ntCc6DzLNKM+s/uzDyv8gLq7tufaAhIBYeV8g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" + "@typescript-eslint/typescript-estree": "8.34.1", + "@typescript-eslint/utils": "8.34.1", + "debug": "^4.3.4", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": ">=6.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@typescript-eslint/types": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", + "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=6.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz", + "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "@typescript-eslint/project-service": "8.34.1", + "@typescript-eslint/tsconfig-utils": "8.34.1", + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" + }, "engines": { - "node": ">=6.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true, - "peer": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "balanced-match": "^1.0.0" } }, - "node_modules/@js-temporal/polyfill": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@js-temporal/polyfill/-/polyfill-0.4.4.tgz", - "integrity": "sha512-2X6bvghJ/JAoZO52lbgyAPFj8uCflhTo2g7nkFzEQdXd/D8rEeD4HtmTEpmtGCva260fcd66YNXBOYdnmHqSOg==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", + "peer": true, "dependencies": { - "jsbi": "^4.3.0", - "tslib": "^2.4.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@typescript-eslint/utils": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz", + "integrity": "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.34.1", + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/typescript-estree": "8.34.1" }, "engines": { - "node": ">= 8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.34.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz", + "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "@typescript-eslint/types": "8.34.1", + "eslint-visitor-keys": "^4.2.1" + }, "engines": { - "node": ">= 8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, "engines": { - "node": ">= 8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.7.12.tgz", + "integrity": "sha512-C//UObaqVcGKpRMMThzBCDxbqM9YQg2dtWy3OwcERLu+qzLa781AqvGdgqwqakRO+cWCK6dl75ebAcsSozmARg==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", "optional": true, - "engines": { - "node": ">=14" - } + "os": [ + "darwin" + ], + "peer": true }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.7.12.tgz", + "integrity": "sha512-eRXO0uPaZtWIogCeVlpSCfzKr3ZJynQl3IRzhFucrA+efdjAylS+ZemWFfnhGbQgWv4lItKCfCpxGuZsosudWw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "peer": true }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.7.12.tgz", + "integrity": "sha512-VUdT2CwMoyWy9Jolavu2fWTcusiA9FePjSyMLIrZvAeC2PMnM9msF3HJkO/j0S2fZkzgZy+UBBZjJwG0Mfds0g==", + "cpu": [ + "x64" + ], "dev": true, - "peer": true, - "dependencies": { - "type-detect": "4.0.8" - } + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.7.12.tgz", + "integrity": "sha512-hbWi7U2UlglpT1LQZbm7He3YpSRYGoHwFMMKC+oCD9UzPImFJZOFrQUL4FQVsOaxxz0ggWK1Q/ZcK23LpG2STg==", + "cpu": [ + "arm" + ], "dev": true, - "peer": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.7.12.tgz", + "integrity": "sha512-KBblhYFUhUTVSkTKxxaw4cFS3qgQMs2oM1DUSNrsFX7uRBG6SxXkLXGKua+uWq+G0vT7pp30BPXJ7c4I6vRGcw==", + "cpu": [ + "arm" + ], "dev": true, - "peer": true, - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.7.12.tgz", + "integrity": "sha512-A5jGMNiY5F/KyeLkph5/gaNXNs/P/FUJvhKIP79mIOn9KUqjqx+UbhZQ1UrRuGHsh0gXPVSnu2UJdhnvJsnEyw==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, - "dependencies": { - "@babel/types": "^7.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.7.12.tgz", + "integrity": "sha512-Gv/duj5YStydJTNu2vSHFbSrRimpA6mnVmAnKTe1xMfhqDCm10EP/U6u7NII1jAjbpaRmqtnvFhtndzGxDyfhA==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.7.12.tgz", + "integrity": "sha512-BTjdqhVVl1Q8dZCdNkVXZrfFyqNRdWizFuY5N0eHP7zgtNmqwJ3F/eJF/60GnabIcmWHvWvugby2VqHZtW/bQw==", + "cpu": [ + "ppc64" + ], "dev": true, - "peer": true, - "dependencies": { - "@babel/types": "^7.20.7" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.7.12.tgz", + "integrity": "sha512-YkjQuWGi1o174Xz2R+oQOOYQgViCwkSdpsHGmLr0QRYgQclJCQ4ug6qT+EGTYi1g4994q3BAaFVgV0GzEM1YSQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "peer": true, - "dependencies": { - "@types/node": "*" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.7.12.tgz", + "integrity": "sha512-9ud5x0qYBuk1rGdGzdjKQq/o7tObgI3IdjaufxKLD6kJIQi6vqww1mfoJklYw2OR5JXOWc6WLNKHa0Rr9aFZsw==", + "cpu": [ + "riscv64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.7.12.tgz", + "integrity": "sha512-3CNVBpgsvZ4Vrr18JAxQ8Qxz+k4PqTJR05/xn5Tczs9jFEuxPDxZKFskv9QnK3flJtx+ur9MayiTGgFZQAa7hA==", + "cpu": [ + "s390x" + ], "dev": true, - "peer": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dev": true, - "peer": true, - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.7.12.tgz", + "integrity": "sha512-bPACcY7lEp3M8IItjXEppQEsQ2N54a1aLb1yCWD16lccl8OG9aXQvji9x9VVcmdqR4JV4oWXzr0uIrZ+oFNvOw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.7.12.tgz", + "integrity": "sha512-86WuRbj+0tK3qWPthfsR952CHxE23lDTjbKfHOczIkjRvKP/ggAzaiNMOEljxB5iel4HhGTQZBp1lx61aw2q/g==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "peer": true }, - "node_modules/@types/node": { - "version": "20.11.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.28.tgz", - "integrity": "sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==", + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.7.12.tgz", + "integrity": "sha512-RzWV0OyeARtKRNHSbVZyj869P+WHzT2OFEgigs+5qEIM8X3QzbQ90Ye/1hCvgu0zi/cDCXtKWp8Utr1Oym2UIA==", + "cpu": [ + "wasm32" + ], "dev": true, + "license": "MIT", + "optional": true, "peer": true, "dependencies": { - "undici-types": "~5.26.4" + "@napi-rs/wasm-runtime": "^0.2.11" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", - "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", - "dev": true, - "peer": true - }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.7.12.tgz", + "integrity": "sha512-s9FdWj2QFT6PLNY/jPPmd7jF1Fn2HNSuLbZqUpdcSaMdeBGaDvy2C/eBYgGhrK7g8kIYUecT1LdT+SuDs6h+YA==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.7.12.tgz", + "integrity": "sha512-Fo4Op3Il/6HZ8Gm+YhqBkRZpTGe/QJZWAsCB/CLYBDqJ2NjXptgFsuIvlgXv95+WUkoTw6ifRgxE9gwtcAk5YA==", + "cpu": [ + "ia32" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true }, - "node_modules/@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", - "dev": true, - "peer": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.7.12.tgz", + "integrity": "sha512-00cVr73Qizmx7qycr9aO5NBofoAHuQIhNsuqj+I2Bun/yMddLfpXk86K3GWj096jXLzk0u/77u3qUTJPhuYWiw==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "peer": true }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", - "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", - "dev": true, - "peer": true, - "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/type-utils": "7.2.0", - "@typescript-eslint/utils": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.4", - "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", - "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/typescript-estree": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", - "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", - "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "7.2.0", - "@typescript-eslint/utils": "7.2.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", - "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", - "dev": true, - "peer": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", - "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/visitor-keys": "7.2.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", - "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", - "dev": true, - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.2.0", - "@typescript-eslint/types": "7.2.0", - "@typescript-eslint/typescript-estree": "7.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", - "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "node_modules/@xml-tools/parser": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.11.tgz", + "integrity": "sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "@typescript-eslint/types": "7.2.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "chevrotain": "7.1.1" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "peer": true - }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, + "license": "MIT", "peer": true, "bin": { "acorn": "bin/acorn" @@ -2406,6 +2624,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -2416,6 +2635,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2428,42 +2648,17 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, - "peer": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -2471,6 +2666,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2481,36 +2677,35 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "peer": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, + "license": "Python-2.0", "peer": true }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -2520,17 +2715,21 @@ } }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-string": "^1.0.7" + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2539,28 +2738,21 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/array.prototype.filter": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz", - "integrity": "sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==", + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2569,17 +2761,17 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", - "integrity": "sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==", + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.3.0", + "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" }, "engines": { @@ -2589,17 +2781,18 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2608,17 +2801,21 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", - "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -2627,27 +2824,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" - }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/available-typed-arrays": { @@ -2655,6 +2840,7 @@ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "possible-typed-array-names": "^1.0.0" @@ -2666,161 +2852,54 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "peer": true, - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "peer": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", "dev": true, + "license": "Apache-2.0", "peer": true, - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">= 0.4" } }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "dev": true, "funding": [ { @@ -2836,12 +2915,13 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" @@ -2850,34 +2930,12 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", - "dev": true, - "peer": true, - "dependencies": { - "fast-json-stable-stringify": "2.x" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "peer": true, - "dependencies": { - "node-int64": "^0.4.0" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/builtin-modules": { @@ -2885,6 +2943,7 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -2893,28 +2952,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "semver": "^7.0.0" + "engines": { + "node": ">= 0.8" } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -2923,30 +2983,54 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001599", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz", - "integrity": "sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA==", + "version": "1.0.30001721", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz", + "integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==", "dev": true, "funding": [ { @@ -2962,13 +3046,27 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "CC-BY-4.0", "peer": true }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -2981,20 +3079,33 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=10" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chevrotain": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.1.1.tgz", + "integrity": "sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "regexp-to-ast": "0.5.0" } }, "node_modules/ci-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", - "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", + "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", "dev": true, "funding": [ { @@ -3002,23 +3113,18 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "peer": true, "engines": { "node": ">=8" } }, - "node_modules/cjs-module-lexer": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", - "dev": true, - "peer": true - }, "node_modules/clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" @@ -3032,49 +3138,29 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.8.0" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": ">=6" } }, - "node_modules/collect-v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true, - "peer": true - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -3086,63 +3172,46 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true, - "peer": true - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, + "license": "MIT", "peer": true }, "node_modules/core-js-compat": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.0.tgz", - "integrity": "sha512-iV9Pd/PsgjNWBXeq8XRtWVSgz2tKAfhfvBs7qxYty+RlRd+OCksaWmOnc4JKrTc1cToXL1N0s3l/vwlxPtdElw==", + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.43.0.tgz", + "integrity": "sha512-2GML2ZsCc5LR7hZYz4AXmjQw8zuy2T//2QntwdnpuYI7jteT6GVYJL7F6C2C57R7gSYrcqVW3lAALefdbhBLDA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "browserslist": "^4.22.3" + "browserslist": "^4.25.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "peer": true, - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3153,15 +3222,16 @@ } }, "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -3171,31 +3241,33 @@ } }, "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" }, @@ -3207,13 +3279,14 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3224,19 +3297,19 @@ } } }, - "node_modules/dedent": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", - "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "node_modules/decode-named-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.1.0.tgz", + "integrity": "sha512-Wy+JTSbFThEOXQIR2L6mxJvEs+veIzpmqD7ynWxMXGpnk3smkHQOp6forLdHsKpAMW9iJpaBBIxz285t1n1C3w==", "dev": true, + "license": "MIT", "peer": true, - "peerDependencies": { - "babel-plugin-macros": "^3.1.0" + "dependencies": { + "character-entities": "^2.0.0" }, - "peerDependenciesMeta": { - "babel-plugin-macros": { - "optional": true - } + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/deep-is": { @@ -3244,23 +3317,15 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "es-define-property": "^1.0.0", @@ -3279,6 +3344,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "define-data-property": "^1.0.1", @@ -3292,102 +3358,115 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12.20" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "path-type": "^4.0.0" + "dequal": "^2.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" } }, - "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=12" + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, - "funding": { - "url": "https://dotenvx.com" + "engines": { + "node": ">= 0.4" } }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.708", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.708.tgz", - "integrity": "sha512-iWgEEvREL4GTXXHKohhh33+6Y8XkPI5eHihDmm8zUk5Zo7HICEW+wI/j5kJ2tbuNUCXJ/sNXa03ajW635DiJXA==", + "version": "1.5.166", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.166.tgz", + "integrity": "sha512-QPWqHL0BglzPYyJJ1zSSmwFFL6MFXhbACOCcsCdUMCkzPdS9/OIBVxg516X/Ado2qwAq8k0nJJ7phQPCqiaFAw==", "dev": true, + "license": "ISC", "peer": true }, - "node_modules/emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" - } - }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" }, "node_modules/enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -3397,69 +3476,68 @@ "node": ">=10.13.0" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "peer": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, "node_modules/es-abstract": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", - "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", + "is-data-view": "^1.0.2", "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.5", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" }, "engines": { "node": ">= 0.4" @@ -3468,22 +3546,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true, - "peer": true - }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -3493,16 +3562,18 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" } }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "es-errors": "^1.3.0" @@ -3512,40 +3583,47 @@ } }, "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "get-intrinsic": "^1.2.4", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -3555,49 +3633,53 @@ } }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", + "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "peer": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -3608,6 +3690,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -3617,67 +3700,77 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", + "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.14.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.27.0", + "@eslint/plugin-kit": "^0.3.1", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-compat-utils": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", - "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "semver": "^7.5.4" + }, "engines": { "node": ">=12" }, @@ -3686,23 +3779,54 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", + "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "dev": true, + "license": "MIT", "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, "peerDependencies": { "eslint": ">=7.0.0" } }, + "node_modules/eslint-import-context": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.8.tgz", + "integrity": "sha512-bq+F7nyc65sKpZGT09dY0S0QrOnQtuDVIfyTGQ8uuvtMIF7oHp6CEP3mouN0rrnYF3Jqo6Ke0BfU/5wASZue1w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-tsconfig": "^4.10.1", + "stable-hash-x": "^0.1.1" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-import-context" + }, + "peerDependencies": { + "unrs-resolver": "^1.0.0" + }, + "peerDependenciesMeta": { + "unrs-resolver": { + "optional": true + } + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "debug": "^3.2.7", @@ -3715,42 +3839,54 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-import-resolver-typescript": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", - "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.1.tgz", + "integrity": "sha512-KHQnjMAn/Hbs1AcMs2YfJTeNoWsaOoMRvJUKr77Y2dv7jNOaT8/IJYlvfN/ZIwTxUsv2B6amwv7u9bt2Vl9lZg==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "debug": "^4.3.4", - "enhanced-resolve": "^5.12.0", - "eslint-module-utils": "^2.7.4", - "fast-glob": "^3.3.1", - "get-tsconfig": "^4.5.0", - "is-core-module": "^2.11.0", - "is-glob": "^4.0.3" + "debug": "^4.4.1", + "eslint-import-context": "^0.1.5", + "get-tsconfig": "^4.10.1", + "is-bun-module": "^2.0.0", + "stable-hash": "^0.0.5", + "tinyglobby": "^0.2.14", + "unrs-resolver": "^1.7.2" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^16.17.0 || >=18.6.0" }, "funding": { - "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + "url": "https://opencollective.com/eslint-import-resolver-typescript" }, "peerDependencies": { "eslint": "*", - "eslint-plugin-import": "*" + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } } }, "node_modules/eslint-module-utils": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", - "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "debug": "^3.2.7" @@ -3769,28 +3905,31 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-es-x": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", - "integrity": "sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", + "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==", "dev": true, + "funding": [ + "https://github.com/sponsors/ota-meshi", + "https://opencollective.com/eslint" + ], + "license": "MIT", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.1.2", - "@eslint-community/regexpp": "^4.6.0", - "eslint-compat-utils": "^0.1.2" + "@eslint-community/regexpp": "^4.11.0", + "eslint-compat-utils": "^0.5.1" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ota-meshi" - }, "peerDependencies": { "eslint": ">=8" } @@ -3800,6 +3939,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5", @@ -3820,52 +3960,45 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.8.0" } }, "node_modules/eslint-plugin-import": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", - "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -3873,338 +4006,286 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "ms": "^2.1.1" } }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "peer": true, "bin": { "semver": "bin/semver.js" } }, - "node_modules/eslint-plugin-jest": { - "version": "27.9.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz", - "integrity": "sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==", + "node_modules/eslint-plugin-n": { + "version": "17.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.18.0.tgz", + "integrity": "sha512-hvZ/HusueqTJ7VDLoCpjN0hx4N4+jHIWTXD4TMLHy9F23XkDagR9v+xQWRWR57yY55GPF8NnD4ox9iGTxirY8A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@eslint-community/eslint-utils": "^4.5.0", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "ignore": "^5.3.2", + "minimatch": "^9.0.5", + "semver": "^7.6.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0", - "eslint": "^7.0.0 || ^8.0.0", - "jest": "*" + "funding": { + "url": "https://opencollective.com/eslint" }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - }, - "jest": { - "optional": true - } + "peerDependencies": { + "eslint": ">=8.23.0" } }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "node_modules/eslint-plugin-n/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "balanced-match": "^1.0.0" } }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "node_modules/eslint-plugin-n/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "node_modules/eslint-plugin-no-only-tests": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.3.0.tgz", + "integrity": "sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "node": ">=5.0.0" } }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "node_modules/eslint-plugin-no-secrets": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-secrets/-/eslint-plugin-no-secrets-2.2.1.tgz", + "integrity": "sha512-/7BduEiFeINJ7mlc8iRmqp0sDw2a2lAFahig/RGppn7qf1dKhldXopUuv4M92kc4PX90dcxfKwKtYrW159cuhA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=18", + "npm": ">=8" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/eslint-plugin-jest/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "node_modules/eslint-plugin-sonarjs": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-3.0.2.tgz", + "integrity": "sha512-LxjbfwI7ypENeTmGyKmDyNux3COSkMi7H/6Cal5StSLQ6edf0naP45SZR43OclaNR7WfhVTZdhOn63q3/Y6puQ==", "dev": true, + "license": "LGPL-3.0-only", "peer": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "@eslint-community/regexpp": "4.12.1", + "builtin-modules": "3.3.0", + "bytes": "3.1.2", + "functional-red-black-tree": "1.0.1", + "jsx-ast-utils": "3.3.5", + "minimatch": "9.0.5", + "scslre": "0.3.0", + "semver": "7.7.1", + "typescript": "^5" }, - "engines": { - "node": ">=8.0.0" + "peerDependencies": { + "eslint": "^8.0.0 || ^9.0.0" } }, - "node_modules/eslint-plugin-jest/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/eslint-plugin-sonarjs/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=4.0" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/eslint-plugin-n": { - "version": "16.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz", - "integrity": "sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==", + "node_modules/eslint-plugin-sonarjs/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "builtins": "^5.0.1", - "eslint-plugin-es-x": "^7.5.0", - "get-tsconfig": "^4.7.0", - "globals": "^13.24.0", - "ignore": "^5.2.4", - "is-builtin-module": "^3.2.1", - "is-core-module": "^2.12.1", - "minimatch": "^3.1.2", - "resolve": "^1.22.2", - "semver": "^7.5.3" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-plugin-n/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/eslint-plugin-n/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/eslint-plugin-sonarjs/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, + "license": "ISC", "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": "*" + "node": ">=10" } }, - "node_modules/eslint-plugin-no-only-tests": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz", - "integrity": "sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==", + "node_modules/eslint-plugin-unicorn": { + "version": "59.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-59.0.1.tgz", + "integrity": "sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "@eslint-community/eslint-utils": "^4.5.1", + "@eslint/plugin-kit": "^0.2.7", + "ci-info": "^4.2.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.41.0", + "esquery": "^1.6.0", + "find-up-simple": "^1.0.1", + "globals": "^16.0.0", + "indent-string": "^5.0.0", + "is-builtin-module": "^5.0.0", + "jsesc": "^3.1.0", + "pluralize": "^8.0.0", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.12.0", + "semver": "^7.7.1", + "strip-indent": "^4.0.0" + }, "engines": { - "node": ">=5.0.0" + "node": "^18.20.0 || ^20.10.0 || >=21.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=9.22.0" } }, - "node_modules/eslint-plugin-no-secrets": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-secrets/-/eslint-plugin-no-secrets-0.8.9.tgz", - "integrity": "sha512-CqaBxXrImABCtxMWspAnm8d5UKkpNylC7zqVveb+fJHEvsSiNGJlSWzdSIvBUnW1XhJXkzifNIZQC08rEII5Ng==", + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.2.0.tgz", + "integrity": "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=10.0.0", - "npm": ">=6.9.0" + "node": ">=18" }, - "peerDependencies": { - "eslint": ">=3.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-sonarjs": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.24.0.tgz", - "integrity": "sha512-87zp50mbbNrSTuoEOebdRQBPa0mdejA5UEjyuScyIw8hEpEjfWP89Qhkq5xVZfVyVSRQKZc9alVm7yRKQvvUmg==", + "node_modules/eslint-plugin-yml": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.18.0.tgz", + "integrity": "sha512-9NtbhHRN2NJa/s3uHchO3qVVZw0vyOIvWlXWGaKCr/6l3Go62wsvJK5byiI6ZoYztDsow4GnS69BZD3GnqH3hA==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "debug": "^4.3.2", + "escape-string-regexp": "4.0.0", + "eslint-compat-utils": "^0.6.0", + "natural-compare": "^1.4.0", + "yaml-eslint-parser": "^1.2.1" + }, "engines": { - "node": ">=16" + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": ">=6.0.0" } }, - "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "node_modules/eslint-plugin-yml/node_modules/eslint-compat-utils": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.5.tgz", + "integrity": "sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "@eslint-community/eslint-utils": "^4.4.0", - "@eslint/eslintrc": "^2.1.4", - "ci-info": "^4.0.0", - "clean-regexp": "^1.0.0", - "core-js-compat": "^3.34.0", - "esquery": "^1.5.0", - "indent-string": "^4.0.0", - "is-builtin-module": "^3.2.1", - "jsesc": "^3.0.2", - "pluralize": "^8.0.0", - "read-pkg-up": "^7.0.1", - "regexp-tree": "^0.1.27", - "regjsparser": "^0.10.0", - "semver": "^7.5.4", - "strip-indent": "^3.0.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + "node": ">=12" }, "peerDependencies": { - "eslint": ">=8.56.0" + "eslint": ">=6.0.0" } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -4215,6 +4296,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4223,67 +4305,96 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/eslint/node_modules/@eslint/core": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", + "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/eslint/node_modules/@eslint/plugin-kit": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz", + "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { - "brace-expansion": "^1.1.7" + "@eslint/core": "^0.14.0", + "levn": "^0.4.1" }, "engines": { - "node": "*" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, "engines": { - "node": ">=4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "peer": true, "dependencies": { "estraverse": "^5.1.0" @@ -4292,11 +4403,23 @@ "node": ">=0.10" } }, + "node_modules/esrap": { + "version": "1.4.9", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.9.tgz", + "integrity": "sha512-3OMlcd0a03UGuZpPeUC1HxR3nA23l+HEyCiZw3b3FumJIN9KphoGzDJKMXI1S72jVS1dsenDyQC0kJlO1U9E1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { "estraverse": "^5.2.0" @@ -4310,6 +4433,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "engines": { "node": ">=4.0" @@ -4320,81 +4444,33 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "peer": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, - "peer": true, - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -4405,6 +4481,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { "is-glob": "^4.0.1" @@ -4418,6 +4495,7 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/fast-levenshtein": { @@ -4425,46 +4503,55 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { "reusify": "^1.0.4" } }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "node_modules/fault": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", + "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "bser": "2.1.1" + "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -4478,6 +4565,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "locate-path": "^6.0.0", @@ -4490,75 +4578,70 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, + "license": "ISC", "peer": true }, "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" + "is-callable": "^1.2.7" }, "engines": { - "node": ">=14" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, "engines": { "node": ">=14" }, @@ -4566,26 +4649,14 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "node_modules/format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "peer": true, "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=0.4.x" } }, "node_modules/function-bind": { @@ -4593,22 +4664,26 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -4617,48 +4692,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, + "license": "MIT", "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "peer": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -4667,39 +4737,46 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, "engines": { - "node": ">=8.0.0" + "node": ">= 0.4" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/get-stdin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", + "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -4709,10 +4786,11 @@ } }, "node_modules/get-tsconfig": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", - "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", + "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" @@ -4721,22 +4799,36 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/git-hooks-list": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-3.2.0.tgz", + "integrity": "sha512-ZHG9a1gEhUMX1TvGrLdyWb9kDopCBbTnI8z4JgRMYxsijWipgjSEYoPWqBuIB0DnRnvqlQSEeVmzpeuPm7NdFQ==", "dev": true, + "license": "MIT", "peer": true, + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, + "node_modules/glob": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4747,6 +4839,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { "is-glob": "^4.0.3" @@ -4756,53 +4849,55 @@ } }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, - "peer": true, + "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -4811,35 +4906,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "peer": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4850,6 +4925,7 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true, + "license": "ISC", "peer": true }, "node_modules/graphemer": { @@ -4857,14 +4933,19 @@ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, + "license": "MIT", "peer": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4874,6 +4955,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=8" @@ -4884,6 +4966,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "es-define-property": "^1.0.0" @@ -4893,11 +4976,15 @@ } }, "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -4906,10 +4993,11 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -4923,6 +5011,7 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "has-symbols": "^1.0.3" @@ -4939,6 +5028,7 @@ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "function-bind": "^1.1.2" @@ -4947,45 +5037,31 @@ "node": ">= 0.4" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true, - "peer": true - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "node_modules/http-status-codes": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", + "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "parent-module": "^1.0.0", @@ -4998,88 +5074,58 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "peer": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=8" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -5088,35 +5134,54 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, - "peer": true + "license": "MIT", + "peer": true, + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5126,26 +5191,53 @@ } }, "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", + "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "builtin-modules": "^3.3.0" + "builtin-modules": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-builtin-module/node_modules/builtin-modules": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", + "integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-bun-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", + "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "semver": "^7.7.1" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -5155,25 +5247,32 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" }, "engines": { @@ -5184,13 +5283,15 @@ } }, "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5204,35 +5305,65 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, "engines": { - "node": ">=6" - } - }, - "node_modules/is-glob": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "is-extglob": "^2.1.1" @@ -5241,11 +5372,26 @@ "node": ">=0.10.0" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -5259,19 +5405,22 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5280,25 +5429,43 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "^1.0.6" } }, "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -5307,15 +5474,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "call-bind": "^1.0.7" - }, "engines": { "node": ">= 0.4" }, @@ -5323,27 +5488,33 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "call-bound": "^1.0.3" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5353,13 +5524,16 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -5369,13 +5543,14 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -5384,1004 +5559,1229 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "call-bind": "^1.0.2" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "peer": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", - "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/core": "^7.23.9", - "@babel/parser": "^7.23.9", - "@istanbuljs/schema": "^0.1.3", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" + "call-bound": "^1.0.3" }, "engines": { - "node": ">=10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": ">=10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true, - "peer": true, - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=10" - } + "license": "MIT", + "peer": true }, - "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "peer": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } + "license": "ISC" }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "argparse": "^2.0.1" }, "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0" + "bin": { + "jsesc": "bin/jsesc" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=6" } }, - "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, - "peer": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } + "license": "MIT", + "peer": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT", + "peer": true }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" + "minimist": "^1.2.0" }, "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "json5": "lib/cli.js" } }, - "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } + "node": ">=4.0" } }, - "node_modules/jest-config/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], + "license": "MIT", "peer": true, - "engines": { - "node": ">=8" + "dependencies": { + "json-buffer": "3.0.1" } }, - "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.8.0" } }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "dev": true, - "peer": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } + "license": "MIT", + "peer": true }, - "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "p-locate": "^5.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "dev": true, + "license": "ISC", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "20 || >=22" } }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/markdown-table": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" } }, - "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "node_modules/mdast-util-from-markdown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", + "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "node_modules/mdast-util-frontmatter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", + "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "escape-string-regexp": "^5.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-extension-frontmatter": "^2.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "node_modules/mdast-util-gfm": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", + "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "node_modules/mdast-util-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=6" + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" }, - "peerDependencies": { - "jest-resolve": "*" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "peer": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "@types/mdast": "^4.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 8" } }, - "node_modules/jest-util/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", "dev": true, "funding": [ { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" } ], + "license": "MIT", "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-frontmatter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", + "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fault": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=10" + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/micromark-extension-gfm-table": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", + "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", "dev": true, - "peer": true + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "argparse": "^2.0.1" + "micromark-util-types": "^2.0.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jsbi": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.0.tgz", - "integrity": "sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==", - "dev": true - }, - "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", "dev": true, + "license": "MIT", "peer": true, - "bin": { - "jsesc": "bin/jsesc" + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", "dev": true, - "peer": true + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", "dev": true, - "peer": true + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", "dev": true, - "peer": true + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", "dev": true, - "peer": true + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "json-buffer": "3.0.1" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, - "engines": { - "node": ">=6" + "dependencies": { + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, - "engines": { - "node": ">=6" + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", "dev": true, - "peer": true + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "yallist": "^3.0.2" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true, - "peer": true - }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true, "dependencies": { - "tmpl": "1.0.5" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", "peer": true }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, - "peer": true, - "engines": { - "node": ">= 8" - } + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "peer": true }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=4" } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", + "peer": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minimist": { @@ -6389,100 +6789,73 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, + "license": "MIT", "peer": true }, + "node_modules/napi-postinstall": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.2.4.tgz", + "integrity": "sha512-ZEzHJwBhZ8qQSbknHqYcdtQVr8zUgGyM/q6h6qAyhtyVMNrSgDhrC4disf03dYW0e+czXyLnZINnCTEkWy0eJg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, - "peer": true - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, + "license": "MIT", "peer": true }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "peer": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "peer": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^3.0.0" + "node": ">= 0.4" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6492,21 +6865,25 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -6517,15 +6894,17 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -6535,29 +6914,33 @@ } }, "node_modules/object.groupby": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", - "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "array.prototype.filter": "^1.0.3", - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.0.0" + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -6566,48 +6949,68 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "wrappy": "1" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "mimic-fn": "^2.1.0" + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "node_modules/oxc-resolver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-5.3.0.tgz", + "integrity": "sha512-FHqtZx0idP5QRPSNcI5g2ItmADg7fhR3XIeWg5eRMGfp44xqRpfkdvo+EX4ZceqV9bxvl0Z8vaqMqY0gYaNYNA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "funding": { + "url": "https://github.com/sponsors/Boshen" }, - "engines": { - "node": ">= 0.8.0" + "optionalDependencies": { + "@oxc-resolver/binding-darwin-arm64": "5.3.0", + "@oxc-resolver/binding-darwin-x64": "5.3.0", + "@oxc-resolver/binding-freebsd-x64": "5.3.0", + "@oxc-resolver/binding-linux-arm-gnueabihf": "5.3.0", + "@oxc-resolver/binding-linux-arm64-gnu": "5.3.0", + "@oxc-resolver/binding-linux-arm64-musl": "5.3.0", + "@oxc-resolver/binding-linux-riscv64-gnu": "5.3.0", + "@oxc-resolver/binding-linux-s390x-gnu": "5.3.0", + "@oxc-resolver/binding-linux-x64-gnu": "5.3.0", + "@oxc-resolver/binding-linux-x64-musl": "5.3.0", + "@oxc-resolver/binding-wasm32-wasi": "5.3.0", + "@oxc-resolver/binding-win32-arm64-msvc": "5.3.0", + "@oxc-resolver/binding-win32-x64-msvc": "5.3.0" } }, "node_modules/p-limit": { @@ -6615,6 +7018,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "yocto-queue": "^0.1.0" @@ -6631,6 +7035,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "p-limit": "^3.0.2" @@ -6642,21 +7047,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } + "license": "BlueOak-1.0.0" }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "callsites": "^3.0.0" @@ -6665,193 +7068,83 @@ "node": ">=6" } }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "peer": true - }, - "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", - "dev": true, - "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true, - "peer": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "find-up": "^4.0.0" - }, "engines": { "node": ">=8" } }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, - "peer": true, + "license": "MIT", + "peer": true + }, + "node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "p-locate": "^4.1.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=8" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "p-try": "^2.0.0" - }, "engines": { - "node": ">=6" + "node": ">=8.6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { - "node": ">=8" + "node": ">= 6" } }, "node_modules/pluralize": { @@ -6859,16 +7152,18 @@ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=4" } }, "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -6879,16 +7174,18 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, + "license": "MIT", "peer": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6900,46 +7197,116 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "node_modules/prettier-plugin-packagejson": { + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/prettier-plugin-packagejson/-/prettier-plugin-packagejson-2.5.10.tgz", + "integrity": "sha512-LUxATI5YsImIVSaaLJlJ3aE6wTD+nvots18U3GuQMJpUyClChaZlQrqx3dBnbhF20OnKWZyx8EgyZypQtBDtgQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "sort-package-json": "2.15.1", + "synckit": "0.9.2" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "peerDependencies": { + "prettier": ">= 1.16.0" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + } } }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "node_modules/prettier-plugin-svelte": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.3.3.tgz", + "integrity": "sha512-yViK9zqQ+H2qZD1w/bH7W8i+bVfKrD8GIFjkFe4Thl6kCT9SlAsXVNmt3jCvQOCsnOhcvYgsoVlRV/Eu6x5nNw==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.6.11", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.11.tgz", + "integrity": "sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, "engines": { - "node": ">= 6" + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } } }, "node_modules/punycode": { @@ -6947,28 +7314,12 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" } }, - "node_modules/pure-rand": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", - "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" - } - ], - "peer": true - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -6988,146 +7339,95 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "peer": true }, - "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true, - "peer": true - }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "peer": true, - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/refa": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.12.1.tgz", + "integrity": "sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-locate": "^4.1.0" + "@eslint-community/regexpp": "^4.8.0" }, "engines": { - "node": ">=8" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-try": "^2.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" }, "engines": { - "node": ">=6" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/regexp-ast-analysis": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.7.1.tgz", + "integrity": "sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "p-limit": "^2.2.0" + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "node_modules/regexp-to-ast": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", + "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } + "license": "MIT", + "peer": true }, "node_modules/regexp-tree": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, + "license": "MIT", "peer": true, "bin": { "regexp-tree": "bin/regexp-tree" } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -7137,84 +7437,61 @@ } }, "node_modules/regjsparser": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.10.0.tgz", - "integrity": "sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { - "jsesc": "~0.5.0" + "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, + "license": "MIT", "peer": true, "bin": { "jsesc": "bin/jsesc" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "peer": true, + }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "peer": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -7225,26 +7502,18 @@ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", "dev": true, + "license": "MIT", "peer": true, "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, + "license": "MIT", "peer": true, "engines": { "iojs": ">=1.0.0", @@ -7252,40 +7521,20 @@ } }, "node_modules/rimraf": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", - "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", - "dev": true, - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "dev": true, + "license": "ISC", "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" }, "bin": { - "glob": "dist/esm/bin.mjs" + "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -7310,21 +7559,24 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "peer": true, "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -7334,16 +7586,16 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.6", "es-errors": "^1.3.0", - "is-regex": "^1.1.4" + "isarray": "^2.0.5" }, "engines": { "node": ">= 0.4" @@ -7352,47 +7604,61 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" }, "engines": { - "node": ">=10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/scslre": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.3.0.tgz", + "integrity": "sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "yallist": "^4.0.0" + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.0", + "regexp-ast-analysis": "^0.7.0" }, "engines": { - "node": ">=10" + "node": "^14.0.0 || >=16.0.0" } }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "peer": true + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "define-data-property": "^1.1.4", @@ -7411,6 +7677,7 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "define-data-property": "^1.1.4", @@ -7422,11 +7689,28 @@ "node": ">= 0.4" } }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -7439,21 +7723,83 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -7463,27 +7809,45 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "peer": true + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/sort-package-json": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-2.15.1.tgz", + "integrity": "sha512-9x9+o8krTT2saA9liI4BljNjwAbvUnWf11Wq+i/iZt8nl2UGYnf3TH5uBydE7VALmP7AGwlfszuEeL8BDyb0YA==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=8" + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.0", + "get-stdin": "^9.0.0", + "git-hooks-list": "^3.0.0", + "is-plain-obj": "^4.1.0", + "semver": "^7.6.0", + "sort-object-keys": "^1.1.3", + "tinyglobby": "^0.2.9" + }, + "bin": { + "sort-package-json": "cli.js" } }, "node_modules/source-map": { @@ -7491,107 +7855,83 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "peer": true, "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "peer": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", - "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "node_modules/stable-hash": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.5.tgz", + "integrity": "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA==", "dev": true, + "license": "MIT", "peer": true }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "node_modules/stable-hash-x": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.1.1.tgz", + "integrity": "sha512-l0x1D6vhnsNUGPFVDx45eif0y6eedVC8nm5uACTrVFJFtl2mLRW17aWtVyxFCpn5t94VUPkjU8vSLwIuwwqtJQ==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "engines": { + "node": ">=12.0.0" } }, - "node_modules/spdx-license-ids": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", - "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", - "dev": true, - "peer": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "peer": true - }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "escape-string-regexp": "^2.0.0" + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" }, "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width": { + "node_modules/string-width-cjs": { + "name": "string-width", "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -7601,32 +7941,51 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -7636,45 +7995,58 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/strip-ansi-cjs": { @@ -7683,6 +8055,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7690,37 +8063,42 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "peer": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=6" + "node": ">=4" } }, "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "min-indent": "^1.0.0" + "min-indent": "^1.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-json-comments": { @@ -7728,6 +8106,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=8" @@ -7741,6 +8120,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "has-flag": "^4.0.0" @@ -7754,6 +8134,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -7762,77 +8143,108 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "node_modules/svelte": { + "version": "5.33.18", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.33.18.tgz", + "integrity": "sha512-GVAhi8vi8pGne/wlEdnfWIJvSR9eKvEknxjfL5Sr8gQALiyk8Ey+H0lhUYLpjW+MrqgH9h4dgh2NF6/BTFprRg==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "esm-env": "^1.2.1", + "esrap": "^1.4.8", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, "engines": { - "node": ">=6" + "node": ">=18" } }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=8" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", "dev": true, + "license": "MIT", "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": ">=6" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "brace-expansion": "^1.1.7" + "fdir": "^6.4.4", + "picomatch": "^4.0.2" }, "engines": { - "node": "*" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "peer": true - }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", + "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", "dev": true, - "peer": true + "license": "MIT", + "peer": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/to-regex-range": { @@ -7840,6 +8252,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "is-number": "^7.0.0" @@ -7849,190 +8262,376 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "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==", "dev": true, + "license": "MIT", "peer": true, "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" } }, - "node_modules/ts-jest": { - "version": "29.1.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", - "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "peer": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", - "jest-util": "^29.0.0", - "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" + "prelude-ls": "^1.2.1" }, - "bin": { - "ts-jest": "cli.js" + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" }, "engines": { - "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, - "peerDependencies": { - "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/types": "^29.0.0", - "babel-jest": "^29.0.0", - "jest": "^29.0.0", - "typescript": ">=4.3 <6" + "engines": { + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "@jest/types": { - "optional": true - }, - "babel-jest": { - "optional": true - }, - "esbuild": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "minimist": "^1.2.0" + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, "bin": { - "json5": "lib/cli.js" + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, - "node_modules/tsconfig-paths/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "node_modules/typescript-eslint": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.33.0.tgz", + "integrity": "sha512-5YmNhF24ylCsvdNW2oJwMzTbaeO4bg90KeGtMjUw0AGtHksgEPLRTUil+coHwCfiu4QjVJFnjp94DmU6zV7DhQ==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.33.0", + "@typescript-eslint/parser": "8.33.0", + "@typescript-eslint/utils": "8.33.0" + }, "engines": { - "node": ">=4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "node_modules/typescript-eslint/node_modules/@typescript-eslint/project-service": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.33.0.tgz", + "integrity": "sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.33.0", + "@typescript-eslint/types": "^8.33.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.33.0.tgz", + "integrity": "sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "tslib": "^1.8.1" + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0" }, "engines": { - "node": ">= 6" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.0.tgz", + "integrity": "sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.33.0.tgz", + "integrity": "sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg==", "dev": true, - "peer": true + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.0.tgz", + "integrity": "sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/project-service": "8.33.0", + "@typescript-eslint/tsconfig-utils": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.33.0.tgz", + "integrity": "sha512-lPFuQaLA9aSNa7D5u2EpRiqdAUhzShwGg/nhpBlc4GR6kcTABttCuyjFs8BcEZ8VWrjCBof/bePhP3Q3fS+Yrw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.0.tgz", + "integrity": "sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "prelude-ls": "^1.2.1" + "@typescript-eslint/types": "8.33.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">= 0.8.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "node_modules/typescript-eslint/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, - "engines": { - "node": ">=4" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, + "license": "Apache-2.0", "peer": true, "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "node_modules/typescript-eslint/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" }, "engines": { "node": ">= 0.4" @@ -8041,89 +8640,115 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/typescript": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", - "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, + "license": "MIT", "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" }, - "engines": { - "node": ">=14.17" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "node_modules/unrs-resolver": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.7.12.tgz", + "integrity": "sha512-pfcdDxrVoUc5ZB3VCVJNSWbs63lgQVYLVw4k/rCr8Smi/V2Sxi1odEckVq6Zf803OtbYia1+YpiGCZoODfWLsQ==", "dev": true, - "peer": true + "hasInstallScript": true, + "license": "MIT", + "peer": true, + "dependencies": { + "napi-postinstall": "^0.2.2" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-darwin-arm64": "1.7.12", + "@unrs/resolver-binding-darwin-x64": "1.7.12", + "@unrs/resolver-binding-freebsd-x64": "1.7.12", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.7.12", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.7.12", + "@unrs/resolver-binding-linux-arm64-gnu": "1.7.12", + "@unrs/resolver-binding-linux-arm64-musl": "1.7.12", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.7.12", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.7.12", + "@unrs/resolver-binding-linux-riscv64-musl": "1.7.12", + "@unrs/resolver-binding-linux-s390x-gnu": "1.7.12", + "@unrs/resolver-binding-linux-x64-gnu": "1.7.12", + "@unrs/resolver-binding-linux-x64-musl": "1.7.12", + "@unrs/resolver-binding-wasm32-wasi": "1.7.12", + "@unrs/resolver-binding-win32-arm64-msvc": "1.7.12", + "@unrs/resolver-binding-win32-ia32-msvc": "1.7.12", + "@unrs/resolver-binding-win32-x64-msvc": "1.7.12" + } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -8139,10 +8764,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "peer": true, "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -8156,90 +8782,112 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { "punycode": "^2.1.0" } }, - "node_modules/v8-to-istanbul": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", - "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "peer": true, + "license": "ISC", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" }, "engines": { - "node": ">=10.12.0" + "node": ">= 8" } }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "makeerror": "1.0.12" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" }, "engines": { - "node": ">= 8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-boxed-primitive": { + "node_modules/which-collection": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, "engines": { @@ -8249,19 +8897,30 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -8273,6 +8932,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -8285,71 +8945,94 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "peer": true + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, - "peer": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "peer": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, - "peer": true + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "node_modules/yaml": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "dev": true, + "license": "ISC", "peer": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "bin": { + "yaml": "bin.mjs" }, "engines": { - "node": ">=12" + "node": ">= 14.6" } }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "node_modules/yaml-eslint-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.3.0.tgz", + "integrity": "sha512-E/+VitOorXSLiAqtTd7Yqax0/pAS3xaYMP+AUUJGOK1OZG3rhcj9fcJOM5HJ2VrP1FrStVCWr1muTfQCdj4tAA==", "dev": true, + "license": "MIT", "peer": true, + "dependencies": { + "eslint-visitor-keys": "^3.0.0", + "yaml": "^2.0.0" + }, "engines": { - "node": ">=12" + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" } }, "node_modules/yocto-queue": { @@ -8357,6 +9040,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -8364,6 +9048,26 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zimmerframe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", + "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } } } diff --git a/package.json b/package.json index fe2d4af..03e3356 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,19 @@ { "name": "@checkdigit/time", - "version": "4.0.0", + "version": "5.0.0", "description": "Standard time handling", - "author": "Check Digit, LLC", - "license": "MIT", + "homepage": "https://github.com/checkdigit/time#readme", "bugs": { "url": "https://github.com/checkdigit/time/issues" }, - "homepage": "https://github.com/checkdigit/time#readme", "repository": { "type": "git", "url": "git+https://github.com/checkdigit/time.git" }, - "engines": { - "node": ">=20.11" - }, - "type": "module", + "license": "MIT", + "author": "Check Digit, LLC", "sideEffects": false, + "type": "module", "exports": { ".": { "types": "./dist-types/index.d.ts", @@ -36,40 +33,32 @@ "!dist-mjs/**/*.spec.mjs", "SECURITY.md" ], - "devDependencies": { - "@checkdigit/eslint-config": "^9.2.0", - "@checkdigit/jest-config": "^6.0.0", - "@checkdigit/prettier-config": "^5.3.0", - "@checkdigit/typescript-config": "^7.0.1", - "@js-temporal/polyfill": "^0.4.4", - "rimraf": "^5.0.5" - }, "scripts": { - "prepublishOnly": "npm run build:dist-types && npm run build:dist-mjs", - "build:dist-types": "rimraf dist-types && npx builder --type=types --outDir=dist-types", "build:dist-mjs": "rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs", - "lint": "eslint --max-warnings 0 --ignore-path .gitignore .", - "lint:fix": "eslint --ignore-path .gitignore . --fix", - "prettier": "prettier --ignore-path .gitignore --list-different .", - "prettier:fix": "prettier --ignore-path .gitignore --write .", - "test": "npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style", + "build:dist-types": "rimraf dist-types && npx builder --type=types --outDir=dist-types", "ci:compile": "tsc --noEmit", - "ci:test": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false", - "ci:coverage": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true", + "ci:coverage": "rimraf coverage && mkdir coverage && node --disable-warning ExperimentalWarning --experimental-strip-types --test-timeout 600000 --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test \"src/**/*.spec.ts\"", "ci:lint": "npm run lint", - "ci:style": "npm run prettier" - }, - "jest": { - "preset": "@checkdigit/jest-config" + "ci:style": "npm run prettier", + "ci:test": "node --disable-warning ExperimentalWarning --experimental-strip-types --test-timeout 600000 --test \"src/**/*.spec.ts\"", + "clean": "npm cache verify && rimraf coverage node_modules", + "coverage": "node --disable-warning ExperimentalWarning --experimental-strip-types --test-timeout 600000 --experimental-test-coverage --test \"src/**/*.spec.ts\"", + "lint": "eslint --max-warnings 0 .", + "lint:fix": "eslint . --fix", + "prepare": "", + "prepublishOnly": "npm run build:dist-types && npm run build:dist-mjs", + "prettier": "prettier --ignore-path .gitignore --list-different .", + "prettier:fix": "prettier --ignore-path .gitignore --write .", + "test": "npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style" }, - "eslintConfig": { - "extends": [ - "@checkdigit/eslint-config" - ], - "ignorePatterns": [ - "src/date-fns/**", - "src/date-fns-tz/**" - ] + "prettier": "@checkdigit/prettier-config", + "devDependencies": { + "@checkdigit/eslint-config": "^11.2.7", + "@checkdigit/prettier-config": "^6.3.0", + "@checkdigit/typescript-config": "^9.1.1", + "rimraf": "^6.0.1" }, - "prettier": "@checkdigit/prettier-config" + "engines": { + "node": ">=22.15" + } } diff --git a/src/date-fns-tz.spec.ts b/src/date-fns-tz.spec.ts index efa239f..c8ad76e 100644 --- a/src/date-fns-tz.spec.ts +++ b/src/date-fns-tz.spec.ts @@ -1,12 +1,13 @@ // date-fns-tz.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { tzFormat, tzUtcToZonedTime } from './index'; +import { tzFormat, tzUtcToZonedTime } from './index.ts'; describe('date-fns-tz', () => { + process.loadEnvFile(); + it('tzFormat works', () => { assert.equal( tzFormat(tzUtcToZonedTime(new Date('Tue Sep 13 2022 13:38:00 GMT-0400'), 'UTC'), 'yyyy-MM-dd', { diff --git a/src/date-fns-tz/CHANGELOG.md b/src/date-fns-tz/CHANGELOG.md index 12ab570..8b66ba5 100644 --- a/src/date-fns-tz/CHANGELOG.md +++ b/src/date-fns-tz/CHANGELOG.md @@ -1,3 +1,85 @@ +### v3.2.0 (27 September 2024) + +- [DEPS] `date-fns@4.0.0` supported (#301) +- [PERFORMANCE] Make testDateFormatted static to avoid re-initialising it on every call (#297) @hurali97 +- [ENHANCEMENT] Compatibility with `date-fns` `setDefaultOptions` (#286) @yangchristina +- [DOCS] Fixed table of contents links (#284) + +### v3.1.3 (17 April 2024) + +- [BUGFIX] Make `getTimeZoneOffset`'s 2nd arg optional + +### v3.1.2 (16 April 2024) + +- [BUGFIX] Fix `formatInTimeZone` use of `timeZone` string (#280) + +### v3.1.1 (16 April 2024) + +- [BUGFIX] `getTimeZoneOffset`'s 2nd arg should be optional (#281) + +### v3.1.0 (15 April 2024) + +- [REFACTOR] Full rewrite in TypeScript (#278) Thank you, @brettwillis +- [BREAKING CHANGE] `OptionsWithTZ` is now either `FormatOptionsWithTZ` or `ToDateOptionsWithTZ`, matching `date-fns` + +### v3.0.1 (10 April 2024) + +- [BUGFIX] Fix named export typings (#277) + +### v3.0.0 (6 April 2024) + +- [UPGRADE] Support `date-fns` v3 (#265) Thank you, @christopherklint97 +- [BUGFIX] Correct import of `date-fns@v3` format and use Babel Webpack loader for mjs files (#271) +- [BREAKING CHANGE] `date-fns` v2 is no longer supported +- [BREAKING CHANGE] Renamed `utcToZonedTime` to `toZonedTime` to make the name less confusing, just search & replace +- [BREAKING CHANGE] Renamed `zonedTimeToUtc` to `fromZonedTime` to make the name less confusing, just search & replace +- [BREAKING CHANGE] All functions are now exported using named exports, this requires changing direct + imports from `import formatInTimeZone from 'date-fns-tz/formatInTimeZone'` to + `import { formatInTimeZone } from 'date-fns-tz/formatInTimeZone'` +- [BREAKING CHANGE] Functions now don’t check the number of passed arguments, delegating this task to type checkers + (This isn't fully implemented yet, but it should be the assumption moving forward, as it is in `date-fns`) +- [BREAKING CHANGE] Arguments are not explicitly converted to the target types. Instead, they are passed as is, + delegating this task to type checkers (This isn't fully implemented yet, but it should be the assumption + moving forward, as it is in `date-fns`) +- [BREAKING CHANGE] IE is no longer supported since `date-fns` no longer supports it +- [BREAKING CHANGE] Removed `flow` support since `date-fns` also removed it + +### v2.0.1 (9 March 2024) + +- [DOCS] Fix incorrect output comment (#270) +- [DEPS] Limit to date-fns 2.x (#262, #267) +- [REFACTOR] `tzTokenizeDate`: Remove weird unneeded regex (#254) +- [BUGFIX] Improving correctness of the `formatInTimeZone` close to the DST threshold (#247) +- [ENHANCEMENT] Use hourCycle for browsers that support hour cycle formatting (#231) +- [BUGFIX] Fix tzParseTimezone to parse 00:30 timezones properly (#229) + +### v2.0.0 (30 January 2023) + +- [BREAKING CHANGE] Optimize configuration for ESM exports (entry points for cjs / esm / typescript) (#212) + +**Upgrade guide:** Both CJS and ESM imports now use the default import paths. CJS will continue working unchanged; +to fix ESM imports: + +Before: + +```js +import { format } from 'date-fns-tz/esm'; +import utcToZonedTime from 'date-fns-tz/esm/utcToZonedTime'; +``` + +After: + +```js +import { format } from 'date-fns-tz'; +import utcToZonedTime from 'date-fns-tz/utcToZonedTime'; +``` + +### v1.3.8 (30 January 2023) + +- [TESTS] Tests documenting `zonedTimeToUtc` daylight saving jumps (#220) +- [TYPES] Update `format` types to match date-fns (#199) +- [BUGFIX] Fixed `undefined` timezone error (#214) + ### v1.3.7 (31 August 2022) - [BUGFIX] Fixed getting the time zone name in `partsTimeZone` out of `formatToParts` (#196) diff --git a/src/date-fns-tz/_lib/getTimezoneOffsetInMilliseconds/index.ts b/src/date-fns-tz/_lib/getTimezoneOffsetInMilliseconds/index.ts new file mode 100644 index 0000000..c73deaf --- /dev/null +++ b/src/date-fns-tz/_lib/getTimezoneOffsetInMilliseconds/index.ts @@ -0,0 +1,32 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +/** + * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. + * They usually appear for dates that denote time before the timezones were introduced + * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 + * and GMT+01:00:00 after that date) + * + * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, + * which would lead to incorrect calculations. + * + * This function returns the timezone offset in milliseconds that takes seconds in account. + */ +export function getTimezoneOffsetInMilliseconds(date: Date): number { + const utcDate = new Date( + Date.UTC( + date.getFullYear(), + date.getMonth(), + date.getDate(), + date.getHours(), + date.getMinutes(), + date.getSeconds(), + date.getMilliseconds(), + ), + ); + utcDate.setUTCFullYear(date.getFullYear()); + return +date - +utcDate; +} + +/* eslint-enable */ diff --git a/src/date-fns-tz/_lib/newDateUTC/index.ts b/src/date-fns-tz/_lib/newDateUTC/index.ts index fc2abe0..a2188f9 100644 --- a/src/date-fns-tz/_lib/newDateUTC/index.ts +++ b/src/date-fns-tz/_lib/newDateUTC/index.ts @@ -1,3 +1,7 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** * Use instead of `new Date(Date.UTC(...))` to support years below 100 which doesn't work * otherwise due to the nature of the @@ -5,7 +9,7 @@ * * For `Date.UTC(...)`, use `newDateUTC(...).getTime()`. */ -export default function newDateUTC( +export function newDateUTC( fullYear: number, month: number, day: number, @@ -13,9 +17,11 @@ export default function newDateUTC( minute: number, second: number, millisecond: number, -) { +): Date { const utcDate = new Date(0); utcDate.setUTCFullYear(fullYear, month, day); utcDate.setUTCHours(hour, minute, second, millisecond); return utcDate; } + +/* eslint-enable */ diff --git a/src/date-fns-tz/_lib/tzIntlTimeZoneName/index.ts b/src/date-fns-tz/_lib/tzIntlTimeZoneName/index.ts index c98de52..798b157 100644 --- a/src/date-fns-tz/_lib/tzIntlTimeZoneName/index.ts +++ b/src/date-fns-tz/_lib/tzIntlTimeZoneName/index.ts @@ -1,43 +1,53 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions, type Locale } from '../../../date-fns/index.ts'; +import type { FormatOptionsWithTZ } from '../../index.ts'; + /** * Returns the formatted time zone name of the provided `timeZone` or the current * system time zone if omitted, accounting for DST according to the UTC value of * the date. */ -import type { Locale } from '../../../date-fns/locale/types'; - -export default function tzIntlTimeZoneName( - length: 'short' | 'long' | 'shortOffset' | 'longOffset' | 'shortGeneric' | 'longGeneric', +export function tzIntlTimeZoneName( + length: Intl.DateTimeFormatOptions['timeZoneName'], date: Date, - options: { timeZone: string; locale?: Locale }, -) { - const dtf = getDTF(length, options.timeZone, options.locale); - return partsTimeZone(dtf, date); + options: FormatOptionsWithTZ, +): string | undefined { + const defaultOptions = getDefaultOptions(); + const dtf = getDTF(length, options.timeZone, options.locale ?? defaultOptions.locale); + return 'formatToParts' in dtf ? partsTimeZone(dtf, date) : hackyTimeZone(dtf, date); } -function partsTimeZone(dtf: Intl.DateTimeFormat, date: Date) { +function partsTimeZone(dtf: Intl.DateTimeFormat, date: Date): string | undefined { const formatted = dtf.formatToParts(date); + for (let i = formatted.length - 1; i >= 0; --i) { - if (formatted[i]?.type === 'timeZoneName') { - return formatted[i]?.value; + if (formatted[i].type === 'timeZoneName') { + return formatted[i].value; } } return undefined; } +function hackyTimeZone(dtf: Intl.DateTimeFormat, date: Date) { + const formatted = dtf.format(date).replace(/\u200E/g, ''); + const tzNameMatch = / [\w-+ ]+$/.exec(formatted); + return tzNameMatch ? tzNameMatch[0].substr(1) : ''; +} + // If a locale has been provided `en-US` is used as a fallback in case it is an // invalid locale, otherwise the locale is left undefined to use the system locale. function getDTF( - length: 'short' | 'long' | 'shortOffset' | 'longOffset' | 'shortGeneric' | 'longGeneric', - timeZone: string, - locale?: Locale, -): Intl.DateTimeFormat { - if (locale && !locale.code) { - throw new Error( - "date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`", - ); - } + length: Intl.DateTimeFormatOptions['timeZoneName'], + timeZone: string | undefined, + locale: Pick | undefined, +) { return new Intl.DateTimeFormat(locale ? [locale.code, 'en-US'] : undefined, { timeZone: timeZone, timeZoneName: length, }); } + +/* eslint-enable */ diff --git a/src/date-fns-tz/_lib/tzParseTimezone/index.ts b/src/date-fns-tz/_lib/tzParseTimezone/index.ts index a974646..48697a8 100644 --- a/src/date-fns-tz/_lib/tzParseTimezone/index.ts +++ b/src/date-fns-tz/_lib/tzParseTimezone/index.ts @@ -1,5 +1,9 @@ -import tzTokenizeDate from '../tzTokenizeDate'; -import newDateUTC from '../newDateUTC'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { tzTokenizeDate } from '../tzTokenizeDate/index.ts'; +import { newDateUTC } from '../newDateUTC/index.ts'; const MILLISECONDS_IN_HOUR = 3600000; const MILLISECONDS_IN_MINUTE = 60000; @@ -8,31 +12,33 @@ const patterns = { timezone: /([Z+-].*)$/, timezoneZ: /^(Z)$/, timezoneHH: /^([+-]\d{2})$/, - timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/, + timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/, }; -// Parse various time zone offset formats to an offset in milliseconds -export default function tzParseTimezone(timezoneString: string, date?: Date, isUtcDate?: boolean) { - let token: RegExpExecArray | null; - let absoluteOffset; - +// Parse constious time zone offset formats to an offset in milliseconds +export function tzParseTimezone( + timezoneString: string | undefined, + date: Date | number | undefined, + isUtcDate?: boolean, +): number { // Empty string - if (timezoneString === '') { + if (!timezoneString) { return 0; } // Z - token = patterns.timezoneZ.exec(timezoneString); + let token = patterns.timezoneZ.exec(timezoneString); if (token) { return 0; } - let hours; + let hours: number; + let absoluteOffset: number; // ±hh token = patterns.timezoneHH.exec(timezoneString); if (token) { - hours = parseInt(token[1] as string, 10); + hours = parseInt(token[1], 10); if (!validateTimezone(hours)) { return NaN; @@ -44,25 +50,25 @@ export default function tzParseTimezone(timezoneString: string, date?: Date, isU // ±hh:mm or ±hhmm token = patterns.timezoneHHMM.exec(timezoneString); if (token) { - hours = parseInt(token[1] as string, 10); - let minutes = parseInt(token[2] as string, 10); + hours = parseInt(token[2], 10); + const minutes = parseInt(token[3], 10); if (!validateTimezone(hours, minutes)) { return NaN; } absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE; - return hours > 0 ? -absoluteOffset : absoluteOffset; + return token[1] === '+' ? -absoluteOffset : absoluteOffset; } // IANA time zone if (isValidTimezoneIANAString(timezoneString)) { date = new Date(date || Date.now()); - let utcDate = isUtcDate ? date : toUtcDate(date); + const utcDate = isUtcDate ? date : toUtcDate(date); - let offset = calcOffset(utcDate, timezoneString); + const offset = calcOffset(utcDate, timezoneString); - let fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString); + const fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString); return -fixedOffset; } @@ -83,33 +89,25 @@ function toUtcDate(date: Date) { } function calcOffset(date: Date, timezoneString: string) { - let tokens = tzTokenizeDate(date, timezoneString); + const tokens = tzTokenizeDate(date, timezoneString); // ms dropped because it's not provided by tzTokenizeDate - let asUTC = newDateUTC( - tokens[0] as number, - (tokens[1] as number) - 1, - tokens[2] as number, - (tokens[3] as number) % 24, - tokens[4] as number, - tokens[5] as number, - 0, - ).getTime(); + const asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime(); let asTS = date.getTime(); - let over = asTS % 1000; + const over = asTS % 1000; asTS -= over >= 0 ? over : 1000 + over; return asUTC - asTS; } -function fixOffset(date: Date, offset: number, timezoneString: string): number { - let localTS = date.getTime(); +function fixOffset(date: Date, offset: number, timezoneString: string) { + const localTS = date.getTime(); // Our UTC time is just a guess because our offset is just a guess let utcGuess = localTS - offset; // Test whether the zone matches the offset for this ts - let o2 = calcOffset(new Date(utcGuess), timezoneString); + const o2 = calcOffset(new Date(utcGuess), timezoneString); // If so, offset didn't change, and we're done if (offset === o2) { @@ -120,7 +118,7 @@ function fixOffset(date: Date, offset: number, timezoneString: string): number { utcGuess -= o2 - offset; // If that gives us the local time we want, we're done - let o3 = calcOffset(new Date(utcGuess), timezoneString); + const o3 = calcOffset(new Date(utcGuess), timezoneString); if (o2 === o3) { return o2; } @@ -129,12 +127,13 @@ function fixOffset(date: Date, offset: number, timezoneString: string): number { return Math.max(o2, o3); } -function validateTimezone(hours: number, minutes?: number): boolean { +function validateTimezone(hours: number, minutes?: number | null) { return -23 <= hours && hours <= 23 && (minutes == null || (0 <= minutes && minutes <= 59)); } -const validIANATimezoneCache = {} as Record; -function isValidTimezoneIANAString(timeZoneString: string): boolean { +const validIANATimezoneCache: Record = {}; + +function isValidTimezoneIANAString(timeZoneString: string) { if (validIANATimezoneCache[timeZoneString]) return true; try { new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString }); @@ -144,3 +143,5 @@ function isValidTimezoneIANAString(timeZoneString: string): boolean { return false; } } + +/* eslint-enable */ diff --git a/src/date-fns-tz/_lib/tzPattern/index.ts b/src/date-fns-tz/_lib/tzPattern/index.ts index 2a12781..2cd34a2 100644 --- a/src/date-fns-tz/_lib/tzPattern/index.ts +++ b/src/date-fns-tz/_lib/tzPattern/index.ts @@ -1,4 +1,8 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** Regex to identify the presence of a time zone specifier in a date string */ -const tzPattern = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/; +export const tzPattern: RegExp = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/; -export default tzPattern; +/* eslint-enable */ diff --git a/src/date-fns-tz/_lib/tzTokenizeDate/index.ts b/src/date-fns-tz/_lib/tzTokenizeDate/index.ts index 0ef13fe..21cad79 100644 --- a/src/date-fns-tz/_lib/tzTokenizeDate/index.ts +++ b/src/date-fns-tz/_lib/tzTokenizeDate/index.ts @@ -1,13 +1,17 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** * Returns the [year, month, day, hour, minute, seconds] tokens of the provided * `date` as it will be rendered in the `timeZone`. */ -export default function tzTokenizeDate(date: Date, timeZone: string) { +export function tzTokenizeDate(date: Date, timeZone: string): number[] { const dtf = getDateTimeFormat(timeZone); - return partsOffset(dtf, date); + return 'formatToParts' in dtf ? partsOffset(dtf, date) : hackyOffset(dtf, date); } -const typeToPos = { +const typeToPos: { [type in keyof Intl.DateTimeFormatPartTypesRegistry]?: number } = { year: 0, month: 1, day: 2, @@ -19,11 +23,12 @@ const typeToPos = { function partsOffset(dtf: Intl.DateTimeFormat, date: Date) { try { const formatted = dtf.formatToParts(date); - const filled = []; + const filled: number[] = []; for (let i = 0; i < formatted.length; i++) { - const pos = typeToPos[formatted[i]?.type as 'year'] as number; - if (pos >= 0) { - filled[pos] = parseInt(formatted[i]?.value as keyof typeof typeToPos, 10); + const pos = typeToPos[formatted[i].type]; + + if (pos !== undefined) { + filled[pos] = parseInt(formatted[i].value, 10); } } return filled; @@ -35,28 +40,45 @@ function partsOffset(dtf: Intl.DateTimeFormat, date: Date) { } } +function hackyOffset(dtf: Intl.DateTimeFormat, date: Date) { + const formatted = dtf.format(date); + + const parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted)!; + // const [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed + // return [fYear, fMonth, fDay, fHour, fMinute, fSecond] + return [ + parseInt(parsed[3], 10), + parseInt(parsed[1], 10), + parseInt(parsed[2], 10), + parseInt(parsed[4], 10), + parseInt(parsed[5], 10), + parseInt(parsed[6], 10), + ]; +} + +// Get a cached Intl.DateTimeFormat instance for the IANA `timeZone`. This can be used // to get deterministic local date/time output according to the `en-US` locale which // can be used to extract local time parts as necessary. -const dtfCache = {} as Record; -function getDateTimeFormat(timeZone: string): Intl.DateTimeFormat { - if (!dtfCache[timeZone]) { - // New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12` - const testDateFormatted = new Intl.DateTimeFormat('en-US', { - hour12: false, - timeZone: 'America/New_York', - year: 'numeric', - month: 'numeric', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - }).format(new Date('2014-06-25T04:00:00.123Z')); - const hourCycleSupported = - testDateFormatted === '06/25/2014, 00:00:00' || testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00'; +const dtfCache: Record = {}; +// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12` +const testDateFormatted = new Intl.DateTimeFormat('en-US', { + hourCycle: 'h23', + timeZone: 'America/New_York', + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', +}).format(new Date('2014-06-25T04:00:00.123Z')); +const hourCycleSupported = + testDateFormatted === '06/25/2014, 00:00:00' || testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00'; +function getDateTimeFormat(timeZone: string) { + if (!dtfCache[timeZone]) { dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat('en-US', { - hour12: false, + hourCycle: 'h23', timeZone: timeZone, year: 'numeric', month: 'numeric', @@ -66,7 +88,7 @@ function getDateTimeFormat(timeZone: string): Intl.DateTimeFormat { second: '2-digit', }) : new Intl.DateTimeFormat('en-US', { - hourCycle: 'h23', + hour12: false, timeZone: timeZone, year: 'numeric', month: 'numeric', @@ -76,5 +98,7 @@ function getDateTimeFormat(timeZone: string): Intl.DateTimeFormat { second: '2-digit', }); } - return dtfCache[timeZone] as Intl.DateTimeFormat; + return dtfCache[timeZone]; } + +/* eslint-enable */ diff --git a/src/date-fns-tz/date-fns-v2-lib/assign/index.ts b/src/date-fns-tz/date-fns-v2-lib/assign/index.ts deleted file mode 100644 index a72cf11..0000000 --- a/src/date-fns-tz/date-fns-v2-lib/assign/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default function assign(target: T, object: U): T & U { - if (target == null) { - throw new TypeError('assign requires that input parameter not be null or undefined'); - } - - for (const property in object) { - if (Object.prototype.hasOwnProperty.call(object, property)) { - (target as any)[property] = object[property]; - } - } - - return target as T & U; -} diff --git a/src/date-fns-tz/date-fns-v2-lib/cloneObject/index.ts b/src/date-fns-tz/date-fns-v2-lib/cloneObject/index.ts deleted file mode 100644 index 8927786..0000000 --- a/src/date-fns-tz/date-fns-v2-lib/cloneObject/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import assign from '../assign/index'; - -export default function cloneObject(object: T): T { - return assign({}, object); -} diff --git a/src/date-fns-tz/format/formatters/index.ts b/src/date-fns-tz/format/formatters/index.ts index e10138f..735b079 100644 --- a/src/date-fns-tz/format/formatters/index.ts +++ b/src/date-fns-tz/format/formatters/index.ts @@ -1,17 +1,20 @@ -import tzIntlTimeZoneName from '../../_lib/tzIntlTimeZoneName'; -import tzParseTimezone from '../../_lib/tzParseTimezone'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { tzIntlTimeZoneName } from '../../_lib/tzIntlTimeZoneName/index.ts'; +import { tzParseTimezone } from '../../_lib/tzParseTimezone/index.ts'; +import type { FormatOptionsWithTZ } from '../../index.ts'; const MILLISECONDS_IN_MINUTE = 60 * 1000; -const formatters = { +export const formatters: Record< + string, + (date: Date, token: string, options: FormatOptionsWithTZ) => string | undefined +> = { // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) - X: function ( - date: Date, - token: string, - _localize: boolean | null, - options: { timeZone: string; _originalDate?: Date }, - ) { - const timezoneOffset = getTimeZoneOffset(options.timeZone, options._originalDate || date); + X: function (date, token, options) { + const timezoneOffset = getTimeZoneOffset(options.timeZone, date); if (timezoneOffset === 0) { return 'Z'; @@ -40,13 +43,8 @@ const formatters = { }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) - x: function ( - date: Date, - token: string, - _localize: boolean | null, - options: { timeZone: string; _originalDate?: Date }, - ) { - const timezoneOffset = getTimeZoneOffset(options.timeZone, options._originalDate || date); + x: function (date, token, options) { + const timezoneOffset = getTimeZoneOffset(options.timeZone, date); switch (token) { // Hours and optional minutes @@ -71,13 +69,8 @@ const formatters = { }, // Timezone (GMT) - O: function ( - date: Date, - token: string, - _localize: boolean | null, - options: { timeZone: string; _originalDate?: Date }, - ) { - const timezoneOffset = getTimeZoneOffset(options.timeZone, options._originalDate || date); + O: function (date, token, options) { + const timezoneOffset = getTimeZoneOffset(options.timeZone, date); switch (token) { // Short @@ -93,65 +86,57 @@ const formatters = { }, // Timezone (specific non-location) - z: function ( - date: Date, - token: string, - _localize: boolean | null, - options: { timeZone: string; _originalDate?: Date }, - ) { - const originalDate = options._originalDate || date; - + z: function (date, token, options) { switch (token) { // Short case 'z': case 'zz': case 'zzz': - return tzIntlTimeZoneName('short', originalDate, options); + return tzIntlTimeZoneName('short', date, options); // Long case 'zzzz': default: - return tzIntlTimeZoneName('long', originalDate, options); + return tzIntlTimeZoneName('long', date, options); } }, }; -function getTimeZoneOffset(timeZone: string, originalDate: Date) { +function getTimeZoneOffset(timeZone: string | undefined, originalDate?: Date) { const timeZoneOffset = timeZone ? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE - : originalDate.getTimezoneOffset(); + : (originalDate?.getTimezoneOffset() ?? 0); if (Number.isNaN(timeZoneOffset)) { throw new RangeError('Invalid time zone specified: ' + timeZone); } return timeZoneOffset; } -function addLeadingZeros(num: number, targetLength: number) { - const sign = num < 0 ? '-' : ''; - let output = Math.abs(num).toString(); +function addLeadingZeros(number: number, targetLength: number) { + const sign = number < 0 ? '-' : ''; + let output = Math.abs(number).toString(); while (output.length < targetLength) { output = '0' + output; } return sign + output; } -function formatTimezone(offset: number, dirtyDelimeter?: string) { - const delimeter = dirtyDelimeter || ''; +function formatTimezone(offset: number, delimiter = '') { const sign = offset > 0 ? '-' : '+'; const absOffset = Math.abs(offset); const hours = addLeadingZeros(Math.floor(absOffset / 60), 2); const minutes = addLeadingZeros(Math.floor(absOffset % 60), 2); - return sign + hours + delimeter + minutes; + return sign + hours + delimiter + minutes; } -function formatTimezoneWithOptionalMinutes(offset: number, dirtyDelimeter?: string) { +function formatTimezoneWithOptionalMinutes(offset: number, delimiter?: string) { if (offset % 60 === 0) { const sign = offset > 0 ? '-' : '+'; return sign + addLeadingZeros(Math.abs(offset) / 60, 2); } - return formatTimezone(offset, dirtyDelimeter); + return formatTimezone(offset, delimiter); } -function formatTimezoneShort(offset: number, dirtyDelimeter: string) { +function formatTimezoneShort(offset: number, delimiter = '') { const sign = offset > 0 ? '-' : '+'; const absOffset = Math.abs(offset); const hours = Math.floor(absOffset / 60); @@ -159,8 +144,7 @@ function formatTimezoneShort(offset: number, dirtyDelimeter: string) { if (minutes === 0) { return sign + String(hours); } - const delimeter = dirtyDelimeter || ''; - return sign + String(hours) + delimeter + addLeadingZeros(minutes, 2); + return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); } -export default formatters; +/* eslint-enable */ diff --git a/src/date-fns-tz/format/index.ts b/src/date-fns-tz/format/index.ts index 5c1f027..6fb4ff9 100644 --- a/src/date-fns-tz/format/index.ts +++ b/src/date-fns-tz/format/index.ts @@ -1,9 +1,13 @@ -import { format as dateFnsFormat, type FormatOptions } from '../../date-fns/format'; -import type { OptionsWithTZ } from '../types'; -import formatters from './formatters'; -import toDate from '../toDate'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck -var tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g; +import { format as dateFnsFormat } from '../../date-fns/format/index.ts'; +import { formatters } from './formatters/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { FormatOptionsWithTZ } from '../index.ts'; + +const tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g; /** * @name format @@ -273,9 +277,9 @@ var tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g; * * - Characters are now escaped using single quote symbols (`'`) instead of square brackets. * - * @param {Date|String|Number} date - the original date - * @param {String} format - the string of tokens - * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param date the original date + * @param formatStr the string of tokens + * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options} * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link * https://date-fns.org/docs/toDate} * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) @@ -287,7 +291,8 @@ var tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g; * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens * (`yy`, `yyyy`). See: https://git.io/fxCyr * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. - * @returns {String} the formatted date string + * @param {Date|Number} [options.originalDate] - can be used to pass the original unmodified date to `format` to + * improve correctness of the replaced timezone token close to the DST threshold. * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * @throws {RangeError} `options.locale` must contain `localize` property @@ -299,50 +304,44 @@ var tzFormattingTokensRegExp = /([xXOz]+)|''|'(''|[^'])+('|$)/g; * * @example * // Represent 11 February 2014 in middle-endian format: - * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') + * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') * //=> '02/11/2014' * * @example * // Represent 2 July 2014 in Esperanto: * import { eoLocale } from 'date-fns/locale/eo' - * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { + * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { * locale: eoLocale * }) * //=> '2-a de julio 2014' * * @example * // Escape string by single quote characters: - * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") + * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") * //=> "3 o'clock" */ -export default function format( - dirtyDate: Date | string | number, - dirtyFormatStr: string, - dirtyOptions?: OptionsWithTZ, -): string { - var formatStr = String(dirtyFormatStr); - var options = dirtyOptions || ({} as OptionsWithTZ); +export function format(date: Date | string | number, formatStr: string, options: FormatOptionsWithTZ = {}): string { + formatStr = String(formatStr); - var matches = formatStr.match(tzFormattingTokensRegExp); + const matches = formatStr.match(tzFormattingTokensRegExp); if (matches) { - var date = toDate(dirtyDate, options); + const d = toDate(options.originalDate || date, options); // Work through each match and replace the tz token in the format string with the quoted // formatted time zone so the remaining tokens can be filled in by date-fns#format. formatStr = matches.reduce(function (result, token) { if (token[0] === "'") { return result; // This is a quoted portion, matched only to ensure we don't match inside it } - var pos = result.indexOf(token); - var precededByQuotedSection = result[pos - 1] === "'"; - var replaced = result.replace( - token, - "'" + formatters[token[0] as keyof typeof formatters](date, token, null, options) + "'", - ); + const pos = result.indexOf(token); + const precededByQuotedSection = result[pos - 1] === "'"; + const replaced = result.replace(token, "'" + formatters[token[0]](d, token, options) + "'"); // If the replacement results in two adjoining quoted strings, the back to back quotes // are removed, so it doesn't look like an escaped quote. return precededByQuotedSection ? replaced.substring(0, pos - 1) + replaced.substring(pos + 1) : replaced; }, formatStr); } - return dateFnsFormat(dirtyDate as Date, formatStr, options as FormatOptions); + return dateFnsFormat(date, formatStr, options); } + +/* eslint-enable */ diff --git a/src/date-fns-tz/formatInTimeZone/index.ts b/src/date-fns-tz/formatInTimeZone/index.ts index 64080b5..c9d97aa 100644 --- a/src/date-fns-tz/formatInTimeZone/index.ts +++ b/src/date-fns-tz/formatInTimeZone/index.ts @@ -1,17 +1,20 @@ -import cloneObject from '../date-fns-v2-lib/cloneObject'; -import format from '../format'; -import type { OptionsWithTZ } from '../types'; -import utcToZonedTime from '../utcToZonedTime'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { format } from '../format/index.ts'; +import { toZonedTime } from '../toZonedTime/index.ts'; +import type { FormatOptionsWithTZ } from '../index.ts'; /** * @name formatInTimeZone * @category Time Zone Helpers * @summary Gets the offset in milliseconds between the time zone and Universal Coordinated Time (UTC) * - * @param {Date|String|Number} date - the date representing the local time / real UTC time - * @param {String} timeZone - the time zone this date should be formatted for; can be an offset or IANA time zone - * @param {String} formatStr - the string of tokens - * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param date the date representing the local time / real UTC time + * @param timeZone the time zone this date should be formatted for; can be an offset or IANA time zone + * @param formatStr the string of tokens + * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options} * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link * https://date-fns.org/docs/toDate} * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) @@ -23,15 +26,19 @@ import utcToZonedTime from '../utcToZonedTime'; * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens * (`yy`, `yyyy`). See: https://git.io/fxCyr * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. - * @returns {String} the formatted date string */ -export default function formatInTimeZone( +export function formatInTimeZone( date: Date | string | number, timeZone: string, formatStr: string, - options?: OptionsWithTZ, + options?: FormatOptionsWithTZ, ): string { - const extendedOptions = cloneObject(options) as OptionsWithTZ; - extendedOptions.timeZone = timeZone; - return format(utcToZonedTime(date, timeZone), formatStr, extendedOptions); + options = { + ...options, + timeZone, + originalDate: date, + }; + return format(toZonedTime(date, timeZone, { timeZone: options.timeZone }), formatStr, options); } + +/* eslint-enable */ diff --git a/src/date-fns-tz/fromZonedTime/index.ts b/src/date-fns-tz/fromZonedTime/index.ts new file mode 100644 index 0000000..742706b --- /dev/null +++ b/src/date-fns-tz/fromZonedTime/index.ts @@ -0,0 +1,56 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import { tzPattern } from '../_lib/tzPattern/index.ts'; +import { tzParseTimezone } from '../_lib/tzParseTimezone/index.ts'; +import { newDateUTC } from '../_lib/newDateUTC/index.ts'; +import type { ToDateOptionsWithTZ } from '../index.ts'; + +/** + * @name fromZonedTime + * @category Time Zone Helpers + * @summary Get the UTC date/time from a date representing local time in a given time zone + * + * @description + * Returns a date instance with the UTC time of the provided date of which the values + * represented the local time in the time zone specified. In other words, if the input + * date represented local time in time zone, the timestamp of the output date will + * give the equivalent UTC of that local time regardless of the current system time zone. + * + * @param date the date with values representing the local time + * @param timeZone the time zone of this local time, can be an offset or IANA time zone + * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // In June 10am in Los Angeles is 5pm UTC + * const result = fromZonedTime(new Date(2014, 5, 25, 10, 0, 0), 'America/Los_Angeles') + * //=> 2014-06-25T17:00:00.000Z + */ +export function fromZonedTime(date: Date | string | number, timeZone: string, options?: ToDateOptionsWithTZ): Date { + if (typeof date === 'string' && !date.match(tzPattern)) { + return toDate(date, { ...options, timeZone }); + } + + date = toDate(date, options); + + const utc = newDateUTC( + date.getFullYear(), + date.getMonth(), + date.getDate(), + date.getHours(), + date.getMinutes(), + date.getSeconds(), + date.getMilliseconds(), + ).getTime(); + + const offsetMilliseconds = tzParseTimezone(timeZone, new Date(utc)); + + return new Date(utc + offsetMilliseconds); +} + +/* eslint-enable */ diff --git a/src/date-fns-tz/getTimezoneOffset/index.ts b/src/date-fns-tz/getTimezoneOffset/index.ts index d6ae86d..b7ca8e1 100644 --- a/src/date-fns-tz/getTimezoneOffset/index.ts +++ b/src/date-fns-tz/getTimezoneOffset/index.ts @@ -1,4 +1,8 @@ -import tzParseTimezone from '../_lib/tzParseTimezone'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { tzParseTimezone } from '../_lib/tzParseTimezone/index.ts'; /** * @name getTimezoneOffset @@ -13,9 +17,8 @@ import tzParseTimezone from '../_lib/tzParseTimezone'; * the second parameter to ensure the offset correctly accounts for DST at that time of * year. When omitted, the current date is used. * - * @param {String} timeZone - the time zone of this local time, can be an offset or IANA time zone - * @param {Date|Number} [date] - the date with values representing the local time - * @returns {Number} the time zone offset in milliseconds + * @param timeZone the time zone of this local time, can be an offset or IANA time zone + * @param date the date with values representing the local time * * @example * const result = getTimezoneOffset('-07:00') @@ -27,6 +30,8 @@ import tzParseTimezone from '../_lib/tzParseTimezone'; * const result = getTimezoneOffset('America/New_York', new Date(2016, 6, 1)) * //=> -14400000 (-4 * 60 * 60 * 1000) */ -export default function getTimezoneOffset(timeZone: string, date: Date | number): number { - return -tzParseTimezone(timeZone, date as Date); +export function getTimezoneOffset(timeZone: string, date?: Date | number): number { + return -tzParseTimezone(timeZone, date); } + +/* eslint-enable */ diff --git a/src/date-fns-tz/index.ts b/src/date-fns-tz/index.ts index 23a0135..e9b7b4e 100644 --- a/src/date-fns-tz/index.ts +++ b/src/date-fns-tz/index.ts @@ -1,6 +1,24 @@ -export { default as tzFormat } from './format'; -export { default as tzFormatInTimeZone } from './formatInTimeZone'; -export { default as tzGetTimezoneOffset } from './getTimezoneOffset'; -export { default as tzToDate } from './toDate'; -export { default as tzUtcToZonedTime } from './utcToZonedTime'; -export { default as tzZonedTimeToUtc } from './zonedTimeToUtc'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FormatOptions, ParseISOOptions, Locale } from '../date-fns/index.ts'; + +export interface FormatOptionsWithTZ extends Omit { + locale?: FormatOptions['locale'] & Pick; + timeZone?: string; + originalDate?: Date | string | number; +} + +export interface ToDateOptionsWithTZ extends ParseISOOptions { + timeZone?: string; +} + +export { format as tzFormat } from './format/index.ts'; +export { formatInTimeZone as tzFormatInTimeZone } from './formatInTimeZone/index.ts'; +export { fromZonedTime as tzZonedTimeToUtc } from './fromZonedTime/index.ts'; +export { toZonedTime as tzUtcToZonedTime } from './toZonedTime/index.ts'; +export { getTimezoneOffset as getTimezoneOffset } from './getTimezoneOffset/index.ts'; +export { toDate as tzToDate } from './toDate/index.ts'; + +/* eslint-enable */ diff --git a/src/date-fns-tz/toDate/index.ts b/src/date-fns-tz/toDate/index.ts index 89412c0..7502c1b 100644 --- a/src/date-fns-tz/toDate/index.ts +++ b/src/date-fns-tz/toDate/index.ts @@ -1,7 +1,11 @@ -import { getTimezoneOffsetInMilliseconds } from '../../date-fns/_lib/getTimezoneOffsetInMilliseconds'; -import tzParseTimezone from '../_lib/tzParseTimezone'; -import tzPattern from '../_lib/tzPattern'; -import type { OptionsWithTZ } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { tzParseTimezone } from '../_lib/tzParseTimezone/index.ts'; +import { tzPattern } from '../_lib/tzPattern/index.ts'; +import type { ToDateOptionsWithTZ } from '../index.ts'; const MILLISECONDS_IN_HOUR = 3600000; const MILLISECONDS_IN_MINUTE = 60000; @@ -63,26 +67,27 @@ const patterns = { * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined. * - * @param {Date|String|Number} argument - the value to convert - * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param argument the value to convert + * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options} * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format - * @param {String} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. - * @returns {Date} the parsed date in the local time zone + * @param {string} [options.timeZone=''] - used to specify the IANA time zone offset of a date String. + * + * @returns the parsed date in the local time zone * @throws {TypeError} 1 argument required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * * @example * // Convert string '2014-02-11T11:30:30' to date: - * var result = toDate('2014-02-11T11:30:30') + * const result = toDate('2014-02-11T11:30:30') * //=> Tue Feb 11 2014 11:30:30 * * @example * // Convert string '+02014101' to date, * // if the additional number of digits in the extended year format is 1: - * var result = toDate('+02014101', {additionalDigits: 1}) + * const result = toDate('+02014101', {additionalDigits: 1}) * //=> Fri Apr 11 2014 00:00:00 */ -export default function toDate(argument: Date | string | number, dirtyOptions?: OptionsWithTZ): Date { +export function toDate(argument: Date | string | number, options: ToDateOptionsWithTZ = {}): Date { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } @@ -91,9 +96,8 @@ export default function toDate(argument: Date | string | number, dirtyOptions?: return new Date(NaN); } - var options = dirtyOptions || ({} as OptionsWithTZ); - - var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : options.additionalDigits; + const additionalDigits = + options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits); if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { throw new RangeError('additionalDigits must be 0, 1 or 2'); } @@ -107,76 +111,74 @@ export default function toDate(argument: Date | string | number, dirtyOptions?: return new Date(argument.getTime()); } else if (typeof argument === 'number' || Object.prototype.toString.call(argument) === '[object Number]') { return new Date(argument); - } else if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) { + } else if (!(Object.prototype.toString.call(argument) === '[object String]')) { return new Date(NaN); } - var dateStrings = splitDateString(argument); + const dateStrings = splitDateString(argument); - var parseYearResult = parseYear(dateStrings.date, additionalDigits); - var year = parseYearResult.year; - var restDateString = parseYearResult.restDateString as string; + const { year, restDateString } = parseYear(dateStrings.date, additionalDigits); - var date = parseDate(restDateString, year); + const date = parseDate(restDateString, year); - if (Number.isNaN(date)) { + if (date === null || isNaN(date.getTime())) { return new Date(NaN); } if (date) { - var timestamp = date.getTime(); - var time: number | null = 0; - var offset; + const timestamp = date.getTime(); + let time: number | null = 0; + let offset: number; if (dateStrings.time) { time = parseTime(dateStrings.time); - if (Number.isNaN(time)) { + if (time === null || isNaN(time)) { return new Date(NaN); } } if (dateStrings.timeZone || options.timeZone) { - offset = tzParseTimezone((dateStrings.timeZone || options.timeZone) as string, new Date(timestamp + (time ?? 0))); + offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time)); if (isNaN(offset)) { return new Date(NaN); } } else { // get offset accurate to hour in time zones that change offset - offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + (time ?? 0))); - offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + (time ?? 0) + offset)); + offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time)); + offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset)); } - return new Date(timestamp + (time ?? 0) + offset); + return new Date(timestamp + time + offset); } else { return new Date(NaN); } } function splitDateString(dateString: string) { - const dateStrings = {} as { date: string; time: string; timeZone: string }; + const dateStrings: { date?: string | null; time?: string; timeZone?: string } = {}; let parts = patterns.dateTimePattern.exec(dateString); - let timeString; + let timeString: string; if (!parts) { parts = patterns.datePattern.exec(dateString); if (parts) { - dateStrings.date = parts[1] as string; + dateStrings.date = parts[1]; timeString = parts[2]; } else { - dateStrings.date = null as unknown as string; + dateStrings.date = null; timeString = dateString; } } else { - dateStrings.date = parts[1] as string; + dateStrings.date = parts[1]; timeString = parts[3]; } if (timeString) { const token = patterns.timeZone.exec(timeString); if (token) { - dateStrings.time = timeString.replace(token[1] as string, ''); - dateStrings.timeZone = (token[1] as string).trim(); + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timeZone = token[1].trim(); } else { dateStrings.time = timeString; } @@ -185,30 +187,30 @@ function splitDateString(dateString: string) { return dateStrings; } -function parseYear(dateString: string, additionalDigits: number) { - const patternYYY = patterns.YYY[additionalDigits]; - const patternYYYYY = patterns.YYYYY[additionalDigits]; +function parseYear(dateString: string | null | undefined, additionalDigits: number) { + if (dateString) { + const patternYYY = patterns.YYY[additionalDigits]; + const patternYYYYY = patterns.YYYYY[additionalDigits]; - let token; - - // YYYY or ±YYYYY - token = patterns.YYYY.exec(dateString) || patternYYYYY?.exec(dateString); - if (token) { - const yearString = token[1] as string; - return { - year: parseInt(yearString, 10), - restDateString: dateString.slice(yearString.length), - }; - } + // YYYY or ±YYYYY + let token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString); + if (token) { + const yearString = token[1]; + return { + year: parseInt(yearString, 10), + restDateString: dateString.slice(yearString.length), + }; + } - // YY or ±YYY - token = patterns.YY.exec(dateString) || patternYYY?.exec(dateString); - if (token) { - const centuryString = token[1] as string; - return { - year: parseInt(centuryString, 10) * 100, - restDateString: dateString.slice(centuryString.length), - }; + // YY or ±YYY + token = patterns.YY.exec(dateString) || patternYYY.exec(dateString); + if (token) { + const centuryString = token[1]; + return { + year: parseInt(centuryString, 10) * 100, + restDateString: dateString.slice(centuryString.length), + }; + } } // Invalid ISO-formatted year @@ -217,29 +219,28 @@ function parseYear(dateString: string, additionalDigits: number) { }; } -function parseDate(dateString: string, year: number | null) { +function parseDate(dateString: string | null | undefined, year: number | null) { // Invalid ISO-formatted year if (year === null) { return null; } - var token; - var date; - var month; - var week; + let date: Date; + let month: number; + let week: number; // YYYY - if (dateString.length === 0) { + if (!dateString || !dateString.length) { date = new Date(0); date.setUTCFullYear(year); return date; } // YYYY-MM - token = patterns.MM.exec(dateString); + let token = patterns.MM.exec(dateString); if (token) { date = new Date(0); - month = parseInt(token[1] as string, 10) - 1; + month = parseInt(token[1], 10) - 1; if (!validateDate(year, month)) { return new Date(NaN); @@ -253,7 +254,7 @@ function parseDate(dateString: string, year: number | null) { token = patterns.DDD.exec(dateString); if (token) { date = new Date(0); - var dayOfYear = parseInt(token[1] as string, 10); + const dayOfYear = parseInt(token[1], 10); if (!validateDayOfYearDate(year, dayOfYear)) { return new Date(NaN); @@ -267,8 +268,8 @@ function parseDate(dateString: string, year: number | null) { token = patterns.MMDD.exec(dateString); if (token) { date = new Date(0); - month = parseInt(token[1] as string, 10) - 1; - var day = parseInt(token[2] as string, 10); + month = parseInt(token[1], 10) - 1; + const day = parseInt(token[2], 10); if (!validateDate(year, month, day)) { return new Date(NaN); @@ -281,9 +282,9 @@ function parseDate(dateString: string, year: number | null) { // YYYY-Www or YYYYWww token = patterns.Www.exec(dateString); if (token) { - week = parseInt(token[1] as string, 10) - 1; + week = parseInt(token[1], 10) - 1; - if (!validateWeekDate(year, week)) { + if (!validateWeekDate(week)) { return new Date(NaN); } @@ -293,10 +294,10 @@ function parseDate(dateString: string, year: number | null) { // YYYY-Www-D or YYYYWwwD token = patterns.WwwD.exec(dateString); if (token) { - week = parseInt(token[1] as string, 10) - 1; - var dayOfWeek = parseInt(token[2] as string, 10) - 1; + week = parseInt(token[1], 10) - 1; + const dayOfWeek = parseInt(token[2], 10) - 1; - if (!validateWeekDate(year, week, dayOfWeek)) { + if (!validateWeekDate(week, dayOfWeek)) { return new Date(NaN); } @@ -308,14 +309,13 @@ function parseDate(dateString: string, year: number | null) { } function parseTime(timeString: string) { - var token; - var hours; - var minutes; + let hours: number; + let minutes: number; // hh - token = patterns.HH.exec(timeString); + let token = patterns.HH.exec(timeString); if (token) { - hours = parseFloat((token[1] as string).replace(',', '.')); + hours = parseFloat(token[1].replace(',', '.')); if (!validateTime(hours)) { return NaN; @@ -327,8 +327,8 @@ function parseTime(timeString: string) { // hh:mm or hhmm token = patterns.HHMM.exec(timeString); if (token) { - hours = parseInt(token[1] as string, 10); - minutes = parseFloat((token[2] as string).replace(',', '.')); + hours = parseInt(token[1], 10); + minutes = parseFloat(token[2].replace(',', '.')); if (!validateTime(hours, minutes)) { return NaN; @@ -340,9 +340,9 @@ function parseTime(timeString: string) { // hh:mm:ss or hhmmss token = patterns.HHMMSS.exec(timeString); if (token) { - hours = parseInt(token[1] as string, 10); - minutes = parseInt(token[2] as string, 10); - var seconds = parseFloat((token[3] as string).replace(',', '.')); + hours = parseInt(token[1], 10); + minutes = parseInt(token[2], 10); + const seconds = parseFloat(token[3].replace(',', '.')); if (!validateTime(hours, minutes, seconds)) { return NaN; @@ -355,27 +355,27 @@ function parseTime(timeString: string) { return null; } -function dayOfISOWeekYear(isoWeekYear: number, week?: number, day?: number) { +function dayOfISOWeekYear(isoWeekYear: number, week: number, day?: number | null) { week = week || 0; day = day || 0; - var date = new Date(0); + const date = new Date(0); date.setUTCFullYear(isoWeekYear, 0, 4); - var fourthOfJanuaryDay = date.getUTCDay() || 7; - var diff = week * 7 + day + 1 - fourthOfJanuaryDay; + const fourthOfJanuaryDay = date.getUTCDay() || 7; + const diff = week * 7 + day + 1 - fourthOfJanuaryDay; date.setUTCDate(date.getUTCDate() + diff); return date; } // Validation functions -var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function isLeapYearIndex(year: number) { return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); } -function validateDate(year: number, month: number, date?: number) { +function validateDate(year: number, month: number, date?: number | null) { if (month < 0 || month > 11) { return false; } @@ -385,11 +385,11 @@ function validateDate(year: number, month: number, date?: number) { return false; } - var isLeapYear = isLeapYearIndex(year); - if (isLeapYear && date > (DAYS_IN_MONTH_LEAP_YEAR[month] as number)) { + const isLeapYear = isLeapYearIndex(year); + if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) { return false; } - if (!isLeapYear && date > (DAYS_IN_MONTH[month] as number)) { + if (!isLeapYear && date > DAYS_IN_MONTH[month]) { return false; } } @@ -402,7 +402,7 @@ function validateDayOfYearDate(year: number, dayOfYear: number) { return false; } - var isLeapYear = isLeapYearIndex(year); + const isLeapYear = isLeapYearIndex(year); if (isLeapYear && dayOfYear > 366) { return false; } @@ -413,7 +413,7 @@ function validateDayOfYearDate(year: number, dayOfYear: number) { return true; } -function validateWeekDate(_year: number, week: number, day?: number) { +function validateWeekDate(week: number, day?: number | null) { if (week < 0 || week > 52) { return false; } @@ -425,8 +425,8 @@ function validateWeekDate(_year: number, week: number, day?: number) { return true; } -function validateTime(hours?: number, minutes?: number, seconds?: number) { - if (hours != null && (hours < 0 || hours >= 25)) { +function validateTime(hours: number, minutes?: number | null, seconds?: number | null) { + if (hours < 0 || hours >= 25) { return false; } @@ -440,3 +440,5 @@ function validateTime(hours?: number, minutes?: number, seconds?: number) { return true; } + +/* eslint-enable */ diff --git a/src/date-fns-tz/utcToZonedTime/index.ts b/src/date-fns-tz/toZonedTime/index.ts similarity index 60% rename from src/date-fns-tz/utcToZonedTime/index.ts rename to src/date-fns-tz/toZonedTime/index.ts index 98b19dc..82fdebc 100644 --- a/src/date-fns-tz/utcToZonedTime/index.ts +++ b/src/date-fns-tz/toZonedTime/index.ts @@ -1,9 +1,13 @@ -import tzParseTimezone from '../_lib/tzParseTimezone'; -import toDate from '../toDate'; -import type { OptionsWithTZ } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { tzParseTimezone } from '../_lib/tzParseTimezone/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ToDateOptionsWithTZ } from '../index.ts'; /** - * @name utcToZonedTime + * @name toZonedTime * @category Time Zone Helpers * @summary Get a date/time representing local time in a given time zone from the UTC date * @@ -13,25 +17,21 @@ import type { OptionsWithTZ } from '../types'; * is formatted it will show the equivalent hours in the target time zone regardless * of the current system time zone. * - * @param {Date|String|Number} date - the date with the relevant UTC time - * @param {String} timeZone - the time zone to get local time for, can be an offset or IANA time zone - * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param date the date with the relevant UTC time + * @param timeZone the time zone to get local time for, can be an offset or IANA time zone + * @param options the object with options. See [Options]{@link https://date-fns.org/docs/Options} * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Date} the new date with the equivalent time in the time zone + * * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * * @example * // In June 10am UTC is 6am in New York (-04:00) - * const result = utcToZonedTime('2014-06-25T10:00:00.000Z', 'America/New_York') + * const result = toZonedTime('2014-06-25T10:00:00.000Z', 'America/New_York') * //=> Jun 25 2014 06:00:00 */ -export default function utcToZonedTime( - dirtyDate: Date | string | number, - timeZone: string, - options?: OptionsWithTZ, -): Date { - const date = toDate(dirtyDate, options); +export function toZonedTime(date: Date | string | number, timeZone: string, options?: ToDateOptionsWithTZ): Date { + date = toDate(date, options); const offsetMilliseconds = tzParseTimezone(timeZone, date, true); @@ -43,7 +43,10 @@ export default function utcToZonedTime( resultDate.setHours(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()); - // [PATCH:] this hack is required because setHours doesn't work for hours that are spring-forward + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold (resultDate as any)[Symbol.for('UTCHours')] = d.getUTCHours(); + return resultDate; } + +/* eslint-enable */ diff --git a/src/date-fns-tz/types.ts b/src/date-fns-tz/types.ts deleted file mode 100644 index f07258a..0000000 --- a/src/date-fns-tz/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Locale } from '../date-fns/locale/types'; - -export type OptionsWithTZ = { - weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; - firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7; - additionalDigits?: 0 | 1 | 2; - timeZone: string; - locale?: Locale; - includeSeconds?: boolean; - addSuffix?: boolean; - unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year'; - roundingMethod?: 'floor' | 'ceil' | 'round'; - awareOfUnicodeTokens?: boolean; -}; diff --git a/src/date-fns-tz/zonedTimeToUtc/index.ts b/src/date-fns-tz/zonedTimeToUtc/index.ts deleted file mode 100644 index 09a04c4..0000000 --- a/src/date-fns-tz/zonedTimeToUtc/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import cloneObject from '../date-fns-v2-lib/cloneObject'; -import toDate from '../toDate'; -import tzPattern from '../_lib/tzPattern'; -import tzParseTimezone from '../_lib/tzParseTimezone'; -import newDateUTC from '../_lib/newDateUTC'; -import type { OptionsWithTZ } from '../types'; - -/** - * @name zonedTimeToUtc - * @category Time Zone Helpers - * @summary Get the UTC date/time from a date representing local time in a given time zone - * - * @description - * Returns a date instance with the UTC time of the provided date of which the values - * represented the local time in the time zone specified. In other words, if the input - * date represented local time in time zone, the timestamp of the output date will - * give the equivalent UTC of that local time regardless of the current system time zone. - * - * @param {Date|String|Number} date - the date with values representing the local time - * @param {String} timeZone - the time zone of this local time, can be an offset or IANA time zone - * @param {OptionsWithTZ} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} - * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} - * @returns {Date} the new date with the equivalent time in the time zone - * @throws {TypeError} 2 arguments required - * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 - * - * @example - * // In June 10am in Los Angeles is 5pm UTC - * const result = zonedTimeToUtc(new Date(2014, 5, 25, 10, 0, 0), 'America/Los_Angeles') - * //=> 2014-06-25T17:00:00.000Z - */ -export default function zonedTimeToUtc(date: Date | string | number, timeZone: string, options: OptionsWithTZ): Date { - if (typeof date === 'string' && !date.match(tzPattern)) { - const extendedOptions = cloneObject(options); - extendedOptions.timeZone = timeZone; - return toDate(date, extendedOptions); - } - - const d = toDate(date, options); - - const utc = newDateUTC( - d.getFullYear(), - d.getMonth(), - d.getDate(), - d.getHours(), - d.getMinutes(), - d.getSeconds(), - d.getMilliseconds(), - ).getTime(); - - const offsetMilliseconds = tzParseTimezone(timeZone, new Date(utc)); - - return new Date(utc + offsetMilliseconds); -} diff --git a/src/date-fns.spec.ts b/src/date-fns.spec.ts index 5fd8e49..1f83bee 100644 --- a/src/date-fns.spec.ts +++ b/src/date-fns.spec.ts @@ -1,12 +1,13 @@ // date-fns.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { add } from './index'; +import { add } from './index.ts'; describe('date-fns', () => { + process.loadEnvFile(); + it('add works', () => { assert.equal( add(new Date('2014-09-01T14:19:50.000Z'), { diff --git a/src/date-fns/CHANGELOG.md b/src/date-fns/CHANGELOG.md index 67cdb47..e53a25a 100644 --- a/src/date-fns/CHANGELOG.md +++ b/src/date-fns/CHANGELOG.md @@ -8,6 +8,70 @@ This change log follows the format documented in [Keep a CHANGELOG]. [semantic versioning]: http://semver.org/ [keep a changelog]: http://keepachangelog.com/ +## v4.1.0 - 2024-09-17 + +This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs. + +Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14). + +### Fixed + +- Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#3885](https://github.com/date-fns/date-fns/issues/3885). + +### Added + +- Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#3886](https://github.com/date-fns/date-fns/issues/3886). + +## v4.0.0 - 2024-09-16 + +I have great news! First, ten years after its release, date-fns finally gets first-class time zone support. + +Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward. + +[Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/). + +\- [Sasha @kossnocorp](https://twitter.com/kossnocorp) + +### Added + +- Added time zones support via [`@date-fns/tz`](https://github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://github.com/date-fns/tz) for the details about the API. + +- All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone: + + ```ts + import { addDays, startOfDay } from 'date-fns'; + import { tz } from '@date-fns/tz'; + + startOfDay(addDays(Date.now(), 5, { in: tz('Asia/Singapore') })); + //=> "2024-09-16T00:00:00.000+08:00" + ``` + + In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore. + +### Changed + +- The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers). + + The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`. + + In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`. + + ```ts + clamp(Date.now(), { + start: new TZDate(start, 'Asia/Singapore'), + end: new UTCDate(), + }); + //=> TZDate + ``` + +- **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you running the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://github.com/date-fns/date-fns/issues/new). + +- **BREAKING**: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please [report them](https://github.com/date-fns/date-fns/issues/new). + +### Fixed + +- Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE. + ## v3.6.0 - 2024-03-18 On this release worked @kossnocorp and @world1dan. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp). @@ -90,7 +154,7 @@ This release is brought to you by @kossnocorp, @fturmel, @grossbart, @MelvinVerm ### Fixed -- Fixed types compatability with Lodash's `flow` and fp-ts's `pipe`. ([#3641](https://github.com/date-fns/date-fns/issues/3641)) +- Fixed types compatibility with Lodash's `flow` and fp-ts's `pipe`. ([#3641](https://github.com/date-fns/date-fns/issues/3641)) - [Fixed inconsistent behavior of `roundToNearestMinutes`.](https://github.com/date-fns/date-fns/pull/3132) @@ -1559,7 +1623,7 @@ If you're upgrading from v2 alpha or beta, [see the pre-release changelog](https - [New `roundToNearestMinutes` function](https://github.com/date-fns/date-fns/pull/928). Kudos to [@xkizer](https://github.com/xkizer). -- Added new function `fromUnixTime`. Thansk to [@xkizer](https://github.com/xkizer). +- Added new function `fromUnixTime`. Thanks to [@xkizer](https://github.com/xkizer). - New interval, month, and year helpers to fetch a list of all Saturdays and Sundays (weekends) for a given date interval. `eachWeekendOfInterval` is the handler function while the other two are wrapper functions. Kudos to [@laekettavong](https://github.com/laekettavong)! diff --git a/src/date-fns/_lib/addLeadingZeros/index.ts b/src/date-fns/_lib/addLeadingZeros/index.ts index ce2e1bd..8c36b50 100644 --- a/src/date-fns/_lib/addLeadingZeros/index.ts +++ b/src/date-fns/_lib/addLeadingZeros/index.ts @@ -1,5 +1,11 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + export function addLeadingZeros(number: number, targetLength: number): string { const sign = number < 0 ? '-' : ''; const output = Math.abs(number).toString().padStart(targetLength, '0'); return sign + output; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/defaultLocale/index.ts b/src/date-fns/_lib/defaultLocale/index.ts index 401e874..3936ed5 100644 --- a/src/date-fns/_lib/defaultLocale/index.ts +++ b/src/date-fns/_lib/defaultLocale/index.ts @@ -1 +1,7 @@ -export { enUS as defaultLocale } from '../../locale/en-US/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +export { enUS as defaultLocale } from '../../locale/en-US/index.ts'; + +/* eslint-enable */ diff --git a/src/date-fns/_lib/defaultOptions/index.ts b/src/date-fns/_lib/defaultOptions/index.ts index ed55b57..2d17857 100644 --- a/src/date-fns/_lib/defaultOptions/index.ts +++ b/src/date-fns/_lib/defaultOptions/index.ts @@ -1,4 +1,8 @@ -import type { FirstWeekContainsDateOptions, Locale, LocalizedOptions, WeekOptions } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FirstWeekContainsDateOptions, Locale, LocalizedOptions, WeekOptions } from '../../types.ts'; export type DefaultOptions = LocalizedOptions & WeekOptions & FirstWeekContainsDateOptions; @@ -11,3 +15,5 @@ export function getDefaultOptions(): DefaultOptions { export function setDefaultOptions(newOptions: DefaultOptions): void { defaultOptions = newOptions; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/format/formatters/index.ts b/src/date-fns/_lib/format/formatters/index.ts index 7cac323..0e94f23 100644 --- a/src/date-fns/_lib/format/formatters/index.ts +++ b/src/date-fns/_lib/format/formatters/index.ts @@ -1,9 +1,13 @@ -import { getDayOfYear } from '../../../getDayOfYear/index'; -import { getISOWeek } from '../../../getISOWeek/index'; -import { getISOWeekYear } from '../../../getISOWeekYear/index'; -import { getWeek } from '../../../getWeek/index'; -import { getWeekYear } from '../../../getWeekYear/index'; -import type { LocaleDayPeriod, Localize } from '../../../locale/types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDayOfYear } from '../../../getDayOfYear/index.ts'; +import { getISOWeek } from '../../../getISOWeek/index.ts'; +import { getISOWeekYear } from '../../../getISOWeekYear/index.ts'; +import { getWeek } from '../../../getWeek/index.ts'; +import { getWeekYear } from '../../../getWeekYear/index.ts'; +import type { LocaleDayPeriod, Localize } from '../../../locale/types.ts'; import type { Day, Era, @@ -12,9 +16,9 @@ import type { Month, Quarter, WeekOptions, -} from '../../../types'; -import { addLeadingZeros } from '../../addLeadingZeros/index'; -import { lightFormatters } from '../lightFormatters/index'; +} from '../../../types.ts'; +import { addLeadingZeros } from '../../addLeadingZeros/index.ts'; +import { lightFormatters } from '../lightFormatters/index.ts'; const dayPeriodEnum = { am: 'am', @@ -754,14 +758,13 @@ export const formatters: { [token: string]: Formatter } = { // Seconds timestamp t: function (date, token, _localize) { - const timestamp = Math.trunc(date.getTime() / 1000); + const timestamp = Math.trunc(+date / 1000); return addLeadingZeros(timestamp, token.length); }, // Milliseconds timestamp T: function (date, token, _localize) { - const timestamp = date.getTime(); - return addLeadingZeros(timestamp, token.length); + return addLeadingZeros(+date, token.length); }, }; @@ -791,3 +794,5 @@ function formatTimezone(offset: number, delimiter: string = ''): string { const minutes = addLeadingZeros(absOffset % 60, 2); return sign + hours + delimiter + minutes; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/format/lightFormatters/index.ts b/src/date-fns/_lib/format/lightFormatters/index.ts index edaff7d..c629d13 100644 --- a/src/date-fns/_lib/format/lightFormatters/index.ts +++ b/src/date-fns/_lib/format/lightFormatters/index.ts @@ -1,4 +1,8 @@ -import { addLeadingZeros } from '../../addLeadingZeros/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addLeadingZeros } from '../../addLeadingZeros/index.ts'; /* * | | Unit | | Unit | @@ -44,7 +48,7 @@ export const lightFormatters = { // AM or PM a(date: Date, token: string): string { - // [PATCH:] this hack is required because setHours doesn't work for hours that are spring-forward + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold const dayPeriodEnumValue = ((date as any)[Symbol.for('UTCHours')] ?? date.getHours()) / 12 >= 1 ? 'pm' : 'am'; // original: // const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am"; @@ -56,7 +60,7 @@ export const lightFormatters = { case 'aaa': return dayPeriodEnumValue; case 'aaaaa': - return dayPeriodEnumValue[0]!; + return dayPeriodEnumValue[0]; case 'aaaa': default: return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.'; @@ -65,7 +69,7 @@ export const lightFormatters = { // Hour [1-12] h(date: Date, token: string): string { - // [PATCH:] this hack is required because setHours doesn't work for hours that are spring-forward + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold return addLeadingZeros(((date as any)[Symbol.for('UTCHours')] ?? date.getHours()) % 12 || 12, token.length); // original: // return addLeadingZeros(date.getHours() % 12 || 12, token.length); @@ -73,7 +77,7 @@ export const lightFormatters = { // Hour [0-23] H(date: Date, token: string): string { - // [PATCH:] this hack is required because setHours doesn't work for hours that are spring-forward + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold return addLeadingZeros((date as any)[Symbol.for('UTCHours')] ?? date.getHours(), token.length); // original: // return addLeadingZeros(date.getHours(), token.length); @@ -97,3 +101,5 @@ export const lightFormatters = { return addLeadingZeros(fractionalSeconds, token.length); }, }; + +/* eslint-enable */ diff --git a/src/date-fns/_lib/format/longFormatters/index.ts b/src/date-fns/_lib/format/longFormatters/index.ts index 36fd000..a608663 100644 --- a/src/date-fns/_lib/format/longFormatters/index.ts +++ b/src/date-fns/_lib/format/longFormatters/index.ts @@ -1,4 +1,8 @@ -import type { FormatLong } from '../../../locale/types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FormatLong } from '../../../locale/types.ts'; type LongFormatter = (pattern: string, formatLong: FormatLong) => string; @@ -58,7 +62,7 @@ const dateTimeLongFormatter: LongFormatter = (pattern: string, formatLong: Forma } return dateTimeFormat - .replace('{{date}}', dateLongFormatter(datePattern!, formatLong)) + .replace('{{date}}', dateLongFormatter(datePattern, formatLong)) .replace('{{time}}', timeLongFormatter(timePattern, formatLong)); }; @@ -66,3 +70,5 @@ export const longFormatters: Record = { p: timeLongFormatter, P: dateTimeLongFormatter, }; + +/* eslint-enable */ diff --git a/src/date-fns/_lib/getRoundingMethod/index.ts b/src/date-fns/_lib/getRoundingMethod/index.ts index f1ce739..4a0876c 100644 --- a/src/date-fns/_lib/getRoundingMethod/index.ts +++ b/src/date-fns/_lib/getRoundingMethod/index.ts @@ -1,10 +1,16 @@ -import type { RoundingMethod } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { RoundingMethod } from '../../types.ts'; export function getRoundingMethod(method: RoundingMethod | undefined) { - return (number: number) => { + return (number: number): number => { const round = method ? Math[method] : Math.trunc; const result = round(number); // Prevent negative zero return result === 0 ? 0 : result; }; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.ts b/src/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.ts index 3d5106b..2603025 100644 --- a/src/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.ts +++ b/src/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../../toDate/index.ts'; +import type { DateArg } from '../../types.ts'; /** * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. @@ -11,7 +16,7 @@ import { toDate } from '../../toDate/index'; * * This function returns the timezone offset in milliseconds that takes seconds in account. */ -export function getTimezoneOffsetInMilliseconds(date: Date | number | string): number { +export function getTimezoneOffsetInMilliseconds(date: DateArg & {}): number { const _date = toDate(date); const utcDate = new Date( Date.UTC( @@ -27,3 +32,5 @@ export function getTimezoneOffsetInMilliseconds(date: Date | number | string): n utcDate.setUTCFullYear(_date.getFullYear()); return +date - +utcDate; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/normalizeDates/index.ts b/src/date-fns/_lib/normalizeDates/index.ts new file mode 100644 index 0000000..8688f89 --- /dev/null +++ b/src/date-fns/_lib/normalizeDates/index.ts @@ -0,0 +1,25 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../constructFrom/index.ts'; +import type { ContextFn, DateArg } from '../../types.ts'; + +export function normalizeDates( + context: ContextFn | undefined, + ...dates: [DateArg, DateArg, DateArg] +): [Date, Date, Date]; + +export function normalizeDates( + context: ContextFn | undefined, + ...dates: [DateArg, DateArg] +): [Date, Date]; + +export function normalizeDates(context: ContextFn | undefined, ...dates: Array & {}>): Date[]; + +export function normalizeDates(context: ContextFn | undefined, ...dates: Array & {}>) { + const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === 'object')); + return dates.map(normalize); +} + +/* eslint-enable */ diff --git a/src/date-fns/_lib/normalizeInterval/index.ts b/src/date-fns/_lib/normalizeInterval/index.ts new file mode 100644 index 0000000..9b08f6c --- /dev/null +++ b/src/date-fns/_lib/normalizeInterval/index.ts @@ -0,0 +1,13 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { ContextFn, Interval, NormalizedInterval } from '../../types.ts'; +import { normalizeDates } from '../normalizeDates/index.ts'; + +export function normalizeInterval(context: ContextFn | undefined, interval: Interval): NormalizedInterval { + const [start, end] = normalizeDates(context, interval.start, interval.end); + return { start, end }; +} + +/* eslint-enable */ diff --git a/src/date-fns/_lib/protectedTokens/index.ts b/src/date-fns/_lib/protectedTokens/index.ts index dd541bf..608260e 100644 --- a/src/date-fns/_lib/protectedTokens/index.ts +++ b/src/date-fns/_lib/protectedTokens/index.ts @@ -1,13 +1,17 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + const dayOfYearTokenRE = /^D+$/; const weekYearTokenRE = /^Y+$/; const throwTokens = ['D', 'DD', 'YY', 'YYYY']; -export function isProtectedDayOfYearToken(token: string) { +export function isProtectedDayOfYearToken(token: string): boolean { return dayOfYearTokenRE.test(token); } -export function isProtectedWeekYearToken(token: string) { +export function isProtectedWeekYearToken(token: string): boolean { return weekYearTokenRE.test(token); } @@ -21,3 +25,5 @@ function message(token: string, format: string, input: string) { const subject = token[0] === 'Y' ? 'years' : 'days of the month'; return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } + +/* eslint-enable */ diff --git a/src/date-fns/_lib/test/index.ts b/src/date-fns/_lib/test/index.ts deleted file mode 100644 index 8b125e2..0000000 --- a/src/date-fns/_lib/test/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { addLeadingZeros } from '../addLeadingZeros/index'; -import { setDefaultOptions } from '../defaultOptions/index'; - -export function assertType(_: T): void {} - -export function resetDefaultOptions(): void { - setDefaultOptions({}); -} - -// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran. -export function generateOffset(originalDate: Date) { - // Add the timezone. - let offset = ''; - const tzOffset = originalDate.getTimezoneOffset(); - - if (tzOffset !== 0) { - const absoluteOffset = Math.abs(tzOffset); - const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2); - const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2); - // If less than 0, the sign is +, because it is ahead of time. - const sign = tzOffset < 0 ? '+' : '-'; - - offset = `${sign}${hourOffset}:${minuteOffset}`; - } else { - offset = 'Z'; - } - - return offset; -} diff --git a/src/date-fns/_test/dst/addBusinessDays/basic.ts b/src/date-fns/_test/dst/addBusinessDays/basic.ts deleted file mode 100644 index ddebe6d..0000000 --- a/src/date-fns/_test/dst/addBusinessDays/basic.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This is basic DST test for addBusinessDays - -import assert from 'assert'; -import { addBusinessDays } from '../../../addBusinessDays/index.js'; - -if (process.env.TZ !== 'America/Santiago') throw new Error('The test must be run with TZ=America/Santiago'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -console.log(addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10).toString()); - -assert.deepStrictEqual( - // new Date(2014, 8, 7) is the DST day - addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10).toString(), - 'Mon Sep 15 2014 00:00:00 GMT-0300 (Chile Summer Time)', -); diff --git a/src/date-fns/_test/dst/eachDayOfInterval/basic.ts b/src/date-fns/_test/dst/eachDayOfInterval/basic.ts deleted file mode 100644 index 4bddb1c..0000000 --- a/src/date-fns/_test/dst/eachDayOfInterval/basic.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This is basic DST test for eachDayOfInterval - -import { eachDayOfInterval } from '../../../eachDayOfInterval/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Asia/Damascus') throw new Error('The test must be run with TZ=Asia/Damascus'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -assert.deepStrictEqual( - eachDayOfInterval({ - start: new Date(2020, 2, 26), - end: new Date(2020, 2, 28), - }).map((d) => d.toString()), - [ - 'Thu Mar 26 2020 00:00:00 GMT+0200 (GMT+03:00)', - 'Fri Mar 27 2020 01:00:00 GMT+0300 (GMT+03:00)', - 'Sat Mar 28 2020 00:00:00 GMT+0300 (GMT+03:00)', - ], -); diff --git a/src/date-fns/_test/dst/formatDistanceStrict/cairo.ts b/src/date-fns/_test/dst/formatDistanceStrict/cairo.ts deleted file mode 100644 index 513360f..0000000 --- a/src/date-fns/_test/dst/formatDistanceStrict/cairo.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This is DST test for formatDistanceStrict in the Cairo timezone - -import { formatDistanceStrict } from '../../../formatDistanceStrict/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Africa/Cairo') throw new Error('The test must be run with TZ=Africa/Cairo'); - -assert.strictEqual(formatDistanceStrict(new Date(1986, 3, 4, 10, 32, 0), new Date(1986, 4, 4, 10, 32, 0)), '1 month'); diff --git a/src/date-fns/_test/dst/formatDistanceStrict/melbourne.ts b/src/date-fns/_test/dst/formatDistanceStrict/melbourne.ts deleted file mode 100644 index 304ef62..0000000 --- a/src/date-fns/_test/dst/formatDistanceStrict/melbourne.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This is DST test for formatDistanceStrict in the Melbourne timezone - -import { formatDistanceStrict } from '../../../formatDistanceStrict/index.js'; -import { parseISO } from '../../../parseISO/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Australia/Melbourne') throw new Error('The test must be run with TZ=Australia/Melbourne'); - -assert.strictEqual( - formatDistanceStrict(parseISO('2020-04-05T01:00:00+11:00'), parseISO('2020-04-05T03:00:00+10:00')), - '3 hours', -); diff --git a/src/date-fns/_test/dst/getOverlappingDaysInIntervals/basic.ts b/src/date-fns/_test/dst/getOverlappingDaysInIntervals/basic.ts deleted file mode 100644 index 31c17e6..0000000 --- a/src/date-fns/_test/dst/getOverlappingDaysInIntervals/basic.ts +++ /dev/null @@ -1,16 +0,0 @@ -import assert from 'assert'; -import { getOverlappingDaysInIntervals } from '../../../getOverlappingDaysInIntervals/index.js'; - -assert.strictEqual( - getOverlappingDaysInIntervals( - { - start: new Date(2001, 8 /* Sep */, 1, 16), - end: new Date(2023, 11 /* Dec */, 20, 16), - }, - { - start: new Date(2023, 11 /* Dec */, 21, 16), - end: new Date(2001, 8 /* Sep */, 9, 16), - }, - ), - 8137, -); diff --git a/src/date-fns/_test/dst/parseISO/basic.ts b/src/date-fns/_test/dst/parseISO/basic.ts deleted file mode 100644 index 2267ef8..0000000 --- a/src/date-fns/_test/dst/parseISO/basic.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This is basic DST test for parseISO - -import { parseISO } from '../../../parseISO/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'America/Sao_Paulo') throw new Error('The test must be run with TZ=America/Sao_Paulo'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Test DST start edge -assert.strictEqual(parseISO('2018-11-03').getDate(), 3); -assert.strictEqual(parseISO('2018-11-04').getDate(), 4); // DST start -assert.strictEqual(parseISO('2018-11-05').getDate(), 5); - -// Test DST end edge -assert.strictEqual(parseISO('2019-02-15').getDate(), 15); -assert.strictEqual(parseISO('2019-02-16').getDate(), 16); // DST end -assert.strictEqual(parseISO('2019-02-17').getDate(), 17); - -// Test creation of nonexistent time -assert.strictEqual(parseISO('2018-11-04T00:00').toString(), 'Sun Nov 04 2018 01:00:00 GMT-0200 (Brasilia Summer Time)'); -assert.strictEqual(parseISO('2018-11-04T00:30').toString(), 'Sun Nov 04 2018 01:30:00 GMT-0200 (Brasilia Summer Time)'); diff --git a/src/date-fns/_test/dst/parseISO/samoa.ts b/src/date-fns/_test/dst/parseISO/samoa.ts deleted file mode 100644 index 5330002..0000000 --- a/src/date-fns/_test/dst/parseISO/samoa.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This is an edge case DST test for parseISO - -import { parseISO } from '../../../parseISO/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Pacific/Apia') throw new Error('The test must be run with TZ=Pacific/Apia'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -assert.strictEqual(parseISO('2011-12-30').getDate(), 31); -assert.strictEqual(parseISO('2011-12-30T03:30').toString(), 'Sat Dec 31 2011 03:30:00 GMT+1400 (Apia Daylight Time)'); diff --git a/src/date-fns/_test/dst/parseISO/sydney.ts b/src/date-fns/_test/dst/parseISO/sydney.ts deleted file mode 100644 index a235d3e..0000000 --- a/src/date-fns/_test/dst/parseISO/sydney.ts +++ /dev/null @@ -1,57 +0,0 @@ -// This is basic DST test for parseISO - -import { parseISO } from '../../../parseISO/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Australia/Sydney') throw new Error('The test must be run with TZ=Australia/Sydney'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Test DST start edge -assert.strictEqual(parseISO('2019-10-06').getDate(), 6); // DST start -assert.strictEqual(parseISO('2019-10-07').getDate(), 7); -assert.strictEqual( - parseISO('2019-10-06T01:00:00').toString(), - 'Sun Oct 06 2019 01:00:00 GMT+1000 (Australian Eastern Standard Time)', -); -assert.strictEqual( - parseISO('2019-10-06T02:00:00').toString(), - 'Sun Oct 06 2019 03:00:00 GMT+1100 (Australian Eastern Daylight Time)', -); - -assert.strictEqual( - parseISO('2019-10-06T05:00:00').toString(), - 'Sun Oct 06 2019 05:00:00 GMT+1100 (Australian Eastern Daylight Time)', -); - -// Test DST end edge -assert.strictEqual(parseISO('2019-04-06').getDate(), 6); -assert.strictEqual(parseISO('2019-04-07').getDate(), 7); // DST end -assert.strictEqual( - parseISO('2019-04-06T11:00:00').toString(), - 'Sat Apr 06 2019 11:00:00 GMT+1100 (Australian Eastern Daylight Time)', -); -assert.strictEqual( - parseISO('2019-04-07T11:00:00').toString(), - 'Sun Apr 07 2019 11:00:00 GMT+1000 (Australian Eastern Standard Time)', -); - -assert.strictEqual( - parseISO('2019-04-07T00:00:00').toString(), - 'Sun Apr 07 2019 00:00:00 GMT+1100 (Australian Eastern Daylight Time)', -); - -// test edge cases for months, years -assert.strictEqual( - parseISO('2020-01-01T00:00:00').toString(), - 'Wed Jan 01 2020 00:00:00 GMT+1100 (Australian Eastern Daylight Time)', -); -assert.strictEqual( - parseISO('2019-12-31T23:59:59').toString(), - 'Tue Dec 31 2019 23:59:59 GMT+1100 (Australian Eastern Daylight Time)', -); -assert.strictEqual( - parseISO('2020-02-29T23:59:59').toString(), - 'Sat Feb 29 2020 23:59:59 GMT+1100 (Australian Eastern Daylight Time)', -); diff --git a/src/date-fns/_test/dst/tzOffsetTransitions.ts b/src/date-fns/_test/dst/tzOffsetTransitions.ts deleted file mode 100644 index 22f60a2..0000000 --- a/src/date-fns/_test/dst/tzOffsetTransitions.ts +++ /dev/null @@ -1,140 +0,0 @@ -type PartialInterval = { - start: Date | undefined; - end: Date | undefined; -}; - -/** - * Fetch the start and end of DST for the local time - * zone in a given year. - * We'll assume that DST start & end are the first - * forward and the last back transitions in the year, - * except transitions in Jan or Dec which are likely - * to be permanent TZ changes rather than DST changes. - * @param year - * @returns object with two Date-valued properties: - * - `start` is the first instant of DST in the Spring, - * or undefined if there's no DST in this year. - * - `end` is the first instant of standard time - * in the Fall, or undefined if there's no DST in - * this year. - */ -export function getDstTransitions(year: number): PartialInterval { - const result: PartialInterval = { - start: undefined, - end: undefined, - }; - const transitions = getTzOffsetTransitions(year); - for (let i = 0; i < transitions.length; i++) { - const t = transitions[i]!; - const month = t.date.getMonth(); - if (month > 0 && month < 11) { - if (t.type === 'forward') result.start = t.date; - if (t.type === 'back' && !result.end) result.end = t.date; - } - } - return result; -} - -function isValidDate(date: unknown): date is Date { - return date instanceof Date && !isNaN(date.getTime()); -} - -const MINUTE = 1000 * 60; - -function firstTickInLocalDay(date: Date): Date { - const dateNumber = date.getDate(); - let prev = date; - let d = date; - do { - prev = d; - d = new Date(d.getTime() - MINUTE); - } while (dateNumber === d.getDate()); - return prev; -} - -function fiveMinutesLater(date: Date): Date { - return new Date(date.getTime() + 5 * MINUTE); -} - -function oneDayLater(date: Date): Date { - const d = new Date(date); - d.setDate(d.getDate() + 1); - return firstTickInLocalDay(d); -} - -function previousTickTimezoneOffset(date: Date): number { - const d = new Date(date.getTime() - 1); - return d.getTimezoneOffset(); -} - -/** - * Fetch all timezone-offset transitions in a given - * year. These are almost always DST transitions, - * but sometimes there are non-DST changes, e.g. - * when a country changes its time zone - * @param year - * @returns array of objects, each with the following - * propeerties: - * - `date` - a `Date` representing the first instant - * when the new timezone offset is effective. - * - `type` - either `forward` for skippnig time like - * the Spring transition to DST. - * - `before` - the timezone offset before the tranition. - * For example, the UTC-0400 offset will return -240. - * To match how times are displayed in ISO 8601 format, - * the sign of this value is reversed from the return - * value of `Date.getTimezoneOffset`. - * - `after` - the timezone offset after the tranition. - * Examples and caveats are the same as `before`. - - */ -export function getTzOffsetTransitions(year: number) { - // start at the end of the previous day - let date = firstTickInLocalDay(new Date(year, 0, 1)); - if (!isValidDate(date)) { - throw new Error('Invalid Date'); - } - let baseTzOffset = previousTickTimezoneOffset(date); - const transitions = []; - do { - let tzOffset = date.getTimezoneOffset(); - if (baseTzOffset !== tzOffset) { - if (tzOffset !== previousTickTimezoneOffset(date)) { - // Transition is the first tick of a local day. - transitions.push({ - date: date, - type: tzOffset < baseTzOffset ? 'forward' : 'back', - before: -baseTzOffset, - after: -tzOffset, - }); - baseTzOffset = tzOffset; - } else { - // transition was not at the start of the day, so it must have happened - // yesterday. Back up one day and find the minute where it happened. - let transitionDate = new Date(date.getTime()); - transitionDate.setDate(transitionDate.getDate() - 1); - - // Iterate through each 5 mins of the day until we find a transition. - // TODO: this could be optimized to search hours then minutes or by or - // by using a binary search. - const dayNumber = transitionDate.getDate(); - while (isValidDate(transitionDate) && transitionDate.getDate() === dayNumber) { - tzOffset = transitionDate.getTimezoneOffset(); - if (baseTzOffset !== tzOffset) { - transitions.push({ - date: transitionDate, - type: tzOffset < baseTzOffset ? 'forward' : 'back', - before: -baseTzOffset, - after: -tzOffset, - }); - baseTzOffset = tzOffset; - break; // assuming only 1 transition per day - } - transitionDate = fiveMinutesLater(transitionDate); - } - } - } - date = oneDayLater(date); - } while (date.getFullYear() === year); - return transitions; -} diff --git a/src/date-fns/_test/formatISO/india.ts b/src/date-fns/_test/formatISO/india.ts deleted file mode 100644 index 5b2e051..0000000 --- a/src/date-fns/_test/formatISO/india.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { formatISO } from '../../formatISO/index.js'; -import assert from 'assert'; - -if (process.env.TZ !== 'Asia/Kolkata') throw new Error('The test must be run with TZ=Asia/Kolkata'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -assert.strictEqual(formatISO(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01+05:30'); diff --git a/src/date-fns/_test/formatRFC3339/australia.ts b/src/date-fns/_test/formatRFC3339/australia.ts deleted file mode 100644 index 77a7df1..0000000 --- a/src/date-fns/_test/formatRFC3339/australia.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { formatRFC3339 } from '../../formatRFC3339/index.js'; -import assert from 'assert'; - -/** - * Australia/Eucla (Australia) is interesting for its positive to UTC time, with 45 minutes offset. - * It's independent from Standard and Summer time. - */ -if (process.env.TZ !== 'Australia/Eucla') throw new Error('The test must be run with TZ=Australia/Eucla (UTC+08:45)'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Old date -assert.strictEqual(formatRFC3339(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01+08:45'); - -// Standard time (Eucla have +08:45) -assert.strictEqual(formatRFC3339(new Date(2020, 0, 23, 5, 0, 54)), '2020-01-23T05:00:54+08:45'); - -// Summer time (Eucla have +08:45) -assert.strictEqual(formatRFC3339(new Date(2020, 6, 30, 20, 59, 1)), '2020-07-30T20:59:01+08:45'); diff --git a/src/date-fns/_test/formatRFC3339/india.ts b/src/date-fns/_test/formatRFC3339/india.ts deleted file mode 100644 index d24209b..0000000 --- a/src/date-fns/_test/formatRFC3339/india.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { formatRFC3339 } from '../../formatRFC3339/index.js'; -import assert from 'assert'; - -/** - * Asia/Kolkata (India) is interesting for its positive to UTC time, with 30 minutes offset. - * It's independent from Standard and Summer time. - */ -if (process.env.TZ !== 'Asia/Kolkata') throw new Error('The test must be run with TZ=Asia/Kolkata'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Old date -assert.strictEqual(formatRFC3339(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01+05:30'); - -// Standard time (india always have +05:30) -assert.strictEqual(formatRFC3339(new Date(2020, 0, 23, 5, 0, 54)), '2020-01-23T05:00:54+05:30'); - -// Summer time (india always have +05:30) -assert.strictEqual(formatRFC3339(new Date(2020, 6, 30, 20, 59, 1)), '2020-07-30T20:59:01+05:30'); diff --git a/src/date-fns/_test/formatRFC3339/newfoundland.ts b/src/date-fns/_test/formatRFC3339/newfoundland.ts deleted file mode 100644 index 5985c30..0000000 --- a/src/date-fns/_test/formatRFC3339/newfoundland.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { formatRFC3339 } from '../../formatRFC3339/index.js'; -import assert from 'assert'; - -/** - * America/St_Johns (Canada) is interesting for its negative to UTC time, with 30 minutes offset. - * Bonus: It depends on Standard and Summer time. - */ -if (process.env.TZ !== 'America/St_Johns') - throw new Error('The test must be run with TZ=America/St_Johns (UTC-02:30 or UTC-03:30)'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Old date -assert.strictEqual(formatRFC3339(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01-03:30'); - -// Standard time (Newfoundland and Labrador have -03:30) -assert.strictEqual(formatRFC3339(new Date(2020, 0, 23, 5, 0, 54)), '2020-01-23T05:00:54-03:30'); - -// Summer time (Newfoundland and Labrador have -02:30) -assert.strictEqual(formatRFC3339(new Date(2020, 6, 30, 20, 59, 1)), '2020-07-30T20:59:01-02:30'); diff --git a/src/date-fns/_test/formatRFC3339/newzealand.ts b/src/date-fns/_test/formatRFC3339/newzealand.ts deleted file mode 100644 index a4c83ce..0000000 --- a/src/date-fns/_test/formatRFC3339/newzealand.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { formatRFC3339 } from '../../formatRFC3339/index.js'; -import assert from 'assert'; - -/** - * Pacific/Chatham (Chatham Islands, New Zealand) is interesting for being the farthest from UTC. - * It depends on Standard (+12:45) and Summer time (+13:45). - */ -if (process.env.TZ !== 'Pacific/Chatham') - throw new Error('The test must be run with TZ=Pacific/Chatham (UTC+12:45 or UTC+13:45)'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Old date -assert.strictEqual(formatRFC3339(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01+12:45'); - -// Standard time (Chatham have +13:45) -assert.strictEqual(formatRFC3339(new Date(2020, 8, 27, 20, 59, 1)), '2020-09-27T20:59:01+13:45'); - -// Summer time (Chatham have +12:45) -assert.strictEqual(formatRFC3339(new Date(2020, 3, 5, 5, 0, 54)), '2020-04-05T05:00:54+12:45'); diff --git a/src/date-fns/_test/formatRFC3339/poland.ts b/src/date-fns/_test/formatRFC3339/poland.ts deleted file mode 100644 index e233799..0000000 --- a/src/date-fns/_test/formatRFC3339/poland.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { formatRFC3339 } from '../../formatRFC3339/index.js'; -import assert from 'assert'; - -/** - * Europe/Warsaw (Poland) is regular full-hours timezone - */ -if (process.env.TZ !== 'Europe/Warsaw') - throw new Error('The test must be run with TZ=Europe/Warsaw (UTC+02:00 or UTC+01:00)'); - -if (parseInt(process.version.match(/^v(\d+)\./)?.[1] || '0') < 10) - throw new Error('The test must be run on Node.js version >= 10'); - -// Old date -assert.strictEqual(formatRFC3339(new Date(1986, 3, 4, 10, 33, 1)), '1986-04-04T10:33:01+02:00'); - -// Standard time (Warsaw have +01:00) -assert.strictEqual(formatRFC3339(new Date(2020, 0, 23, 5, 0, 54)), '2020-01-23T05:00:54+01:00'); - -// Summer time (Warsaw have +02:00) -assert.strictEqual(formatRFC3339(new Date(2020, 6, 30, 20, 59, 1)), '2020-07-30T20:59:01+02:00'); diff --git a/src/date-fns/add/index.ts b/src/date-fns/add/index.ts index 5f8b6ab..2376b3a 100644 --- a/src/date-fns/add/index.ts +++ b/src/date-fns/add/index.ts @@ -1,33 +1,32 @@ -import { addDays } from '../addDays/index'; -import { addMonths } from '../addMonths/index'; -import { constructFrom } from '../constructFrom/index'; -import { toDate } from '../toDate/index'; -import type { Duration } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import { addMonths } from '../addMonths/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, Duration } from '../types.ts'; + +/** + * The {@link add} function options. + */ +export interface AddOptions extends ContextOptions {} /** * @name add * @category Common Helpers - * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. + * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date. * * @description - * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date. + * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed - * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be added. - * - * | Key | Description | - * |----------------|------------------------------------| - * | years | Amount of years to be added | - * | months | Amount of months to be added | - * | weeks | Amount of weeks to be added | - * | days | Amount of days to be added | - * | hours | Amount of hours to be added | - * | minutes | Amount of minutes to be added | - * | seconds | Amount of seconds to be added | - * - * All values default to 0 + * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added. + * @param options - An object with options * * @returns The new date with the seconds added * @@ -38,27 +37,32 @@ import type { Duration } from '../types'; * months: 9, * weeks: 1, * days: 7, - * hours: 5,\\-7 + * hours: 5, * minutes: 9, * seconds: 30, * }) * //=> Thu Jun 15 2017 15:29:20 */ -export function add(date: DateType | number | string, duration: Duration): DateType { +export function add( + date: DateArg, + duration: Duration, + options?: AddOptions | undefined, +): ResultDate { const { years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0 } = duration; // Add years and months - const _date = toDate(date); + const _date = toDate(date, options?.in); const dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date; // Add weeks and days const dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths; - // Add days, hours, minutes and seconds + // Add days, hours, minutes, and seconds const minutesToAdd = minutes + hours * 60; const secondsToAdd = seconds + minutesToAdd * 60; const msToAdd = secondsToAdd * 1000; - const finalDate = constructFrom(date, dateWithDays.getTime() + msToAdd); - return finalDate; + return constructFrom(options?.in || date, +dateWithDays + msToAdd); } + +/* eslint-enable */ diff --git a/src/date-fns/addBusinessDays/index.ts b/src/date-fns/addBusinessDays/index.ts index 704f389..1fceb3b 100644 --- a/src/date-fns/addBusinessDays/index.ts +++ b/src/date-fns/addBusinessDays/index.ts @@ -1,21 +1,33 @@ -import { constructFrom } from '../constructFrom/index'; -import { isSaturday } from '../isSaturday/index'; -import { isSunday } from '../isSunday/index'; -import { isWeekend } from '../isWeekend/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { isSaturday } from '../isSaturday/index.ts'; +import { isSunday } from '../isSunday/index.ts'; +import { isWeekend } from '../isWeekend/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addBusinessDays} function options. + */ +export interface AddBusinessDaysOptions extends ContextOptions {} /** * @name addBusinessDays - * @category Date Extension Helpers + * @category Day Helpers * @summary Add the specified number of business days (mon - fri) to the given date. * * @description * Add the specified number of business days (mon - fri) to the given date, ignoring weekends. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of business days to be added. + * @param options - An object with options * * @returns The new date with the business days added * @@ -24,11 +36,15 @@ import { toDate } from '../toDate/index'; * const result = addBusinessDays(new Date(2014, 8, 1), 10) * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days) */ -export function addBusinessDays(date: DateType | number | string, amount: number): DateType { - const _date = toDate(date); - const startedOnWeekend = isWeekend(_date); +export function addBusinessDays( + date: DateArg, + amount: number, + options?: AddBusinessDaysOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); + const startedOnWeekend = isWeekend(_date, options); - if (isNaN(amount)) return constructFrom(date, NaN); + if (isNaN(amount)) return constructFrom(options?.in, NaN); const hours = _date.getHours(); const sign = amount < 0 ? -1 : 1; @@ -42,17 +58,17 @@ export function addBusinessDays(date: DateType | number | // Loops over remaining days while (restDays > 0) { _date.setDate(_date.getDate() + sign); - if (!isWeekend(_date)) restDays -= 1; + if (!isWeekend(_date, options)) restDays -= 1; } // If the date is a weekend day and we reduce a dividable of // 5 from it, we land on a weekend date. // To counter this, we add days accordingly to land on the next business day - if (startedOnWeekend && isWeekend(_date) && amount !== 0) { + if (startedOnWeekend && isWeekend(_date, options) && amount !== 0) { // If we're reducing days, we want to add days until we land on a weekday // If we're adding days we want to reduce days until we land on a weekday - if (isSaturday(_date)) _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1)); - if (isSunday(_date)) _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2)); + if (isSaturday(_date, options)) _date.setDate(_date.getDate() + (sign < 0 ? 2 : -1)); + if (isSunday(_date, options)) _date.setDate(_date.getDate() + (sign < 0 ? 1 : -2)); } // Restore hours to avoid DST lag @@ -60,3 +76,5 @@ export function addBusinessDays(date: DateType | number | return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/addDays/index.ts b/src/date-fns/addDays/index.ts index bdcebd1..304d7b0 100644 --- a/src/date-fns/addDays/index.ts +++ b/src/date-fns/addDays/index.ts @@ -1,5 +1,15 @@ -import { toDate } from '../toDate/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addDays} function options. + */ +export interface AddDaysOptions extends ContextOptions {} /** * @name addDays @@ -10,9 +20,11 @@ import { constructFrom } from '../constructFrom/index'; * Add the specified number of days to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of days to be added. + * @param options - An object with options * * @returns The new date with the days added * @@ -21,13 +33,19 @@ import { constructFrom } from '../constructFrom/index'; * const result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ -export function addDays(date: DateType | number | string, amount: number): DateType { - const _date = toDate(date); - if (isNaN(amount)) return constructFrom(date, NaN); - if (!amount) { - // If 0 days, no-op to avoid changing times in the hour before end of DST - return _date; - } +export function addDays( + date: DateArg, + amount: number, + options?: AddDaysOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); + if (isNaN(amount)) return constructFrom(options?.in || date, NaN); + + // If 0 days, no-op to avoid changing times in the hour before end of DST + if (!amount) return _date; + _date.setDate(_date.getDate() + amount); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/addHours/index.ts b/src/date-fns/addHours/index.ts index 7fe9a7a..d9da4e0 100644 --- a/src/date-fns/addHours/index.ts +++ b/src/date-fns/addHours/index.ts @@ -1,5 +1,15 @@ -import { addMilliseconds } from '../addMilliseconds/index'; -import { millisecondsInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMilliseconds } from '../addMilliseconds/index.ts'; +import { millisecondsInHour } from '../constants/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addHours} function options. + */ +export interface AddHoursOptions extends ContextOptions {} /** * @name addHours @@ -10,9 +20,11 @@ import { millisecondsInHour } from '../constants/index'; * Add the specified number of hours to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed - * @param amount - The amount of hours to be added. + * @param amount - The amount of hours to be added + * @param options - An object with options * * @returns The new date with the hours added * @@ -21,6 +33,12 @@ import { millisecondsInHour } from '../constants/index'; * const result = addHours(new Date(2014, 6, 10, 23, 0), 2) * //=> Fri Jul 11 2014 01:00:00 */ -export function addHours(date: DateType | number | string, amount: number): DateType { - return addMilliseconds(date, amount * millisecondsInHour); +export function addHours( + date: DateArg, + amount: number, + options?: AddHoursOptions | undefined, +): ResultDate { + return addMilliseconds(date, amount * millisecondsInHour, options); } + +/* eslint-enable */ diff --git a/src/date-fns/addISOWeekYears/index.ts b/src/date-fns/addISOWeekYears/index.ts index eaadf39..eb1f454 100644 --- a/src/date-fns/addISOWeekYears/index.ts +++ b/src/date-fns/addISOWeekYears/index.ts @@ -1,5 +1,15 @@ -import { getISOWeekYear } from '../getISOWeekYear/index'; -import { setISOWeekYear } from '../setISOWeekYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getISOWeekYear } from '../getISOWeekYear/index.ts'; +import { setISOWeekYear } from '../setISOWeekYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addISOWeekYears} function options. + */ +export interface AddISOWeekYearsOptions extends ContextOptions {} /** * @name addISOWeekYears @@ -15,14 +25,21 @@ import { setISOWeekYear } from '../setISOWeekYear/index'; * * @param date - The date to be changed * @param amount - The amount of ISO week-numbering years to be added. + * @param options - An object with options * * @returns The new date with the ISO week-numbering years added * * @example * // Add 5 ISO week-numbering years to 2 July 2010: * const result = addISOWeekYears(new Date(2010, 6, 2), 5) - * //=> Fri Jn 26 2015 00:00:00 + * //=> Fri Jun 26 2015 00:00:00 */ -export function addISOWeekYears(date: DateType | number | string, amount: number): DateType { - return setISOWeekYear(date, getISOWeekYear(date) + amount); +export function addISOWeekYears( + date: DateArg, + amount: number, + options?: AddISOWeekYearsOptions | undefined, +): ResultDate { + return setISOWeekYear(date, getISOWeekYear(date, options) + amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/addMilliseconds/index.ts b/src/date-fns/addMilliseconds/index.ts index db8d4f0..e1ecd96 100644 --- a/src/date-fns/addMilliseconds/index.ts +++ b/src/date-fns/addMilliseconds/index.ts @@ -1,5 +1,14 @@ -import { toDate } from '../toDate/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; +/** + * The {@link addMilliseconds} function options. + */ +export interface AddMillisecondsOptions extends ContextOptions {} /** * @name addMilliseconds @@ -10,9 +19,11 @@ import { constructFrom } from '../constructFrom/index'; * Add the specified number of milliseconds to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of milliseconds to be added. + * @param options - The options object * * @returns The new date with the milliseconds added * @@ -21,7 +32,12 @@ import { constructFrom } from '../constructFrom/index'; * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:30.750 */ -export function addMilliseconds(date: DateType | number | string, amount: number): DateType { - const timestamp = +toDate(date); - return constructFrom(date, timestamp + amount); +export function addMilliseconds( + date: DateArg, + amount: number, + options?: AddMillisecondsOptions | undefined, +): ResultDate { + return constructFrom(options?.in || date, +toDate(date) + amount); } + +/* eslint-enable */ diff --git a/src/date-fns/addMinutes/index.ts b/src/date-fns/addMinutes/index.ts index 26212e2..189cd68 100644 --- a/src/date-fns/addMinutes/index.ts +++ b/src/date-fns/addMinutes/index.ts @@ -1,5 +1,15 @@ -import { addMilliseconds } from '../addMilliseconds/index'; -import { millisecondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInMinute } from '../constants/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addMinutes} function options. + */ +export interface AddMinutesOptions extends ContextOptions {} /** * @name addMinutes @@ -10,9 +20,11 @@ import { millisecondsInMinute } from '../constants/index'; * Add the specified number of minutes to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of minutes to be added. + * @param options - An object with options * * @returns The new date with the minutes added * @@ -21,6 +33,14 @@ import { millisecondsInMinute } from '../constants/index'; * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) * //=> Thu Jul 10 2014 12:30:00 */ -export function addMinutes(date: DateType | number | string, amount: number): DateType { - return addMilliseconds(date, amount * millisecondsInMinute); +export function addMinutes( + date: DateArg, + amount: number, + options?: AddMinutesOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); + _date.setTime(_date.getTime() + amount * millisecondsInMinute); + return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/addMonths/index.ts b/src/date-fns/addMonths/index.ts index a03d273..c59aa52 100644 --- a/src/date-fns/addMonths/index.ts +++ b/src/date-fns/addMonths/index.ts @@ -1,5 +1,15 @@ -import { toDate } from '../toDate/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addMonths} function options. + */ +export interface AddMonthsOptions extends ContextOptions {} /** * @name addMonths @@ -10,9 +20,11 @@ import { constructFrom } from '../constructFrom/index'; * Add the specified number of months to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of months to be added. + * @param options - The options object * * @returns The new date with the months added * @@ -25,9 +37,13 @@ import { constructFrom } from '../constructFrom/index'; * const result = addMonths(new Date(2023, 0, 30), 1) * //=> Tue Feb 28 2023 00:00:00 */ -export function addMonths(date: DateType | number | string, amount: number): DateType { - const _date = toDate(date); - if (isNaN(amount)) return constructFrom(date, NaN); +export function addMonths( + date: DateArg, + amount: number, + options?: AddMonthsOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); + if (isNaN(amount)) return constructFrom(options?.in || date, NaN); if (!amount) { // If 0 months, no-op to avoid changing times in the hour before end of DST return _date; @@ -42,7 +58,7 @@ export function addMonths(date: DateType | number | strin // we'll default to the end of the desired month by adding 1 to the desired // month and using a date of 0 to back up one day to the end of the desired // month. - const endOfDesiredMonth = constructFrom(date, _date.getTime()); + const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime()); endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0); const daysInMonth = endOfDesiredMonth.getDate(); if (dayOfMonth >= daysInMonth) { @@ -61,3 +77,5 @@ export function addMonths(date: DateType | number | strin return _date; } } + +/* eslint-enable */ diff --git a/src/date-fns/addQuarters/index.ts b/src/date-fns/addQuarters/index.ts index 93fa3c9..ad3653f 100644 --- a/src/date-fns/addQuarters/index.ts +++ b/src/date-fns/addQuarters/index.ts @@ -1,4 +1,14 @@ -import { addMonths } from '../addMonths/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMonths } from '../addMonths/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addQuarters} function options. + */ +export interface AddQuartersOptions extends ContextOptions {} /** * @name addQuarters @@ -9,18 +19,25 @@ import { addMonths } from '../addMonths/index'; * Add the specified number of year quarters to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of quarters to be added. + * @param options - An object with options * * @returns The new date with the quarters added * * @example * // Add 1 quarter to 1 September 2014: * const result = addQuarters(new Date(2014, 8, 1), 1) - * //=> Mon Dec 01 2014 00:00:00 + * //=; Mon Dec 01 2014 00:00:00 */ -export function addQuarters(date: DateType | number | string, amount: number): DateType { - const months = amount * 3; - return addMonths(date, months); +export function addQuarters( + date: DateArg, + amount: number, + options?: AddQuartersOptions | undefined, +): ResultDate { + return addMonths(date, amount * 3, options); } + +/* eslint-enable */ diff --git a/src/date-fns/addSeconds/index.ts b/src/date-fns/addSeconds/index.ts index ccd74d5..5278ec1 100644 --- a/src/date-fns/addSeconds/index.ts +++ b/src/date-fns/addSeconds/index.ts @@ -1,4 +1,14 @@ -import { addMilliseconds } from '../addMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMilliseconds } from '../addMilliseconds/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addSeconds} function options. + */ +export interface AddSecondsOptions extends ContextOptions {} /** * @name addSeconds @@ -9,9 +19,11 @@ import { addMilliseconds } from '../addMilliseconds/index'; * Add the specified number of seconds to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of seconds to be added. + * @param options - An object with options * * @returns The new date with the seconds added * @@ -20,6 +32,12 @@ import { addMilliseconds } from '../addMilliseconds/index'; * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) * //=> Thu Jul 10 2014 12:45:30 */ -export function addSeconds(date: DateType | number | string, amount: number): DateType { - return addMilliseconds(date, amount * 1000); +export function addSeconds( + date: DateArg, + amount: number, + options?: AddSecondsOptions | undefined, +): ResultDate { + return addMilliseconds(date, amount * 1000, options); } + +/* eslint-enable */ diff --git a/src/date-fns/addWeeks/index.ts b/src/date-fns/addWeeks/index.ts index 3b35c8a..db1f4f8 100644 --- a/src/date-fns/addWeeks/index.ts +++ b/src/date-fns/addWeeks/index.ts @@ -1,4 +1,14 @@ -import { addDays } from '../addDays/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addWeeks} function options. + */ +export interface AddWeeksOptions extends ContextOptions {} /** * @name addWeeks @@ -6,12 +16,14 @@ import { addDays } from '../addDays/index'; * @summary Add the specified number of weeks to the given date. * * @description - * Add the specified number of week to the given date. + * Add the specified number of weeks to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of weeks to be added. + * @param options - An object with options * * @returns The new date with the weeks added * @@ -20,7 +32,12 @@ import { addDays } from '../addDays/index'; * const result = addWeeks(new Date(2014, 8, 1), 4) * //=> Mon Sep 29 2014 00:00:00 */ -export function addWeeks(date: DateType | number | string, amount: number): DateType { - const days = amount * 7; - return addDays(date, days); +export function addWeeks( + date: DateArg, + amount: number, + options?: AddWeeksOptions | undefined, +): ResultDate { + return addDays(date, amount * 7, options); } + +/* eslint-enable */ diff --git a/src/date-fns/addYears/index.ts b/src/date-fns/addYears/index.ts index 5de63d4..d5ec223 100644 --- a/src/date-fns/addYears/index.ts +++ b/src/date-fns/addYears/index.ts @@ -1,4 +1,14 @@ -import { addMonths } from '../addMonths/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMonths } from '../addMonths/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link addYears} function options. + */ +export interface AddYearsOptions extends ContextOptions {} /** * @name addYears @@ -9,9 +19,11 @@ import { addMonths } from '../addMonths/index'; * Add the specified number of years to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type. * * @param date - The date to be changed * @param amount - The amount of years to be added. + * @param options - The options * * @returns The new date with the years added * @@ -20,6 +32,12 @@ import { addMonths } from '../addMonths/index'; * const result = addYears(new Date(2014, 8, 1), 5) * //=> Sun Sep 01 2019 00:00:00 */ -export function addYears(date: DateType | number | string, amount: number): DateType { - return addMonths(date, amount * 12); +export function addYears( + date: DateArg, + amount: number, + options?: AddYearsOptions | undefined, +): ResultDate { + return addMonths(date, amount * 12, options); } + +/* eslint-enable */ diff --git a/src/date-fns/areIntervalsOverlapping/index.ts b/src/date-fns/areIntervalsOverlapping/index.ts index d34be32..80626fe 100644 --- a/src/date-fns/areIntervalsOverlapping/index.ts +++ b/src/date-fns/areIntervalsOverlapping/index.ts @@ -1,10 +1,14 @@ -import { toDate } from '../toDate/index'; -import type { Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, Interval } from '../types.ts'; /** * The {@link areIntervalsOverlapping} function options. */ -export interface AreIntervalsOverlappingOptions { +export interface AreIntervalsOverlappingOptions extends ContextOptions { /** Whether the comparison is inclusive or not */ inclusive?: boolean; } @@ -51,13 +55,6 @@ export interface AreIntervalsOverlappingOptions { * // Using the inclusive option: * areIntervalsOverlapping( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, - * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) } - * ) - * //=> false - * - * @example - * areIntervalsOverlapping( - * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }, * { inclusive: true } * ) @@ -68,12 +65,18 @@ export function areIntervalsOverlapping( intervalRight: Interval, options?: AreIntervalsOverlappingOptions, ): boolean { - const [leftStartTime, leftEndTime] = [+toDate(intervalLeft.start), +toDate(intervalLeft.end)].sort((a, b) => a - b); - const [rightStartTime, rightEndTime] = [+toDate(intervalRight.start), +toDate(intervalRight.end)].sort( - (a, b) => a - b, - ); + const [leftStartTime, leftEndTime] = [ + +toDate(intervalLeft.start, options?.in), + +toDate(intervalLeft.end, options?.in), + ].sort((a, b) => a - b); + const [rightStartTime, rightEndTime] = [ + +toDate(intervalRight.start, options?.in), + +toDate(intervalRight.end, options?.in), + ].sort((a, b) => a - b); - if (options?.inclusive) return leftStartTime! <= rightEndTime! && rightStartTime! <= leftEndTime!; + if (options?.inclusive) return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime; - return leftStartTime! < rightEndTime! && rightStartTime! < leftEndTime!; + return leftStartTime < rightEndTime && rightStartTime < leftEndTime; } + +/* eslint-enable */ diff --git a/src/date-fns/clamp/index.ts b/src/date-fns/clamp/index.ts index 42f91c5..1776d3a 100644 --- a/src/date-fns/clamp/index.ts +++ b/src/date-fns/clamp/index.ts @@ -1,11 +1,42 @@ -import { max } from '../max/index'; -import { min } from '../min/index'; -import type { Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { max } from '../max/index.ts'; +import { min } from '../min/index.ts'; +import type { ContextOptions, DateArg, Interval } from '../types.ts'; + +/** + * The {@link clamp} function options. + */ +export interface ClampOptions extends ContextOptions {} + +/** + * The {@link clamp} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type ClampResult< + DateType extends DateArg, + IntervalType extends Interval, + Options extends ClampOptions | undefined, +> = + Options extends ClampOptions + ? DateType + : DateType extends Date + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date; /** * @name clamp * @category Interval Helpers - * @summary Return a date bounded by the start and the end of the given interval + * @summary Return a date bounded by the start and the end of the given interval. * * @description * Clamps a date to the lower bound with the start of the interval and the upper @@ -15,21 +46,32 @@ import type { Interval } from '../types'; * - When the date is greater than the end of the interval, the end is returned. * - Otherwise the date is returned. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - Date argument type. + * @typeParam IntervalType - Interval argument type. + * @typeParam Options - Options type. * * @param date - The date to be bounded * @param interval - The interval to bound to + * @param options - An object with options * * @returns The date bounded by the start and the end of the interval * * @example - * // What is Mar, 21, 2021 bounded to an interval starting at Mar, 22, 2021 and ending at Apr, 01, 2021 + * // What is Mar 21, 2021 bounded to an interval starting at Mar 22, 2021 and ending at Apr 01, 2021 * const result = clamp(new Date(2021, 2, 21), { * start: new Date(2021, 2, 22), * end: new Date(2021, 3, 1), * }) * //=> Mon Mar 22 2021 00:00:00 */ -export function clamp(date: DateType | number | string, interval: Interval): DateType | Date { - return min([max([date, interval.start]), interval.end]); +export function clamp< + DateType extends DateArg, + IntervalType extends Interval, + Options extends ClampOptions | undefined = undefined, +>(date: DateType, interval: IntervalType, options?: Options): ClampResult { + const [date_, start, end] = normalizeDates(options?.in, date, interval.start, interval.end); + + return min([max([date_, start], options), end], options) as ClampResult; } + +/* eslint-enable */ diff --git a/src/date-fns/closestIndexTo/index.ts b/src/date-fns/closestIndexTo/index.ts index 39f8ec7..8b7cd00 100644 --- a/src/date-fns/closestIndexTo/index.ts +++ b/src/date-fns/closestIndexTo/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name closestIndexTo @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Return an index of the closest date from the array comparing to the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateToCompare - The date to compare with * @param dates - The array to search * @@ -26,28 +29,29 @@ import { toDate } from '../toDate/index'; * const result = closestIndexTo(dateToCompare, datesArray) * //=> 1 */ -export function closestIndexTo( - dateToCompare: DateType | number | string, - dates: Array, +export function closestIndexTo( + dateToCompare: DateArg & {}, + dates: Array & {}>, ): number | undefined { - const date = toDate(dateToCompare); + // [TODO] It would be better to return -1 here rather than undefined, as this + // is how JS behaves, but it would be a breaking change, so we need + // to consider it for v4. + const timeToCompare = +toDate(dateToCompare); - if (isNaN(Number(date))) return NaN; - - const timeToCompare = date.getTime(); + if (isNaN(timeToCompare)) return NaN; let result: number | undefined; let minDistance: number; - dates.forEach(function (dirtyDate, index) { - const currentDate = toDate(dirtyDate); + dates.forEach((date, index) => { + const date_ = toDate(date); - if (isNaN(Number(currentDate))) { + if (isNaN(+date_)) { result = NaN; minDistance = NaN; return; } - const distance = Math.abs(timeToCompare - currentDate.getTime()); + const distance = Math.abs(timeToCompare - +date_); if (result == null || distance < minDistance) { result = index; minDistance = distance; @@ -56,3 +60,5 @@ export function closestIndexTo( return result; } + +/* eslint-enable */ diff --git a/src/date-fns/closestTo/index.ts b/src/date-fns/closestTo/index.ts index c5a86ed..e2f97e0 100644 --- a/src/date-fns/closestTo/index.ts +++ b/src/date-fns/closestTo/index.ts @@ -1,5 +1,35 @@ -import { constructFrom } from '../constructFrom/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { closestIndexTo } from '../closestIndexTo/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link closestTo} function options. + */ +export interface ClosestToOptions extends ContextOptions {} + +/** + * The {@link closestTo} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type ClosestToResult< + DateToCompare extends DateArg, + DatesType extends DateArg[], + Options extends ClosestToOptions | undefined, +> = + Options extends ClosestToOptions + ? DateType + : DateToCompare extends Date + ? DateToCompare + : DatesType extends DateArg[] + ? DateType + : Date; /** * @name closestTo @@ -9,7 +39,9 @@ import { toDate } from '../toDate/index'; * @description * Return a date from the array closest to the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateToCompare - Date to compare argument type. + * @typeParam DatesType - Dates array argument type. + * @typeParam Options - Options type. * * @param dateToCompare - The date to compare with * @param dates - The array to search @@ -25,33 +57,23 @@ import { toDate } from '../toDate/index'; * ]) * //=> Tue Jan 01 2030 00:00:00 */ -export function closestTo( - dateToCompare: DateType | number | string, - dates: Array, -): DateType | undefined { - const date = toDate(dateToCompare); - - if (isNaN(Number(date))) return constructFrom(dateToCompare, NaN); - - const timeToCompare = date.getTime(); - - let result: DateType | undefined; - let minDistance: number; - dates.forEach((dirtyDate) => { - const currentDate = toDate(dirtyDate); - - if (isNaN(Number(currentDate))) { - result = constructFrom(dateToCompare, NaN); - minDistance = NaN; - return; - } - - const distance = Math.abs(timeToCompare - currentDate.getTime()); - if (result == null || distance < minDistance) { - result = currentDate; - minDistance = distance; - } - }); - - return result; +export function closestTo< + DateToCompare extends DateArg, + DatesType extends DateArg[], + Options extends ClosestToOptions | undefined = undefined, +>( + dateToCompare: DateToCompare, + dates: DatesType, + options?: Options | undefined, +): ClosestToResult | undefined { + const [dateToCompare_, ...dates_] = normalizeDates(options?.in, dateToCompare, ...dates); + + const index = closestIndexTo(dateToCompare_, dates_); + + if (typeof index === 'number' && isNaN(index)) + return constructFrom(dateToCompare_, NaN) as ClosestToResult; + + if (index !== undefined) return dates_[index] as ClosestToResult; } + +/* eslint-enable */ diff --git a/src/date-fns/compareAsc/index.ts b/src/date-fns/compareAsc/index.ts index 6d6a59d..bc53568 100644 --- a/src/date-fns/compareAsc/index.ts +++ b/src/date-fns/compareAsc/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name compareAsc @@ -9,8 +14,6 @@ import { toDate } from '../toDate/index'; * Compare the two dates and return 1 if the first date is after the second, * -1 if the first date is before the second or 0 if dates are equal. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateLeft - The first date to compare * @param dateRight - The second date to compare * @@ -34,21 +37,14 @@ import { toDate } from '../toDate/index'; * // Sun Jul 02 1995 00:00:00 * // ] */ -export function compareAsc( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, -): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); +export function compareAsc(dateLeft: DateArg & {}, dateRight: DateArg & {}): number { + const diff = +toDate(dateLeft) - +toDate(dateRight); - const diff = _dateLeft.getTime() - _dateRight.getTime(); + if (diff < 0) return -1; + else if (diff > 0) return 1; - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; } + +/* eslint-enable */ diff --git a/src/date-fns/compareDesc/index.ts b/src/date-fns/compareDesc/index.ts index ac6d467..fd70f7a 100644 --- a/src/date-fns/compareDesc/index.ts +++ b/src/date-fns/compareDesc/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name compareDesc @@ -9,8 +14,6 @@ import { toDate } from '../toDate/index'; * Compare the two dates and return -1 if the first date is after the second, * 1 if the first date is before the second or 0 if dates are equal. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateLeft - The first date to compare * @param dateRight - The second date to compare * @@ -34,21 +37,14 @@ import { toDate } from '../toDate/index'; * // Wed Feb 11 1987 00:00:00 * // ] */ -export function compareDesc( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, -): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); +export function compareDesc(dateLeft: DateArg & {}, dateRight: DateArg & {}): number { + const diff = +toDate(dateLeft) - +toDate(dateRight); - const diff = _dateLeft.getTime() - _dateRight.getTime(); + if (diff > 0) return -1; + else if (diff < 0) return 1; - if (diff > 0) { - return -1; - } else if (diff < 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; } + +/* eslint-enable */ diff --git a/src/date-fns/constants/index.ts b/src/date-fns/constants/index.ts index 1453cf9..0e11803 100644 --- a/src/date-fns/constants/index.ts +++ b/src/date-fns/constants/index.ts @@ -1,3 +1,7 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** * @module constants * @summary Useful constants @@ -32,7 +36,7 @@ export const daysInWeek = 7; * * One years equals 365.2425 days according to the formula: * - * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. + * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400. * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days */ export const daysInYear = 365.2425; @@ -51,7 +55,7 @@ export const daysInYear = 365.2425; * new Date(8640000000000001); * //=> Invalid Date */ -export const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000; +export const maxTime: number = Math.pow(10, 8) * 24 * 60 * 60 * 1000; /** * @constant @@ -67,7 +71,7 @@ export const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000; * new Date(-8640000000000001) * //=> Invalid Date */ -export const minTime = -maxTime; +export const minTime: number = -maxTime; /** * @constant @@ -172,32 +176,47 @@ export const secondsInMinute = 60; * @name secondsInDay * @summary Seconds in 1 day. */ -export const secondsInDay = secondsInHour * 24; +export const secondsInDay: number = secondsInHour * 24; /** * @constant * @name secondsInWeek * @summary Seconds in 1 week. */ -export const secondsInWeek = secondsInDay * 7; +export const secondsInWeek: number = secondsInDay * 7; /** * @constant * @name secondsInYear * @summary Seconds in 1 year. */ -export const secondsInYear = secondsInDay * daysInYear; +export const secondsInYear: number = secondsInDay * daysInYear; /** * @constant * @name secondsInMonth * @summary Seconds in 1 month */ -export const secondsInMonth = secondsInYear / 12; +export const secondsInMonth: number = secondsInYear / 12; /** * @constant * @name secondsInQuarter * @summary Seconds in 1 quarter. */ -export const secondsInQuarter = secondsInMonth * 3; +export const secondsInQuarter: number = secondsInMonth * 3; + +/** + * @constant + * @name constructFromSymbol + * @summary Symbol enabling Date extensions to inherit properties from the reference date. + * + * The symbol is used to enable the `constructFrom` function to construct a date + * using a reference date and a value. It allows to transfer extra properties + * from the reference date to the new date. It's useful for extensions like + * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as + * a constructor argument. + */ +export const constructFromSymbol: unique symbol = Symbol.for('constructDateFrom'); + +/* eslint-enable */ diff --git a/src/date-fns/constructFrom/index.ts b/src/date-fns/constructFrom/index.ts index 413e120..aa5d6fa 100644 --- a/src/date-fns/constructFrom/index.ts +++ b/src/date-fns/constructFrom/index.ts @@ -1,4 +1,9 @@ -import type { GenericDateConstructor } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFromSymbol } from '../constants/index.ts'; +import type { ConstructableDate, ContextFn, DateArg, GenericDateConstructor } from '../types.ts'; /** * @name constructFrom @@ -12,6 +17,11 @@ import type { GenericDateConstructor } from '../types'; * * It defaults to `Date` if the passed reference date is a number or a string. * + * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]` + * enabling to transfer extra properties from the reference date to the new date. + * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz) + * that accept a time zone as a constructor argument. + * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). * * @param date - The reference date to take constructor from @@ -20,23 +30,41 @@ import type { GenericDateConstructor } from '../types'; * @returns Date initialized using the given date and value * * @example - * import { constructFrom } from 'date-fns' + * import { constructFrom } from "date-fns"; * * // A function that clones a date preserving the original type - * function cloneDate(date: DateType): DateType { * return constructFrom( - * date, // Use contrustor from the given date + * date, // Use constructor from the given date * date.getTime() // Use the date value to create a new date - * ) + * ); * } */ -export function constructFrom( - date: DateType | number | string, - value: Date | number | string, -): DateType { +export function constructFrom( + date: DateArg | ContextFn | undefined, + value: DateArg & {}, +): ResultDate { + if (typeof date === 'function') return date(value); + + if (date && typeof date === 'object' && constructFromSymbol in date) { + const dateToReturn = date[constructFromSymbol](value); + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold + if ((value as any)[Symbol.for('UTCHours')] !== undefined) { + (dateToReturn as any)[Symbol.for('UTCHours')] = (value as any)[Symbol.for('UTCHours')]; + } + return dateToReturn; + } + if (date instanceof Date) { - return new (date.constructor as GenericDateConstructor)(value); - } else { - return new Date(value) as DateType; + const dateToReturn = new (date.constructor as GenericDateConstructor)(value); + // [PATCH:] this hack is required because setHours doesn't work for hours that are close to daylight saving timezone threshold + if ((date as any)[Symbol.for('UTCHours')] !== undefined) { + (dateToReturn as any)[Symbol.for('UTCHours')] = (date as any)[Symbol.for('UTCHours')]; + } + return dateToReturn; } + + return new Date(value) as ResultDate; } + +/* eslint-enable */ diff --git a/src/date-fns/constructNow/index.ts b/src/date-fns/constructNow/index.ts index 77d7ea7..2d4c569 100644 --- a/src/date-fns/constructNow/index.ts +++ b/src/date-fns/constructNow/index.ts @@ -1,4 +1,9 @@ -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextFn, DateArg } from '../types.ts'; /** * @name constructNow @@ -13,8 +18,6 @@ import { constructFrom } from '../constructFrom/index'; * * It defaults to `Date` if the passed reference date is a number or a string. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The reference date to take constructor from * * @returns Current date initialized using the given date constructor @@ -23,13 +26,17 @@ import { constructFrom } from '../constructFrom/index'; * import { constructNow, isSameDay } from 'date-fns' * * function isToday( - * date: DateType | number | string, + * date: DateArg, * ): boolean { * // If we were to use `new Date()` directly, the function would behave * // differently in different timezones and return false for the same date. * return isSameDay(date, constructNow(date)); * } */ -export function constructNow(date: DateType | number | string): DateType { +export function constructNow( + date: DateArg | ContextFn | undefined, +): ResultDate { return constructFrom(date, Date.now()); } + +/* eslint-enable */ diff --git a/src/date-fns/daysToWeeks/index.ts b/src/date-fns/daysToWeeks/index.ts index e082edf..2904a33 100644 --- a/src/date-fns/daysToWeeks/index.ts +++ b/src/date-fns/daysToWeeks/index.ts @@ -1,4 +1,8 @@ -import { daysInWeek } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { daysInWeek } from '../constants/index.ts'; /** * @name daysToWeeks @@ -8,8 +12,6 @@ import { daysInWeek } from '../constants/index'; * @description * Convert a number of days to a full number of weeks. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param days - The number of days to be converted * * @returns The number of days converted in weeks @@ -25,8 +27,9 @@ import { daysInWeek } from '../constants/index'; * //=> 1 */ export function daysToWeeks(days: number): number { - const weeks = days / daysInWeek; - const result = Math.trunc(weeks); + const result = Math.trunc(days / daysInWeek); // Prevent negative zero return result === 0 ? 0 : result; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInBusinessDays/index.ts b/src/date-fns/differenceInBusinessDays/index.ts index 649f707..6a232ff 100644 --- a/src/date-fns/differenceInBusinessDays/index.ts +++ b/src/date-fns/differenceInBusinessDays/index.ts @@ -1,9 +1,19 @@ -import { addDays } from '../addDays/index'; -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { isSameDay } from '../isSameDay/index'; -import { isValid } from '../isValid/index'; -import { isWeekend } from '../isWeekend/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { addDays } from '../addDays/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { isSameDay } from '../isSameDay/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { isWeekend } from '../isWeekend/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInBusinessDays} function options. + */ +export interface DifferenceInBusinessDaysOptions extends ContextOptions {} /** * @name differenceInBusinessDays @@ -12,14 +22,13 @@ import { toDate } from '../toDate/index'; * * @description * Get the number of business day periods between the given dates. - * Business days being days that arent in the weekend. + * Business days being days that aren't in the weekend. * Like `differenceInCalendarDays`, the function removes the times from * the dates before calculating the difference. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of business days * @@ -56,30 +65,31 @@ import { toDate } from '../toDate/index'; * ) * //=> 0 */ -export function differenceInBusinessDays( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInBusinessDays( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInBusinessDaysOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - let _dateRight = toDate(dateRight); - - if (!isValid(_dateLeft) || !isValid(_dateRight)) return NaN; + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); - const calendarDifference = differenceInCalendarDays(_dateLeft, _dateRight); - const sign = calendarDifference < 0 ? -1 : 1; + if (!isValid(laterDate_) || !isValid(earlierDate_)) return NaN; - const weeks = Math.trunc(calendarDifference / 7); + const diff = differenceInCalendarDays(laterDate_, earlierDate_); + const sign = diff < 0 ? -1 : 1; + const weeks = Math.trunc(diff / 7); let result = weeks * 5; - _dateRight = addDays(_dateRight, weeks * 7); + let movingDate = addDays(earlierDate_, weeks * 7); // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week - while (!isSameDay(_dateLeft, _dateRight)) { + while (!isSameDay(laterDate_, movingDate)) { // sign is used to account for both negative and positive differences - result += isWeekend(_dateRight) ? 0 : sign; - _dateRight = addDays(_dateRight, sign); + result += isWeekend(movingDate, options) ? 0 : sign; + movingDate = addDays(movingDate, sign); } // Prevent negative zero return result === 0 ? 0 : result; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarDays/index.ts b/src/date-fns/differenceInCalendarDays/index.ts index 57f8700..8fa4c3b 100644 --- a/src/date-fns/differenceInCalendarDays/index.ts +++ b/src/date-fns/differenceInCalendarDays/index.ts @@ -1,6 +1,17 @@ -import { millisecondsInDay } from '../constants/index'; -import { startOfDay } from '../startOfDay/index'; -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { millisecondsInDay } from '../constants/index.ts'; +import { startOfDay } from '../startOfDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarDays} function options. + */ +export interface DifferenceInCalendarDaysOptions extends ContextOptions {} /** * @name differenceInCalendarDays @@ -11,10 +22,9 @@ import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMill * Get the number of calendar days between the given dates. This means that the times are removed * from the dates and then the difference in days is calculated. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - The options object * * @returns The number of calendar days * @@ -34,18 +44,23 @@ import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMill * ) * //=> 1 */ -export function differenceInCalendarDays( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarDays( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarDaysOptions | undefined, ): number { - const startOfDayLeft = startOfDay(dateLeft); - const startOfDayRight = startOfDay(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + + const laterStartOfDay = startOfDay(laterDate_); + const earlierStartOfDay = startOfDay(earlierDate_); - const timestampLeft = +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft); - const timestampRight = +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight); + const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay); + const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay); // Round the number of days to the nearest integer because the number of // milliseconds in a day is not constant (e.g. it's different in the week of // the daylight saving time clock shift). - return Math.round((timestampLeft - timestampRight) / millisecondsInDay); + return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarISOWeekYears/index.ts b/src/date-fns/differenceInCalendarISOWeekYears/index.ts index 16a3bf8..3e7221b 100644 --- a/src/date-fns/differenceInCalendarISOWeekYears/index.ts +++ b/src/date-fns/differenceInCalendarISOWeekYears/index.ts @@ -1,4 +1,15 @@ -import { getISOWeekYear } from '../getISOWeekYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { getISOWeekYear } from '../getISOWeekYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarISOWeekYears} function options. + */ +export interface DifferenceInCalendarISOWeekYearsOptions extends ContextOptions {} /** * @name differenceInCalendarISOWeekYears @@ -10,10 +21,9 @@ import { getISOWeekYear } from '../getISOWeekYear/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of calendar ISO week-numbering years * @@ -25,9 +35,13 @@ import { getISOWeekYear } from '../getISOWeekYear/index'; * ) * //=> 2 */ -export function differenceInCalendarISOWeekYears( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarISOWeekYears( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarISOWeekYearsOptions | undefined, ): number { - return getISOWeekYear(dateLeft) - getISOWeekYear(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return getISOWeekYear(laterDate_, options) - getISOWeekYear(earlierDate_, options); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarISOWeeks/index.ts b/src/date-fns/differenceInCalendarISOWeeks/index.ts index a3f693a..b6cf679 100644 --- a/src/date-fns/differenceInCalendarISOWeeks/index.ts +++ b/src/date-fns/differenceInCalendarISOWeeks/index.ts @@ -1,6 +1,17 @@ -import { millisecondsInWeek } from '../constants/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { millisecondsInWeek } from '../constants/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarISOWeeks} function options. + */ +export interface DifferenceInCalendarISOWeeksOptions extends ContextOptions {} /** * @name differenceInCalendarISOWeeks @@ -12,10 +23,9 @@ import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMill * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of calendar ISO weeks * @@ -23,16 +33,19 @@ import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMill * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? * const result = differenceInCalendarISOWeeks( * new Date(2014, 6, 21), - * new Date(2014, 6, 6) - * ) + * new Date(2014, 6, 6), + * ); * //=> 3 */ -export function differenceInCalendarISOWeeks( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarISOWeeks( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarISOWeeksOptions | undefined, ): number { - const startOfISOWeekLeft = startOfISOWeek(dateLeft); - const startOfISOWeekRight = startOfISOWeek(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + + const startOfISOWeekLeft = startOfISOWeek(laterDate_); + const startOfISOWeekRight = startOfISOWeek(earlierDate_); const timestampLeft = +startOfISOWeekLeft - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft); const timestampRight = +startOfISOWeekRight - getTimezoneOffsetInMilliseconds(startOfISOWeekRight); @@ -42,3 +55,5 @@ export function differenceInCalendarISOWeeks( // the daylight saving time clock shift). return Math.round((timestampLeft - timestampRight) / millisecondsInWeek); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarMonths/index.ts b/src/date-fns/differenceInCalendarMonths/index.ts index 8a34372..8fe88f9 100644 --- a/src/date-fns/differenceInCalendarMonths/index.ts +++ b/src/date-fns/differenceInCalendarMonths/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarMonths} function options. + */ +export interface DifferenceInCalendarMonthsOptions extends ContextOptions {} /** * @name differenceInCalendarMonths @@ -8,10 +18,9 @@ import { toDate } from '../toDate/index'; * @description * Get the number of calendar months between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of calendar months * @@ -23,15 +32,17 @@ import { toDate } from '../toDate/index'; * ) * //=> 8 */ -export function differenceInCalendarMonths( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarMonths( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarMonthsOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); - const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear(); - const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth(); + const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); + const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth(); - return yearDiff * 12 + monthDiff; + return yearsDiff * 12 + monthsDiff; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarQuarters/index.ts b/src/date-fns/differenceInCalendarQuarters/index.ts index b020e86..65c34d1 100644 --- a/src/date-fns/differenceInCalendarQuarters/index.ts +++ b/src/date-fns/differenceInCalendarQuarters/index.ts @@ -1,5 +1,15 @@ -import { getQuarter } from '../getQuarter/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { getQuarter } from '../getQuarter/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarQuarters} function options. + */ +export interface DifferenceInCalendarQuartersOptions extends ContextOptions {} /** * @name differenceInCalendarQuarters @@ -9,11 +19,10 @@ import { toDate } from '../toDate/index'; * @description * Get the number of calendar quarters between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * - * @param dateLeft - The later date - * @param dateRight - The earlier date - * @returns The number of calendar quarters * * @example @@ -24,15 +33,17 @@ import { toDate } from '../toDate/index'; * ) * //=> 3 */ -export function differenceInCalendarQuarters( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarQuarters( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarQuartersOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); - const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear(); - const quarterDiff = getQuarter(_dateLeft) - getQuarter(_dateRight); + const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); + const quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_); - return yearDiff * 4 + quarterDiff; + return yearsDiff * 4 + quartersDiff; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarWeeks/index.ts b/src/date-fns/differenceInCalendarWeeks/index.ts index 10cebdf..dabfd4f 100644 --- a/src/date-fns/differenceInCalendarWeeks/index.ts +++ b/src/date-fns/differenceInCalendarWeeks/index.ts @@ -1,12 +1,20 @@ -import { millisecondsInWeek } from '../constants/index'; -import { startOfWeek } from '../startOfWeek/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { millisecondsInWeek } from '../constants/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link differenceInCalendarWeeks} function options. */ -export interface DifferenceInCalendarWeeksOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface DifferenceInCalendarWeeksOptions + extends LocalizedOptions<'options'>, + WeekOptions, + ContextOptions {} /** * @name differenceInCalendarWeeks @@ -16,10 +24,8 @@ export interface DifferenceInCalendarWeeksOptions extends LocalizedOptions<'opti * @description * Get the number of calendar weeks between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * @param options - An object with options. * * @returns The number of calendar weeks @@ -42,19 +48,20 @@ export interface DifferenceInCalendarWeeksOptions extends LocalizedOptions<'opti * ) * //=> 2 */ -export function differenceInCalendarWeeks( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, - options?: DifferenceInCalendarWeeksOptions, +export function differenceInCalendarWeeks( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarWeeksOptions | undefined, ): number { - const startOfWeekLeft = startOfWeek(dateLeft, options); - const startOfWeekRight = startOfWeek(dateRight, options); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); - const timestampLeft = +startOfWeekLeft - getTimezoneOffsetInMilliseconds(startOfWeekLeft); - const timestampRight = +startOfWeekRight - getTimezoneOffsetInMilliseconds(startOfWeekRight); + const laterStartOfWeek = startOfWeek(laterDate_, options); + const earlierStartOfWeek = startOfWeek(earlierDate_, options); - // Round the number of days to the nearest integer because the number of - // milliseconds in a days is not constant (e.g. it's different in the week of - // the daylight saving time clock shift). - return Math.round((timestampLeft - timestampRight) / millisecondsInWeek); + const laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek); + const earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek); + + return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInCalendarYears/index.ts b/src/date-fns/differenceInCalendarYears/index.ts index 34ef33e..3b638e9 100644 --- a/src/date-fns/differenceInCalendarYears/index.ts +++ b/src/date-fns/differenceInCalendarYears/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInCalendarYears} function options. + */ +export interface DifferenceInCalendarYearsOptions extends ContextOptions {} /** * @name differenceInCalendarYears @@ -8,10 +18,9 @@ import { toDate } from '../toDate/index'; * @description * Get the number of calendar years between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * @returns The number of calendar years * @@ -20,15 +29,16 @@ import { toDate } from '../toDate/index'; * const result = differenceInCalendarYears( * new Date(2015, 1, 11), * new Date(2013, 11, 31) - * ) + * ); * //=> 2 */ -export function differenceInCalendarYears( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInCalendarYears( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInCalendarYearsOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); - - return _dateLeft.getFullYear() - _dateRight.getFullYear(); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return laterDate_.getFullYear() - earlierDate_.getFullYear(); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInDays/index.ts b/src/date-fns/differenceInDays/index.ts index 88b1bf6..68b10ef 100644 --- a/src/date-fns/differenceInDays/index.ts +++ b/src/date-fns/differenceInDays/index.ts @@ -1,5 +1,15 @@ -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInDays} function options. + */ +export interface DifferenceInDaysOptions extends ContextOptions {} /** * @name differenceInDays @@ -17,10 +27,9 @@ import { toDate } from '../toDate/index'; * To ignore DST and only measure exact 24-hour periods, use this instead: * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of full days according to the local timezone * @@ -55,21 +64,22 @@ import { toDate } from '../toDate/index'; * ) * //=> 92 */ -export function differenceInDays( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInDays( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInDaysOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); - const sign = compareLocalAsc(_dateLeft, _dateRight); - const difference = Math.abs(differenceInCalendarDays(_dateLeft, _dateRight)); + const sign = compareLocalAsc(laterDate_, earlierDate_); + const difference = Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)); - _dateLeft.setDate(_dateLeft.getDate() - sign * difference); + laterDate_.setDate(laterDate_.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full // If so, result must be decreased by 1 in absolute value - const isLastDayNotFull = Number(compareLocalAsc(_dateLeft, _dateRight) === -sign); + const isLastDayNotFull = Number(compareLocalAsc(laterDate_, earlierDate_) === -sign); + const result = sign * (difference - isLastDayNotFull); // Prevent negative zero return result === 0 ? 0 : result; @@ -79,22 +89,21 @@ export function differenceInDays( // for accurate equality comparisons of UTC timestamps that end up // having the same representation in local time, e.g. one hour before // DST ends vs. the instant that DST ends. -function compareLocalAsc(dateLeft: DateType, dateRight: DateType): number { +function compareLocalAsc(laterDate: Date, earlierDate: Date): number { const diff = - dateLeft.getFullYear() - dateRight.getFullYear() || - dateLeft.getMonth() - dateRight.getMonth() || - dateLeft.getDate() - dateRight.getDate() || - dateLeft.getHours() - dateRight.getHours() || - dateLeft.getMinutes() - dateRight.getMinutes() || - dateLeft.getSeconds() - dateRight.getSeconds() || - dateLeft.getMilliseconds() - dateRight.getMilliseconds(); + laterDate.getFullYear() - earlierDate.getFullYear() || + laterDate.getMonth() - earlierDate.getMonth() || + laterDate.getDate() - earlierDate.getDate() || + laterDate.getHours() - earlierDate.getHours() || + laterDate.getMinutes() - earlierDate.getMinutes() || + laterDate.getSeconds() - earlierDate.getSeconds() || + laterDate.getMilliseconds() - earlierDate.getMilliseconds(); - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - // Return 0 if diff is 0; return NaN if diff is NaN - } else { - return diff; - } + if (diff < 0) return -1; + if (diff > 0) return 1; + + // Return 0 if diff is 0; return NaN if diff is NaN + return diff; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInHours/index.ts b/src/date-fns/differenceInHours/index.ts index 7cbba50..7570ab5 100644 --- a/src/date-fns/differenceInHours/index.ts +++ b/src/date-fns/differenceInHours/index.ts @@ -1,12 +1,16 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { millisecondsInHour } from '../constants/index'; -import { differenceInMilliseconds } from '../differenceInMilliseconds/index'; -import type { RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { millisecondsInHour } from '../constants/index.ts'; +import type { ContextOptions, DateArg, RoundingOptions } from '../types.ts'; /** * The {@link differenceInHours} function options. */ -export interface DifferenceInHoursOptions extends RoundingOptions {} +export interface DifferenceInHoursOptions extends RoundingOptions, ContextOptions {} /** * @name differenceInHours @@ -16,10 +20,8 @@ export interface DifferenceInHoursOptions extends RoundingOptions {} * @description * Get the number of hours between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * @param options - An object with options. * * @returns The number of hours @@ -32,11 +34,14 @@ export interface DifferenceInHoursOptions extends RoundingOptions {} * ) * //=> 12 */ -export function differenceInHours( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInHours( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: DifferenceInHoursOptions, ): number { - const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour; + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour; return getRoundingMethod(options?.roundingMethod)(diff); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInISOWeekYears/index.ts b/src/date-fns/differenceInISOWeekYears/index.ts index 9426285..02c4fa9 100644 --- a/src/date-fns/differenceInISOWeekYears/index.ts +++ b/src/date-fns/differenceInISOWeekYears/index.ts @@ -1,7 +1,17 @@ -import { compareAsc } from '../compareAsc/index'; -import { differenceInCalendarISOWeekYears } from '../differenceInCalendarISOWeekYears/index'; -import { subISOWeekYears } from '../subISOWeekYears/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { compareAsc } from '../compareAsc/index.ts'; +import { differenceInCalendarISOWeekYears } from '../differenceInCalendarISOWeekYears/index.ts'; +import { subISOWeekYears } from '../subISOWeekYears/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInISOWeekYears} function options. + */ +export interface DifferenceInISOWeekYearsOptions extends ContextOptions {} /** * @name differenceInISOWeekYears @@ -13,10 +23,9 @@ import { toDate } from '../toDate/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - The options * * @returns The number of full ISO week-numbering years * @@ -26,24 +35,25 @@ import { toDate } from '../toDate/index'; * new Date(2012, 0, 1), * new Date(2010, 0, 1) * ) - * //=> 1 + * // => 1 */ -export function differenceInISOWeekYears( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInISOWeekYears( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInISOWeekYearsOptions | undefined, ): number { - let _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); - - const sign = compareAsc(_dateLeft, _dateRight); - const difference = Math.abs(differenceInCalendarISOWeekYears(_dateLeft, _dateRight)); - _dateLeft = subISOWeekYears(_dateLeft, sign * difference); - - // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1 - // if last calendar ISO year is not full - // If so, result must be decreased by 1 in absolute value - const isLastISOWeekYearNotFull = Number(compareAsc(_dateLeft, _dateRight) === -sign); - const result = sign * (difference - isLastISOWeekYearNotFull); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + + const sign = compareAsc(laterDate_, earlierDate_); + const diff = Math.abs(differenceInCalendarISOWeekYears(laterDate_, earlierDate_, options)); + + const adjustedDate = subISOWeekYears(laterDate_, sign * diff, options); + + const isLastISOWeekYearNotFull = Number(compareAsc(adjustedDate, earlierDate_) === -sign); + const result = sign * (diff - isLastISOWeekYearNotFull); + // Prevent negative zero return result === 0 ? 0 : result; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInMilliseconds/index.ts b/src/date-fns/differenceInMilliseconds/index.ts index f339c4f..ce6f0ea 100644 --- a/src/date-fns/differenceInMilliseconds/index.ts +++ b/src/date-fns/differenceInMilliseconds/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name differenceInMilliseconds @@ -8,10 +13,8 @@ import { toDate } from '../toDate/index'; * @description * Get the number of milliseconds between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * * @returns The number of milliseconds * @@ -24,9 +27,8 @@ import { toDate } from '../toDate/index'; * ) * //=> 1100 */ -export function differenceInMilliseconds( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, -): number { - return +toDate(dateLeft) - +toDate(dateRight); +export function differenceInMilliseconds(laterDate: DateArg & {}, earlierDate: DateArg & {}): number { + return +toDate(laterDate) - +toDate(earlierDate); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInMinutes/index.ts b/src/date-fns/differenceInMinutes/index.ts index 81a9f71..fe71185 100644 --- a/src/date-fns/differenceInMinutes/index.ts +++ b/src/date-fns/differenceInMinutes/index.ts @@ -1,7 +1,11 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { millisecondsInMinute } from '../constants/index'; -import { differenceInMilliseconds } from '../differenceInMilliseconds/index'; -import type { RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { millisecondsInMinute } from '../constants/index.ts'; +import { differenceInMilliseconds } from '../differenceInMilliseconds/index.ts'; +import type { DateArg, RoundingOptions } from '../types.ts'; /** * The {@link differenceInMinutes} function options. @@ -16,8 +20,6 @@ export interface DifferenceInMinutesOptions extends RoundingOptions {} * @description * Get the signed number of full (rounded towards 0) minutes between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateLeft - The later date * @param dateRight - The earlier date * @param options - An object with options. @@ -40,11 +42,13 @@ export interface DifferenceInMinutesOptions extends RoundingOptions {} * ) * //=> -1 */ -export function differenceInMinutes( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInMinutes( + dateLeft: DateArg & {}, + dateRight: DateArg & {}, options?: DifferenceInMinutesOptions, ): number { const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute; return getRoundingMethod(options?.roundingMethod)(diff); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInMonths/index.ts b/src/date-fns/differenceInMonths/index.ts index 9452175..02c8d24 100644 --- a/src/date-fns/differenceInMonths/index.ts +++ b/src/date-fns/differenceInMonths/index.ts @@ -1,20 +1,26 @@ -import { compareAsc } from '../compareAsc/index'; -import { differenceInCalendarMonths } from '../differenceInCalendarMonths/index'; -import { isLastDayOfMonth } from '../isLastDayOfMonth/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { compareAsc } from '../compareAsc/index.ts'; +import { differenceInCalendarMonths } from '../differenceInCalendarMonths/index.ts'; +import { isLastDayOfMonth } from '../isLastDayOfMonth/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInMonths} function options. + */ +export interface DifferenceInMonthsOptions extends ContextOptions {} /** * @name differenceInMonths * @category Month Helpers * @summary Get the number of full months between the given dates. * - * @description - * Get the number of full months between the given dates using trunc as a default rounding method. - * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of full months * @@ -23,41 +29,30 @@ import { toDate } from '../toDate/index'; * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) * //=> 7 */ -export function differenceInMonths( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInMonths( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInMonthsOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); - - const sign = compareAsc(_dateLeft, _dateRight); - const difference = Math.abs(differenceInCalendarMonths(_dateLeft, _dateRight)); - let result; - - // Check for the difference of less than month - if (difference < 1) { - result = 0; - } else { - if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) { - // This will check if the date is end of Feb and assign a higher end of month date - // to compare it with Jan - _dateLeft.setDate(30); - } - - _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference); - - // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full - // If so, result must be decreased by 1 in absolute value - let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign; - - // Check for cases of one full calendar month - if (isLastDayOfMonth(toDate(dateLeft)) && difference === 1 && compareAsc(dateLeft, _dateRight) === 1) { - isLastMonthNotFull = false; - } - - result = sign * (difference - Number(isLastMonthNotFull)); + const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(options?.in, laterDate, laterDate, earlierDate); + + const sign = compareAsc(workingLaterDate, earlierDate_); + const difference = Math.abs(differenceInCalendarMonths(workingLaterDate, earlierDate_)); + + if (difference < 1) return 0; + + if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27) workingLaterDate.setDate(30); + + workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference); + + let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign; + + if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) { + isLastMonthNotFull = false; } - // Prevent negative zero + const result = sign * (difference - +isLastMonthNotFull); return result === 0 ? 0 : result; } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInQuarters/index.ts b/src/date-fns/differenceInQuarters/index.ts index 9ac98dc..ef05dd4 100644 --- a/src/date-fns/differenceInQuarters/index.ts +++ b/src/date-fns/differenceInQuarters/index.ts @@ -1,11 +1,15 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { differenceInMonths } from '../differenceInMonths/index'; -import type { RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { differenceInMonths } from '../differenceInMonths/index.ts'; +import type { ContextOptions, DateArg, RoundingOptions } from '../types.ts'; /** * The {@link differenceInQuarters} function options. */ -export interface DifferenceInQuartersOptions extends RoundingOptions {} +export interface DifferenceInQuartersOptions extends RoundingOptions, ContextOptions {} /** * @name differenceInQuarters @@ -15,10 +19,8 @@ export interface DifferenceInQuartersOptions extends RoundingOptions {} * @description * Get the number of quarters between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * @param options - An object with options. * * @returns The number of full quarters @@ -28,11 +30,13 @@ export interface DifferenceInQuartersOptions extends RoundingOptions {} * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) * //=> 2 */ -export function differenceInQuarters( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, - options?: DifferenceInQuartersOptions, +export function differenceInQuarters( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInQuartersOptions | undefined, ): number { - const diff = differenceInMonths(dateLeft, dateRight) / 3; + const diff = differenceInMonths(laterDate, earlierDate, options) / 3; return getRoundingMethod(options?.roundingMethod)(diff); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInSeconds/index.ts b/src/date-fns/differenceInSeconds/index.ts index 8c7c801..eb8859c 100644 --- a/src/date-fns/differenceInSeconds/index.ts +++ b/src/date-fns/differenceInSeconds/index.ts @@ -1,6 +1,10 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { differenceInMilliseconds } from '../differenceInMilliseconds/index'; -import type { RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { differenceInMilliseconds } from '../differenceInMilliseconds/index.ts'; +import type { DateArg, RoundingOptions } from '../types.ts'; /** * The {@link differenceInSeconds} function options. @@ -15,10 +19,8 @@ export interface DifferenceInSecondsOptions extends RoundingOptions {} * @description * Get the number of seconds between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * @param options - An object with options. * * @returns The number of seconds @@ -32,11 +34,13 @@ export interface DifferenceInSecondsOptions extends RoundingOptions {} * ) * //=> 12 */ -export function differenceInSeconds( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInSeconds( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: DifferenceInSecondsOptions, ): number { - const diff = differenceInMilliseconds(dateLeft, dateRight) / 1000; + const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000; return getRoundingMethod(options?.roundingMethod)(diff); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInWeeks/index.ts b/src/date-fns/differenceInWeeks/index.ts index 8ffda89..4719703 100644 --- a/src/date-fns/differenceInWeeks/index.ts +++ b/src/date-fns/differenceInWeeks/index.ts @@ -1,11 +1,15 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { differenceInDays } from '../differenceInDays/index'; -import type { RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { differenceInDays } from '../differenceInDays/index.ts'; +import type { ContextOptions, DateArg, RoundingOptions } from '../types.ts'; /** * The {@link differenceInWeeks} function options. */ -export interface DifferenceInWeeksOptions extends RoundingOptions {} +export interface DifferenceInWeeksOptions extends RoundingOptions, ContextOptions {} /** * @name differenceInWeeks @@ -23,10 +27,8 @@ export interface DifferenceInWeeksOptions extends RoundingOptions {} * To ignore DST and only measure exact 7*24-hour periods, use this instead: * `Math.trunc(differenceInHours(dateLeft, dateRight)/(7*24))|0`. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date * @param options - An object with options * * @returns The number of full weeks @@ -49,11 +51,13 @@ export interface DifferenceInWeeksOptions extends RoundingOptions {} * ) * //=> 8 */ -export function differenceInWeeks( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, - options?: DifferenceInWeeksOptions, +export function differenceInWeeks( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInWeeksOptions | undefined, ): number { - const diff = differenceInDays(dateLeft, dateRight) / 7; + const diff = differenceInDays(laterDate, earlierDate, options) / 7; return getRoundingMethod(options?.roundingMethod)(diff); } + +/* eslint-enable */ diff --git a/src/date-fns/differenceInYears/index.ts b/src/date-fns/differenceInYears/index.ts index 7b784cb..54e5ab9 100644 --- a/src/date-fns/differenceInYears/index.ts +++ b/src/date-fns/differenceInYears/index.ts @@ -1,6 +1,16 @@ -import { compareAsc } from '../compareAsc/index'; -import { differenceInCalendarYears } from '../differenceInCalendarYears/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { compareAsc } from '../compareAsc/index.ts'; +import { differenceInCalendarYears } from '../differenceInCalendarYears/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link differenceInYears} function options. + */ +export interface DifferenceInYearsOptions extends ContextOptions {} /** * @name differenceInYears @@ -10,10 +20,9 @@ import { toDate } from '../toDate/index'; * @description * Get the number of full years between the given dates. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The later date - * @param dateRight - The earlier date + * @param laterDate - The later date + * @param earlierDate - The earlier date + * @param options - An object with options * * @returns The number of full years * @@ -22,26 +31,38 @@ import { toDate } from '../toDate/index'; * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) * //=> 1 */ -export function differenceInYears( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function differenceInYears( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: DifferenceInYearsOptions | undefined, ): number { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + + // -1 if the left date is earlier than the right date + // 2023-12-31 - 2024-01-01 = -1 + const sign = compareAsc(laterDate_, earlierDate_); - const sign = compareAsc(_dateLeft, _dateRight); - const difference = Math.abs(differenceInCalendarYears(_dateLeft, _dateRight)); + // First calculate the difference in calendar years + // 2024-01-01 - 2023-12-31 = 1 year + const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_)); - // Set both dates to a valid leap year for accurate comparison when dealing - // with leap days - _dateLeft.setFullYear(1584); - _dateRight.setFullYear(1584); + // Now we need to calculate if the difference is full. To do that we set + // both dates to the same year and check if the both date's month and day + // form a full year. + laterDate_.setFullYear(1584); + earlierDate_.setFullYear(1584); - // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full - // If so, result must be decreased by 1 in absolute value - const isLastYearNotFull = compareAsc(_dateLeft, _dateRight) === -sign; - const result = sign * (difference - +isLastYearNotFull); + // For it to be true, when the later date is indeed later than the earlier date + // (2026-02-01 - 2023-12-10 = 3 years), the difference is full if + // the normalized later date is also later than the normalized earlier date. + // In our example, 1584-02-01 is earlier than 1584-12-10, so the difference + // is partial, hence we need to subtract 1 from the difference 3 - 1 = 2. + const partial = compareAsc(laterDate_, earlierDate_) === -sign; + + const result = sign * (diff - +partial); // Prevent negative zero return result === 0 ? 0 : result; } + +/* eslint-enable */ diff --git a/src/date-fns/eachDayOfInterval/index.ts b/src/date-fns/eachDayOfInterval/index.ts index 0d4596f..5c0df11 100644 --- a/src/date-fns/eachDayOfInterval/index.ts +++ b/src/date-fns/eachDayOfInterval/index.ts @@ -1,10 +1,34 @@ -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachDayOfInterval} function options. */ -export interface EachDayOfIntervalOptions extends StepOptions {} +export interface EachDayOfIntervalOptions extends StepOptions, ContextOptions {} + +/** + * The {@link eachDayOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type EachDayOfIntervalResult< + IntervalType extends Interval, + Options extends EachDayOfIntervalOptions | undefined, +> = Array< + Options extends EachDayOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachDayOfInterval @@ -14,7 +38,8 @@ export interface EachDayOfIntervalOptions extends StepOptions {} * @description * Return the array of dates within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The interval. * @param options - An object with options. @@ -35,17 +60,16 @@ export interface EachDayOfIntervalOptions extends StepOptions {} * // Fri Oct 10 2014 00:00:00 * // ] */ -export function eachDayOfInterval( - interval: Interval, - options?: EachDayOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachDayOfInterval< + IntervalType extends Interval, + Options extends EachDayOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachDayOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); let step = options?.step ?? 1; if (!step) return []; @@ -54,13 +78,15 @@ export function eachDayOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachDayOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate.setDate(currentDate.getDate() + step); - currentDate.setHours(0, 0, 0, 0); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date.setDate(date.getDate() + step); + date.setHours(0, 0, 0, 0); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachHourOfInterval/index.ts b/src/date-fns/eachHourOfInterval/index.ts index cf4d97b..d44e50e 100644 --- a/src/date-fns/eachHourOfInterval/index.ts +++ b/src/date-fns/eachHourOfInterval/index.ts @@ -1,11 +1,34 @@ -import { addHours } from '../addHours/index'; -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachHourOfInterval} function options. */ -export interface EachHourOfIntervalOptions extends StepOptions {} +export interface EachHourOfIntervalOptions + extends StepOptions, + ContextOptions {} + +/** + * The {@link eachHourOfInterval} function result type. + * Resolves to the appropriate date type based on inputs. + */ +export type EachHourOfIntervalResult< + IntervalType extends Interval, + Options extends EachHourOfIntervalOptions | undefined, +> = Array< + Options extends EachHourOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachHourOfInterval @@ -15,7 +38,8 @@ export interface EachHourOfIntervalOptions extends StepOptions {} * @description * Return the array of hours within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The interval. * @param options - An object with options. @@ -27,7 +51,7 @@ export interface EachHourOfIntervalOptions extends StepOptions {} * const result = eachHourOfInterval({ * start: new Date(2014, 9, 6, 12), * end: new Date(2014, 9, 6, 15) - * }) + * }); * //=> [ * // Mon Oct 06 2014 12:00:00, * // Mon Oct 06 2014 13:00:00, @@ -35,17 +59,16 @@ export interface EachHourOfIntervalOptions extends StepOptions {} * // Mon Oct 06 2014 15:00:00 * // ] */ -export function eachHourOfInterval( - interval: Interval, - options?: EachHourOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachHourOfInterval< + IntervalType extends Interval, + Options extends EachHourOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachHourOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - let currentDate = reversed ? endDate : startDate; - currentDate.setMinutes(0, 0, 0); + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setMinutes(0, 0, 0); let step = options?.step ?? 1; if (!step) return []; @@ -54,12 +77,14 @@ export function eachHourOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachHourOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate = addHours(currentDate, step); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date.setHours(date.getHours() + step); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachMinuteOfInterval/index.ts b/src/date-fns/eachMinuteOfInterval/index.ts index 76c59e7..e90dde5 100644 --- a/src/date-fns/eachMinuteOfInterval/index.ts +++ b/src/date-fns/eachMinuteOfInterval/index.ts @@ -1,12 +1,37 @@ -import { addMinutes } from '../addMinutes/index'; -import { startOfMinute } from '../startOfMinute/index'; -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { addMinutes } from '../addMinutes/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachMinuteOfInterval} function options. */ -export interface EachMinuteOfIntervalOptions extends StepOptions {} +export interface EachMinuteOfIntervalOptions + extends StepOptions, + ContextOptions {} + +/** + * The {@link eachMinuteOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type EachMinuteOfIntervalResult< + IntervalType extends Interval, + Options extends EachMinuteOfIntervalOptions | undefined, +> = Array< + Options extends EachMinuteOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachMinuteOfInterval @@ -16,7 +41,8 @@ export interface EachMinuteOfIntervalOptions extends StepOptions {} * @description * Returns the array of minutes within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The interval. * @param options - An object with options. @@ -36,16 +62,17 @@ export interface EachMinuteOfIntervalOptions extends StepOptions {} * // Wed Oct 14 2014 13:03:00 * // ] */ -export function eachMinuteOfInterval( - interval: Interval, - options?: EachMinuteOfIntervalOptions, -): DateType[] { - const startDate = startOfMinute(toDate(interval.start)); - const endDate = toDate(interval.end); +export function eachMinuteOfInterval< + IntervalType extends Interval, + Options extends EachMinuteOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachMinuteOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); + // Set to the start of the minute + start.setSeconds(0, 0); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - let currentDate = reversed ? endDate : startDate; + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + let date = reversed ? end : start; let step = options?.step ?? 1; if (!step) return []; @@ -54,12 +81,14 @@ export function eachMinuteOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachMinuteOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate = addMinutes(currentDate, step); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date = addMinutes(date, step); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachMonthOfInterval/index.ts b/src/date-fns/eachMonthOfInterval/index.ts index fd195fa..0d14855 100644 --- a/src/date-fns/eachMonthOfInterval/index.ts +++ b/src/date-fns/eachMonthOfInterval/index.ts @@ -1,10 +1,33 @@ -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachMonthOfInterval} function options. */ -export interface EachMonthOfIntervalOptions extends StepOptions {} +export interface EachMonthOfIntervalOptions + extends StepOptions, + ContextOptions {} + +/** + * The {@link eachMonthOfInterval} function result type. It resolves the proper data type. + */ +export type EachMonthOfIntervalResult< + IntervalType extends Interval, + Options extends EachMonthOfIntervalOptions | undefined, +> = Array< + Options extends EachMonthOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachMonthOfInterval @@ -14,9 +37,11 @@ export interface EachMonthOfIntervalOptions extends StepOptions {} * @description * Return the array of months within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * - * @param interval - The interval + * @param interval - The interval. + * @param options - An object with options. * * @returns The array with starts of months from the month of the interval start to the month of the interval end * @@ -36,18 +61,17 @@ export interface EachMonthOfIntervalOptions extends StepOptions {} * // Fri Aug 01 2014 00:00:00 * // ] */ -export function eachMonthOfInterval( - interval: Interval, - options?: EachMonthOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachMonthOfInterval< + IntervalType extends Interval, + Options extends EachMonthOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachMonthOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); - currentDate.setDate(1); + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); + date.setDate(1); let step = options?.step ?? 1; if (!step) return []; @@ -56,12 +80,14 @@ export function eachMonthOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachMonthOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate.setMonth(currentDate.getMonth() + step); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date.setMonth(date.getMonth() + step); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachQuarterOfInterval/index.ts b/src/date-fns/eachQuarterOfInterval/index.ts index 030770d..5b5dbff 100644 --- a/src/date-fns/eachQuarterOfInterval/index.ts +++ b/src/date-fns/eachQuarterOfInterval/index.ts @@ -1,12 +1,38 @@ -import { addQuarters } from '../addQuarters/index'; -import { startOfQuarter } from '../startOfQuarter/index'; -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { addQuarters } from '../addQuarters/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { startOfQuarter } from '../startOfQuarter/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachQuarterOfInterval} function options. */ -export interface EachQuarterOfIntervalOptions extends StepOptions {} +export interface EachQuarterOfIntervalOptions + extends StepOptions, + ContextOptions {} + +/** + * The {@link eachQuarterOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type EachQuarterOfIntervalResult< + IntervalType extends Interval, + Options extends EachQuarterOfIntervalOptions | undefined, +> = Array< + Options extends EachQuarterOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachQuarterOfInterval @@ -16,9 +42,11 @@ export interface EachQuarterOfIntervalOptions extends StepOptions {} * @description * Return the array of quarters within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The interval + * @param options - An object with options * * @returns The array with starts of quarters from the quarter of the interval start to the quarter of the interval end * @@ -26,7 +54,7 @@ export interface EachQuarterOfIntervalOptions extends StepOptions {} * // Each quarter within interval 6 February 2014 - 10 August 2014: * const result = eachQuarterOfInterval({ * start: new Date(2014, 1, 6), - * end: new Date(2014, 7, 10) + * end: new Date(2014, 7, 10), * }) * //=> [ * // Wed Jan 01 2014 00:00:00, @@ -34,16 +62,15 @@ export interface EachQuarterOfIntervalOptions extends StepOptions {} * // Tue Jul 01 2014 00:00:00, * // ] */ -export function eachQuarterOfInterval( - interval: Interval, - options?: EachQuarterOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachQuarterOfInterval< + IntervalType extends Interval, + Options extends EachQuarterOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachQuarterOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startOfQuarter(startDate) : +startOfQuarter(endDate); - let currentDate = reversed ? startOfQuarter(endDate) : startOfQuarter(startDate); + let reversed = +start > +end; + const endTime = reversed ? +startOfQuarter(start) : +startOfQuarter(end); + let date = reversed ? startOfQuarter(end) : startOfQuarter(start); let step = options?.step ?? 1; if (!step) return []; @@ -52,12 +79,14 @@ export function eachQuarterOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachQuarterOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate = addQuarters(currentDate, step); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date = addQuarters(date, step); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachWeekOfInterval/index.ts b/src/date-fns/eachWeekOfInterval/index.ts index 3763953..c2e6b77 100644 --- a/src/date-fns/eachWeekOfInterval/index.ts +++ b/src/date-fns/eachWeekOfInterval/index.ts @@ -1,12 +1,39 @@ -import { addWeeks } from '../addWeeks/index'; -import { startOfWeek } from '../startOfWeek/index'; -import { toDate } from '../toDate/index'; -import type { Interval, LocalizedOptions, StepOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { addWeeks } from '../addWeeks/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import type { ContextOptions, Interval, LocalizedOptions, StepOptions, WeekOptions } from '../types.ts'; /** * The {@link eachWeekOfInterval} function options. */ -export interface EachWeekOfIntervalOptions extends StepOptions, WeekOptions, LocalizedOptions<'options'> {} +export interface EachWeekOfIntervalOptions + extends StepOptions, + WeekOptions, + LocalizedOptions<'options'>, + ContextOptions {} + +/** + * The {@link eachWeekOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the interval start date, + * then the end interval date. If a context function is passed, it uses the context function return type. + */ +export type EachWeekOfIntervalResult< + IntervalType extends Interval, + Options extends EachWeekOfIntervalOptions | undefined, +> = Array< + Options extends EachWeekOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachWeekOfInterval @@ -16,8 +43,6 @@ export interface EachWeekOfIntervalOptions extends StepOptions, WeekOptions, Loc * @description * Return the array of weeks within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param interval - The interval. * @param options - An object with options. * @@ -40,18 +65,16 @@ export interface EachWeekOfIntervalOptions extends StepOptions, WeekOptions, Loc * // Sun Nov 23 2014 00:00:00 * // ] */ -export function eachWeekOfInterval( - interval: Interval, - options?: EachWeekOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachWeekOfInterval< + IntervalType extends Interval, + Options extends EachWeekOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachWeekOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const startDateWeek = reversed ? startOfWeek(endDate, options) : startOfWeek(startDate, options); - const endDateWeek = reversed ? startOfWeek(startDate, options) : startOfWeek(endDate, options); + let reversed = +start > +end; + const startDateWeek = reversed ? startOfWeek(end, options) : startOfWeek(start, options); + const endDateWeek = reversed ? startOfWeek(start, options) : startOfWeek(end, options); - // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet startDateWeek.setHours(15); endDateWeek.setHours(15); @@ -65,14 +88,16 @@ export function eachWeekOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachWeekOfIntervalResult = []; while (+currentDate <= endTime) { currentDate.setHours(0); - dates.push(toDate(currentDate)); + dates.push(constructFrom(start, currentDate)); currentDate = addWeeks(currentDate, step); currentDate.setHours(15); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/eachWeekendOfInterval/index.ts b/src/date-fns/eachWeekendOfInterval/index.ts index c6e5d2d..d7580d2 100644 --- a/src/date-fns/eachWeekendOfInterval/index.ts +++ b/src/date-fns/eachWeekendOfInterval/index.ts @@ -1,6 +1,33 @@ -import { eachDayOfInterval } from '../eachDayOfInterval/index'; -import { isWeekend } from '../isWeekend/index'; -import type { Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { eachDayOfInterval } from '../eachDayOfInterval/index.ts'; +import { isWeekend } from '../isWeekend/index.ts'; +import type { ContextOptions, Interval } from '../types.ts'; + +/** + * The {@link eachWeekendOfInterval} function options. + */ +export interface EachWeekendOfIntervalOptions extends ContextOptions {} + +/** + * The {@link eachWeekendOfInterval} function result type. + */ +export type EachWeekendOfIntervalResult< + IntervalType extends Interval, + Options extends EachWeekendOfIntervalOptions | undefined, +> = Array< + Options extends EachWeekendOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachWeekendOfInterval @@ -10,9 +37,11 @@ import type { Interval } from '../types'; * @description * Get all the Saturdays and Sundays in the given date interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The given interval + * @param options - An object with options * * @returns An array containing all the Saturdays and Sundays * @@ -29,13 +58,19 @@ import type { Interval } from '../types'; * // Sun Sep 30 2018 00:00:00 * // ] */ -export function eachWeekendOfInterval(interval: Interval): DateType[] { - const dateInterval = eachDayOfInterval(interval); - const weekends = []; +export function eachWeekendOfInterval< + IntervalType extends Interval, + Options extends EachWeekendOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachWeekendOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); + const dateInterval = eachDayOfInterval({ start, end }, options); + const weekends: EachWeekendOfIntervalResult = []; let index = 0; while (index < dateInterval.length) { const date = dateInterval[index++]; - if (isWeekend(date!)) weekends.push(date!); + if (isWeekend(date)) weekends.push(constructFrom(start, date)); } return weekends; } + +/* eslint-enable */ diff --git a/src/date-fns/eachWeekendOfMonth/index.ts b/src/date-fns/eachWeekendOfMonth/index.ts index 522d8c1..d2322e6 100644 --- a/src/date-fns/eachWeekendOfMonth/index.ts +++ b/src/date-fns/eachWeekendOfMonth/index.ts @@ -1,6 +1,16 @@ -import { eachWeekendOfInterval } from '../eachWeekendOfInterval/index'; -import { endOfMonth } from '../endOfMonth/index'; -import { startOfMonth } from '../startOfMonth/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { eachWeekendOfInterval } from '../eachWeekendOfInterval/index.ts'; +import { endOfMonth } from '../endOfMonth/index.ts'; +import { startOfMonth } from '../startOfMonth/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link eachWeekendOfMonth} function options. + */ +export interface EachWeekendOfMonthOptions extends ContextOptions {} /** * @name eachWeekendOfMonth @@ -11,8 +21,10 @@ import { startOfMonth } from '../startOfMonth/index'; * Get all the Saturdays and Sundays in the given month. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The given month + * @param options - An object with options * * @returns An array containing all the Saturdays and Sundays * @@ -30,8 +42,13 @@ import { startOfMonth } from '../startOfMonth/index'; * // Sun Feb 27 2022 00:00:00 * // ] */ -export function eachWeekendOfMonth(date: DateType): DateType[] { - const start = startOfMonth(date); - const end = endOfMonth(date); - return eachWeekendOfInterval({ start, end }); +export function eachWeekendOfMonth( + date: DateArg, + options?: EachWeekendOfMonthOptions, +): ResultDate[] { + const start = startOfMonth(date, options); + const end = endOfMonth(date, options); + return eachWeekendOfInterval({ start, end }, options); } + +/* eslint-enable */ diff --git a/src/date-fns/eachWeekendOfYear/index.ts b/src/date-fns/eachWeekendOfYear/index.ts index 9f18649..273bd90 100644 --- a/src/date-fns/eachWeekendOfYear/index.ts +++ b/src/date-fns/eachWeekendOfYear/index.ts @@ -1,6 +1,16 @@ -import { eachWeekendOfInterval } from '../eachWeekendOfInterval/index'; -import { endOfYear } from '../endOfYear/index'; -import { startOfYear } from '../startOfYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { eachWeekendOfInterval } from '../eachWeekendOfInterval/index.ts'; +import { endOfYear } from '../endOfYear/index.ts'; +import { startOfYear } from '../startOfYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link eachWeekendOfYear} function options. + */ +export interface EachWeekendOfYearOptions extends ContextOptions {} /** * @name eachWeekendOfYear @@ -11,8 +21,10 @@ import { startOfYear } from '../startOfYear/index'; * Get all the Saturdays and Sundays in the year. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The given year + * @param options - An object with options * * @returns An array containing all the Saturdays and Sundays * @@ -27,8 +39,13 @@ import { startOfYear } from '../startOfYear/index'; * // ] * ] */ -export function eachWeekendOfYear(date: DateType | number | string): DateType[] { - const start = startOfYear(date); - const end = endOfYear(date); - return eachWeekendOfInterval({ start, end }); +export function eachWeekendOfYear( + date: DateArg, + options?: EachWeekendOfYearOptions, +): ResultDate[] { + const start = startOfYear(date, options); + const end = endOfYear(date, options); + return eachWeekendOfInterval({ start, end }, options); } + +/* eslint-enable */ diff --git a/src/date-fns/eachYearOfInterval/index.ts b/src/date-fns/eachYearOfInterval/index.ts index 921181a..c023039 100644 --- a/src/date-fns/eachYearOfInterval/index.ts +++ b/src/date-fns/eachYearOfInterval/index.ts @@ -1,10 +1,36 @@ -import { toDate } from '../toDate/index'; -import type { Interval, StepOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextOptions, Interval, StepOptions } from '../types.ts'; /** * The {@link eachYearOfInterval} function options. */ -export interface EachYearOfIntervalOptions extends StepOptions {} +export interface EachYearOfIntervalOptions + extends StepOptions, + ContextOptions {} + +/** + * The {@link eachYearOfInterval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the date argument, + * then the start interval date, and finally the end interval date. If + * a context function is passed, it uses the context function return type. + */ +export type EachYearOfIntervalResult< + IntervalType extends Interval, + Options extends EachYearOfIntervalOptions | undefined, +> = Array< + Options extends EachYearOfIntervalOptions + ? DateType + : IntervalType['start'] extends Date + ? IntervalType['start'] + : IntervalType['end'] extends Date + ? IntervalType['end'] + : Date +>; /** * @name eachYearOfInterval @@ -14,9 +40,11 @@ export interface EachYearOfIntervalOptions extends StepOptions {} * @description * Return the array of yearly timestamps within the specified time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam IntervalType - Interval type. + * @typeParam Options - Options type. * * @param interval - The interval. + * @param options - An object with options. * * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end * @@ -33,18 +61,17 @@ export interface EachYearOfIntervalOptions extends StepOptions {} * // Sun Jan 01 2017 00:00:00 * // ] */ -export function eachYearOfInterval( - interval: Interval, - options?: EachYearOfIntervalOptions, -): DateType[] { - const startDate = toDate(interval.start); - const endDate = toDate(interval.end); +export function eachYearOfInterval< + IntervalType extends Interval, + Options extends EachYearOfIntervalOptions | undefined = undefined, +>(interval: IntervalType, options?: Options): EachYearOfIntervalResult { + const { start, end } = normalizeInterval(options?.in, interval); - let reversed = +startDate > +endDate; - const endTime = reversed ? +startDate : +endDate; - const currentDate = reversed ? endDate : startDate; - currentDate.setHours(0, 0, 0, 0); - currentDate.setMonth(0, 1); + let reversed = +start > +end; + const endTime = reversed ? +start : +end; + const date = reversed ? end : start; + date.setHours(0, 0, 0, 0); + date.setMonth(0, 1); let step = options?.step ?? 1; if (!step) return []; @@ -53,12 +80,14 @@ export function eachYearOfInterval( reversed = !reversed; } - const dates = []; + const dates: EachYearOfIntervalResult = []; - while (+currentDate <= endTime) { - dates.push(toDate(currentDate)); - currentDate.setFullYear(currentDate.getFullYear() + step); + while (+date <= endTime) { + dates.push(constructFrom(start, date)); + date.setFullYear(date.getFullYear() + step); } return reversed ? dates.reverse() : dates; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfDay/index.ts b/src/date-fns/endOfDay/index.ts index f931400..9c328b7 100644 --- a/src/date-fns/endOfDay/index.ts +++ b/src/date-fns/endOfDay/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfDay} function options. + */ +export interface EndOfDayOptions extends ContextOptions {} /** * @name endOfDay @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a day * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 23:59:59.999 */ -export function endOfDay(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfDay( + date: DateArg, + options?: EndOfDayOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfDecade/index.ts b/src/date-fns/endOfDecade/index.ts index 0c64b7d..a78ddcd 100644 --- a/src/date-fns/endOfDecade/index.ts +++ b/src/date-fns/endOfDecade/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfDecade} function options. + */ +export interface EndOfDecadeOptions extends ContextOptions {} /** * @name endOfDecade @@ -9,8 +19,10 @@ import { toDate } from '../toDate/index'; * Return the end of a decade for the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a decade * @@ -19,14 +31,19 @@ import { toDate } from '../toDate/index'; * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00)) * //=> Dec 31 1989 23:59:59.999 */ -export function endOfDecade(date: DateType | number | string): DateType { +export function endOfDecade( + date: DateArg, + options?: EndOfDecadeOptions | undefined, +): ResultDate { // TODO: Switch to more technical definition in of decades that start with 1 // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking // change, so it can only be done in 4.0. - const _date = toDate(date); + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const decade = 9 + Math.floor(year / 10) * 10; _date.setFullYear(decade, 11, 31); _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfHour/index.ts b/src/date-fns/endOfHour/index.ts index 1b249c9..7409319 100644 --- a/src/date-fns/endOfHour/index.ts +++ b/src/date-fns/endOfHour/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfHour} function options. + */ +export interface EndOfHourOptions extends ContextOptions {} /** * @name endOfHour @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of an hour * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = endOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:59:59.999 */ -export function endOfHour(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfHour( + date: DateArg, + options?: EndOfHourOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setMinutes(59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfISOWeek/index.ts b/src/date-fns/endOfISOWeek/index.ts index 6e7984f..9915109 100644 --- a/src/date-fns/endOfISOWeek/index.ts +++ b/src/date-fns/endOfISOWeek/index.ts @@ -1,4 +1,14 @@ -import { endOfWeek } from '../endOfWeek/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { endOfWeek } from '../endOfWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfISOWeek} function options. + */ +export interface EndOfISOWeekOptions extends ContextOptions {} /** * @name endOfISOWeek @@ -12,8 +22,10 @@ import { endOfWeek } from '../endOfWeek/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of an ISO week * @@ -22,6 +34,11 @@ import { endOfWeek } from '../endOfWeek/index'; * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Sep 07 2014 23:59:59.999 */ -export function endOfISOWeek(date: DateType | number | string): DateType { - return endOfWeek(date, { weekStartsOn: 1 }); +export function endOfISOWeek( + date: DateArg, + options?: EndOfISOWeekOptions | undefined, +): ResultDate { + return endOfWeek(date, { ...options, weekStartsOn: 1 }); } + +/* eslint-enable */ diff --git a/src/date-fns/endOfISOWeekYear/index.ts b/src/date-fns/endOfISOWeekYear/index.ts index 4a65ce4..74510e4 100644 --- a/src/date-fns/endOfISOWeekYear/index.ts +++ b/src/date-fns/endOfISOWeekYear/index.ts @@ -1,6 +1,16 @@ -import { getISOWeekYear } from '../getISOWeekYear/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { getISOWeekYear } from '../getISOWeekYear/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfISOWeekYear} function options. + */ +export interface EndOfISOWeekYearOptions extends ContextOptions {} /** * @name endOfISOWeekYear @@ -15,8 +25,10 @@ import { constructFrom } from '../constructFrom/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ContextDate - The `Date` type of the context function. * * @param date - The original date + * @param options - The options * * @returns The end of an ISO week-numbering year * @@ -25,12 +37,17 @@ import { constructFrom } from '../constructFrom/index'; * const result = endOfISOWeekYear(new Date(2005, 6, 2)) * //=> Sun Jan 01 2006 23:59:59.999 */ -export function endOfISOWeekYear(date: DateType | number | string): DateType { - const year = getISOWeekYear(date); - const fourthOfJanuaryOfNextYear = constructFrom(date, 0); +export function endOfISOWeekYear( + date: DateArg, + options?: EndOfISOWeekYearOptions | undefined, +): ResultDate { + const year = getISOWeekYear(date, options); + const fourthOfJanuaryOfNextYear = constructFrom(options?.in || date, 0); fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); - const _date = startOfISOWeek(fourthOfJanuaryOfNextYear); + const _date = startOfISOWeek(fourthOfJanuaryOfNextYear, options); _date.setMilliseconds(_date.getMilliseconds() - 1); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfMinute/index.ts b/src/date-fns/endOfMinute/index.ts index b8d01c0..4f64b82 100644 --- a/src/date-fns/endOfMinute/index.ts +++ b/src/date-fns/endOfMinute/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfMinute} function options. + */ +export interface EndOfMinuteOptions extends ContextOptions {} /** * @name endOfMinute @@ -7,11 +17,13 @@ import { toDate } from '../toDate/index'; * * @description * Return the end of a minute for the given date. - * The result will be in the local timezone. + * The result will be in the local timezone or the provided context. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a minute * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:59.999 */ -export function endOfMinute(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfMinute( + date: DateArg, + options?: EndOfMinuteOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setSeconds(59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfMonth/index.ts b/src/date-fns/endOfMonth/index.ts index d527794..fbb0afd 100644 --- a/src/date-fns/endOfMonth/index.ts +++ b/src/date-fns/endOfMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfMonth} function options. + */ +export interface EndOfMonthOptions extends ContextOptions {} /** * @name endOfMonth @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a month * @@ -20,10 +32,15 @@ import { toDate } from '../toDate/index'; * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ -export function endOfMonth(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfMonth( + date: DateArg, + options?: EndOfMonthOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const month = _date.getMonth(); _date.setFullYear(_date.getFullYear(), month + 1, 0); _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfQuarter/index.ts b/src/date-fns/endOfQuarter/index.ts index 2184891..09e7634 100644 --- a/src/date-fns/endOfQuarter/index.ts +++ b/src/date-fns/endOfQuarter/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfQuarter} function options. + */ +export interface EndOfQuarterOptions extends ContextOptions {} /** * @name endOfQuarter @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a quarter * @@ -20,11 +32,16 @@ import { toDate } from '../toDate/index'; * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ -export function endOfQuarter(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfQuarter( + date: DateArg, + options?: EndOfQuarterOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const currentMonth = _date.getMonth(); const month = currentMonth - (currentMonth % 3) + 3; _date.setMonth(month, 0); _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfSecond/index.ts b/src/date-fns/endOfSecond/index.ts index d818e37..47ed6a3 100644 --- a/src/date-fns/endOfSecond/index.ts +++ b/src/date-fns/endOfSecond/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfSecond} function options. + */ +export interface EndOfSecondOptions extends ContextOptions {} /** * @name endOfSecond @@ -7,11 +17,13 @@ import { toDate } from '../toDate/index'; * * @description * Return the end of a second for the given date. - * The result will be in the local timezone. + * The result will be in the local timezone if no `in` option is specified. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of a second * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.999 */ -export function endOfSecond(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfSecond( + date: DateArg, + options?: EndOfSecondOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setMilliseconds(999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfToday/index.ts b/src/date-fns/endOfToday/index.ts index 4f23e7e..a556090 100644 --- a/src/date-fns/endOfToday/index.ts +++ b/src/date-fns/endOfToday/index.ts @@ -1,4 +1,14 @@ -import { endOfDay } from '../endOfDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { endOfDay } from '../endOfDay/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link endOfToday} function options. + */ +export interface EndOfTodayOptions extends ContextOptions {} /** * @name endOfToday @@ -10,6 +20,9 @@ import { endOfDay } from '../endOfDay/index'; * Return the end of today. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * + * @param options - The options * * @returns The end of today * @@ -18,6 +31,8 @@ import { endOfDay } from '../endOfDay/index'; * const result = endOfToday() * //=> Mon Oct 6 2014 23:59:59.999 */ -export function endOfToday(): Date { - return endOfDay(Date.now()); +export function endOfToday(options?: EndOfTodayOptions): ResultDate { + return endOfDay(Date.now(), options); } + +/* eslint-enable */ diff --git a/src/date-fns/endOfTomorrow/index.ts b/src/date-fns/endOfTomorrow/index.ts index df3e59f..4ced7a7 100644 --- a/src/date-fns/endOfTomorrow/index.ts +++ b/src/date-fns/endOfTomorrow/index.ts @@ -1,3 +1,15 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link endOfTomorrow} function options. + */ +export interface EndOfTomorrowOptions extends ContextOptions {} + /** * @name endOfTomorrow * @category Day Helpers @@ -8,7 +20,9 @@ * Return the end of tomorrow. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * + * @param options - The options * @returns The end of tomorrow * * @example @@ -16,14 +30,18 @@ * const result = endOfTomorrow() * //=> Tue Oct 7 2014 23:59:59.999 */ -export function endOfTomorrow(): Date { - const now = new Date(); +export function endOfTomorrow( + options?: EndOfTomorrowOptions | undefined, +): ResultDate { + const now = constructNow(options?.in); const year = now.getFullYear(); const month = now.getMonth(); const day = now.getDate(); - const date = new Date(0); + const date = constructNow(options?.in); date.setFullYear(year, month, day + 1); date.setHours(23, 59, 59, 999); - return date; + return options?.in ? options.in(date) : (date as ResultDate); } + +/* eslint-enable */ diff --git a/src/date-fns/endOfWeek/index.ts b/src/date-fns/endOfWeek/index.ts index 6a0ad31..abecaf7 100644 --- a/src/date-fns/endOfWeek/index.ts +++ b/src/date-fns/endOfWeek/index.ts @@ -1,11 +1,18 @@ -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link endOfWeek} function options. */ -export interface EndOfWeekOptions extends WeekOptions, LocalizedOptions<'options'> {} +export interface EndOfWeekOptions + extends WeekOptions, + LocalizedOptions<'options'>, + ContextOptions {} /** * @name endOfWeek @@ -17,6 +24,7 @@ export interface EndOfWeekOptions extends WeekOptions, LocalizedOptions<'options * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date * @param options - An object with options @@ -33,10 +41,10 @@ export interface EndOfWeekOptions extends WeekOptions, LocalizedOptions<'options * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 23:59:59.999 */ -export function endOfWeek( - date: DateType | number | string, - options?: EndOfWeekOptions, -): DateType { +export function endOfWeek( + date: DateArg, + options?: EndOfWeekOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? @@ -45,7 +53,7 @@ export function endOfWeek( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const _date = toDate(date); + const _date = toDate(date, options?.in); const day = _date.getDay(); const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); @@ -53,3 +61,5 @@ export function endOfWeek( _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfYear/index.ts b/src/date-fns/endOfYear/index.ts index 3dee94e..986233a 100644 --- a/src/date-fns/endOfYear/index.ts +++ b/src/date-fns/endOfYear/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link endOfYear} function options. + */ +export interface EndOfYearOptions extends ContextOptions {} /** * @name endOfYear @@ -10,20 +20,27 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The end of a year * * @example * // The end of a year for 2 September 2014 11:55:00: - * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) + * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0)) * //=> Wed Dec 31 2014 23:59:59.999 */ -export function endOfYear(date: DateType | number | string): DateType { - const _date = toDate(date); +export function endOfYear( + date: DateArg, + options?: EndOfYearOptions, +): ResultDate { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); _date.setFullYear(year + 1, 0, 0); _date.setHours(23, 59, 59, 999); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/endOfYesterday/index.ts b/src/date-fns/endOfYesterday/index.ts index 7b272e7..41d3fce 100644 --- a/src/date-fns/endOfYesterday/index.ts +++ b/src/date-fns/endOfYesterday/index.ts @@ -1,3 +1,16 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link endOfYesterday} function options. + */ +export interface EndOfYesterdayOptions extends ContextOptions {} + /** * @name endOfYesterday * @category Day Helpers @@ -8,6 +21,7 @@ * Return the end of yesterday. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @returns The end of yesterday * @@ -16,14 +30,14 @@ * const result = endOfYesterday() * //=> Sun Oct 5 2014 23:59:59.999 */ -export function endOfYesterday(): Date { - const now = new Date(); - const year = now.getFullYear(); - const month = now.getMonth(); - const day = now.getDate(); - - const date = new Date(0); - date.setFullYear(year, month, day - 1); +export function endOfYesterday( + options?: EndOfYesterdayOptions | undefined, +): ResultDate { + const now = constructNow(options?.in); + const date = constructFrom(options?.in, 0); + date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate() - 1); date.setHours(23, 59, 59, 999); return date; } + +/* eslint-enable */ diff --git a/src/date-fns/format/index.ts b/src/date-fns/format/index.ts index 0e2262c..4542942 100644 --- a/src/date-fns/format/index.ts +++ b/src/date-fns/format/index.ts @@ -1,21 +1,27 @@ -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; -import { formatters } from '../_lib/format/formatters/index'; -import { longFormatters } from '../_lib/format/longFormatters/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { formatters } from '../_lib/format/formatters/index.ts'; +import { longFormatters } from '../_lib/format/longFormatters/index.ts'; import { isProtectedDayOfYearToken, isProtectedWeekYearToken, warnOrThrowProtectedError, -} from '../_lib/protectedTokens/index'; -import { isValid } from '../isValid/index'; -import { toDate } from '../toDate/index'; +} from '../_lib/protectedTokens/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { toDate } from '../toDate/index.ts'; import type { AdditionalTokensOptions, + ContextOptions, + DateArg, FirstWeekContainsDateOptions, FormatPart, LocalizedOptions, WeekOptions, -} from '../types'; +} from '../types.ts'; // Rexports of internal for libraries to use. // See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 @@ -52,7 +58,8 @@ export interface FormatOptions extends LocalizedOptions<'options' | 'localize' | 'formatLong'>, WeekOptions, FirstWeekContainsDateOptions, - AdditionalTokensOptions {} + AdditionalTokensOptions, + ContextOptions {} /** * @name format @@ -305,8 +312,6 @@ export interface FormatOptions * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * @param format - The string of tokens * @param options - An object with options @@ -340,11 +345,7 @@ export interface FormatOptions * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") * //=> "3 o'clock" */ -export function format( - date: DateType | number | string, - formatStr: string, - options?: FormatOptions, -): string { +export function format(date: DateArg & {}, formatStr: string, options?: FormatOptions): string { const defaultOptions = getDefaultOptions(); const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale; @@ -362,7 +363,7 @@ export function format( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const originalDate = toDate(date); + const originalDate = toDate(date, options?.in); if (!isValid(originalDate)) { throw new RangeError('Invalid time value'); @@ -374,7 +375,7 @@ export function format( const firstCharacter = substring[0]; if (firstCharacter === 'p' || firstCharacter === 'P') { const longFormatter = longFormatters[firstCharacter]; - return longFormatter!(substring, locale.formatLong); + return longFormatter(substring, locale.formatLong); } return substring; }) @@ -391,11 +392,11 @@ export function format( return { isToken: false, value: cleanEscapedString(substring) }; } - if (formatters[firstCharacter!]) { + if (formatters[firstCharacter]) { return { isToken: true, value: substring }; } - if (firstCharacter!.match(unescapedLatinCharacterRegExp)) { + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); } @@ -426,8 +427,8 @@ export function format( warnOrThrowProtectedError(token, formatStr, String(date)); } - const formatter = formatters[token[0]!]; - return formatter!(originalDate, token, locale.localize, formatterOptions); + const formatter = formatters[token[0]]; + return formatter(originalDate, token, locale.localize, formatterOptions); }) .join(''); } @@ -439,5 +440,7 @@ function cleanEscapedString(input: string): string { return input; } - return matched[1]!.replace(doubleQuoteRegExp, "'"); + return matched[1].replace(doubleQuoteRegExp, "'"); } + +/* eslint-enable */ diff --git a/src/date-fns/formatDistance/index.ts b/src/date-fns/formatDistance/index.ts index 269506c..3b63968 100644 --- a/src/date-fns/formatDistance/index.ts +++ b/src/date-fns/formatDistance/index.ts @@ -1,17 +1,21 @@ -import { compareAsc } from '../compareAsc/index'; -import { minutesInDay, minutesInMonth } from '../constants/index'; -import { differenceInMonths } from '../differenceInMonths/index'; -import { differenceInSeconds } from '../differenceInSeconds/index'; -import { toDate } from '../toDate/index'; -import type { LocalizedOptions } from '../types'; -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { compareAsc } from '../compareAsc/index.ts'; +import { minutesInDay, minutesInMonth } from '../constants/index.ts'; +import { differenceInMonths } from '../differenceInMonths/index.ts'; +import { differenceInSeconds } from '../differenceInSeconds/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions } from '../types.ts'; /** * The {@link formatDistance} function options. */ -export interface FormatDistanceOptions extends LocalizedOptions<'formatDistance'> { +export interface FormatDistanceOptions extends LocalizedOptions<'formatDistance'>, ContextOptions { /** Distances less than a minute are more detailed */ includeSeconds?: boolean; /** Add "X ago"/"in X" in the locale language */ @@ -55,10 +59,8 @@ export interface FormatDistanceOptions extends LocalizedOptions<'formatDistance' * | 40 secs ... 60 secs | less than a minute | * | 60 secs ... 90 secs | 1 minute | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param date - The date - * @param baseDate - The date to compare with + * @param laterDate - The date + * @param earlierDate - The date to compare with * @param options - An object with options * * @returns The distance in words @@ -98,40 +100,32 @@ export interface FormatDistanceOptions extends LocalizedOptions<'formatDistance' * }) * //=> 'pli ol 1 jaro' */ - -export function formatDistance( - date: DateType | number | string, - baseDate: DateType | number | string, +export function formatDistance( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: FormatDistanceOptions, ): string { const defaultOptions = getDefaultOptions(); const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale; const minutesInAlmostTwoDays = 2520; - const comparison = compareAsc(date, baseDate); + const comparison = compareAsc(laterDate, earlierDate); - if (isNaN(comparison)) { - throw new RangeError('Invalid time value'); - } + if (isNaN(comparison)) throw new RangeError('Invalid time value'); const localizeOptions = Object.assign({}, options, { addSuffix: options?.addSuffix, comparison: comparison as -1 | 0 | 1, }); - let dateLeft; - let dateRight; - if (comparison > 0) { - dateLeft = toDate(baseDate); - dateRight = toDate(date); - } else { - dateLeft = toDate(date); - dateRight = toDate(baseDate); - } + const [laterDate_, earlierDate_] = normalizeDates( + options?.in, + ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]), + ); - const seconds = differenceInSeconds(dateRight, dateLeft); + const seconds = differenceInSeconds(earlierDate_, laterDate_); const offsetInSeconds = - (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000; + (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1000; const minutes = Math.round((seconds - offsetInSeconds) / 60); let months; @@ -187,7 +181,7 @@ export function formatDistance( return locale.formatDistance('aboutXMonths', months, localizeOptions); } - months = differenceInMonths(dateRight, dateLeft); + months = differenceInMonths(earlierDate_, laterDate_); // 2 months up to 12 months if (months < 12) { @@ -213,3 +207,5 @@ export function formatDistance( } } } + +/* eslint-enable */ diff --git a/src/date-fns/formatDistanceStrict/index.ts b/src/date-fns/formatDistanceStrict/index.ts index ff2b386..9975956 100644 --- a/src/date-fns/formatDistanceStrict/index.ts +++ b/src/date-fns/formatDistanceStrict/index.ts @@ -1,16 +1,23 @@ -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; -import { compareAsc } from '../compareAsc/index'; -import { millisecondsInMinute, minutesInDay, minutesInMonth, minutesInYear } from '../constants/index'; -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { compareAsc } from '../compareAsc/index.ts'; +import { millisecondsInMinute, minutesInDay, minutesInMonth, minutesInYear } from '../constants/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, RoundingOptions } from '../types.ts'; /** * The {@link formatDistanceStrict} function options. */ -export interface FormatDistanceStrictOptions extends LocalizedOptions<'formatDistance'>, RoundingOptions { +export interface FormatDistanceStrictOptions + extends LocalizedOptions<'formatDistance'>, + RoundingOptions, + ContextOptions { /** Add "X ago"/"in X" in the locale language */ addSuffix?: boolean; /** If specified, will force the unit */ @@ -41,10 +48,8 @@ export type FormatDistanceStrictUnit = 'second' | 'minute' | 'hour' | 'day' | 'm * | 1 ... 11 months | [1..11] months | * | 1 ... N years | [1..N] years | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param date - The date - * @param baseDate - The date to compare with + * @param laterDate - The date + * @param earlierDate - The date to compare with * @param options - An object with options * * @returns The distance in words @@ -102,15 +107,15 @@ export type FormatDistanceStrictUnit = 'second' | 'minute' | 'hour' | 'day' | 'm * //=> '1 jaro' */ -export function formatDistanceStrict( - date: DateType | number | string, - baseDate: DateType | number | string, +export function formatDistanceStrict( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: FormatDistanceStrictOptions, ): string { const defaultOptions = getDefaultOptions(); const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale; - const comparison = compareAsc(date, baseDate); + const comparison = compareAsc(laterDate, earlierDate); if (isNaN(comparison)) { throw new RangeError('Invalid time value'); @@ -121,22 +126,17 @@ export function formatDistanceStrict( comparison: comparison as -1 | 0 | 1, }); - let dateLeft; - let dateRight; - if (comparison > 0) { - dateLeft = toDate(baseDate); - dateRight = toDate(date); - } else { - dateLeft = toDate(date); - dateRight = toDate(baseDate); - } + const [laterDate_, earlierDate_] = normalizeDates( + options?.in, + ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]), + ); const roundingMethod = getRoundingMethod(options?.roundingMethod ?? 'round'); - const milliseconds = dateRight.getTime() - dateLeft.getTime(); + const milliseconds = earlierDate_.getTime() - laterDate_.getTime(); const minutes = milliseconds / millisecondsInMinute; - const timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); + const timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_); // Use DST-normalized difference in minutes for years, months and days; // use regular difference in minutes for hours, minutes and seconds. @@ -195,3 +195,5 @@ export function formatDistanceStrict( return locale.formatDistance('xYears', years, localizeOptions); } } + +/* eslint-enable */ diff --git a/src/date-fns/formatDistanceToNow/index.ts b/src/date-fns/formatDistanceToNow/index.ts index f370e1c..7bde6f0 100644 --- a/src/date-fns/formatDistanceToNow/index.ts +++ b/src/date-fns/formatDistanceToNow/index.ts @@ -1,11 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import type { FormatDistanceOptions } from '../formatDistance/index'; -import { formatDistance } from '../formatDistance/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import type { FormatDistanceOptions } from '../formatDistance/index.ts'; +import { formatDistance } from '../formatDistance/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; /** * The {@link formatDistanceToNow} function options. */ -export interface FormatDistanceToNowOptions extends FormatDistanceOptions {} +export interface FormatDistanceToNowOptions extends FormatDistanceOptions, ContextOptions {} /** * @name formatDistanceToNow @@ -45,8 +50,6 @@ export interface FormatDistanceToNowOptions extends FormatDistanceOptions {} * | 40 secs ... 60 secs | less than a minute | * | 60 secs ... 90 secs | 1 minute | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - The object with options * @@ -90,9 +93,8 @@ export interface FormatDistanceToNowOptions extends FormatDistanceOptions {} * ) * //=> 'pli ol 1 jaro' */ -export function formatDistanceToNow( - date: DateType | number | string, - options?: FormatDistanceToNowOptions, -): string { +export function formatDistanceToNow(date: DateArg & {}, options?: FormatDistanceToNowOptions): string { return formatDistance(date, constructNow(date), options); } + +/* eslint-enable */ diff --git a/src/date-fns/formatDistanceToNowStrict/index.ts b/src/date-fns/formatDistanceToNowStrict/index.ts index 5c47ac5..5eeb8e6 100644 --- a/src/date-fns/formatDistanceToNowStrict/index.ts +++ b/src/date-fns/formatDistanceToNowStrict/index.ts @@ -1,11 +1,16 @@ -import type { FormatDistanceStrictOptions } from '../formatDistanceStrict/index'; -import { formatDistanceStrict } from '../formatDistanceStrict/index'; -import { constructNow } from '../constructNow/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import type { FormatDistanceStrictOptions } from '../formatDistanceStrict/index.ts'; +import { formatDistanceStrict } from '../formatDistanceStrict/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; /** * The {@link formatDistanceToNowStrict} function options. */ -export interface FormatDistanceToNowStrictOptions extends FormatDistanceStrictOptions {} +export interface FormatDistanceToNowStrictOptions extends FormatDistanceStrictOptions, ContextOptions {} /** * @name formatDistanceToNowStrict @@ -27,8 +32,6 @@ export interface FormatDistanceToNowStrictOptions extends FormatDistanceStrictOp * | 1 ... 11 months | [1..11] months | * | 1 ... N years | [1..N] years | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - An object with options. * @@ -80,9 +83,11 @@ export interface FormatDistanceToNowStrictOptions extends FormatDistanceStrictOp * ) * //=> '1 jaro' */ -export function formatDistanceToNowStrict( - date: DateType | number | string, +export function formatDistanceToNowStrict( + date: DateArg & {}, options?: FormatDistanceToNowStrictOptions, ): string { return formatDistanceStrict(date, constructNow(date), options); } + +/* eslint-enable */ diff --git a/src/date-fns/formatDuration/index.ts b/src/date-fns/formatDuration/index.ts index c819bf5..4dabbe8 100644 --- a/src/date-fns/formatDuration/index.ts +++ b/src/date-fns/formatDuration/index.ts @@ -1,7 +1,11 @@ -import type { FormatDistanceToken } from '../locale/types'; -import type { Duration, DurationUnit, LocalizedOptions } from '../types'; -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FormatDistanceToken } from '../locale/types.ts'; +import type { Duration, DurationUnit, LocalizedOptions } from '../types.ts'; +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; /** * The {@link formatDuration} function options. @@ -25,8 +29,6 @@ const defaultFormat: DurationUnit[] = ['years', 'months', 'weeks', 'days', 'hour * @description * Return human-readable duration string i.e. "9 months 2 days" * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param duration - The duration to format * @param options - An object with options. * @@ -101,3 +103,5 @@ export function formatDuration(duration: Duration, options?: FormatDurationOptio return result; } + +/* eslint-enable */ diff --git a/src/date-fns/formatISO/index.ts b/src/date-fns/formatISO/index.ts index a5ffaf5..2e941d3 100644 --- a/src/date-fns/formatISO/index.ts +++ b/src/date-fns/formatISO/index.ts @@ -1,11 +1,15 @@ -import { toDate } from '../toDate/index'; -import type { ISOFormatOptions } from '../types'; -import { addLeadingZeros } from '../_lib/addLeadingZeros/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addLeadingZeros } from '../_lib/addLeadingZeros/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, ISOFormatOptions } from '../types.ts'; /** * The {@link formatISO} function options. */ -export interface FormatISOOptions extends ISOFormatOptions {} +export interface FormatISOOptions extends ISOFormatOptions, ContextOptions {} /** * @name formatISO @@ -15,12 +19,10 @@ export interface FormatISOOptions extends ISOFormatOptions {} * @description * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * @param options - An object with options. * - * @returns The formatted date string (in loca.l time zone) + * @returns The formatted date string (in local time zone) * * @throws `date` must not be Invalid Date * @@ -44,10 +46,10 @@ export interface FormatISOOptions extends ISOFormatOptions {} * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) * //=> '19:00:52Z' */ -export function formatISO(date: DateType | number | string, options?: FormatISOOptions): string { - const _date = toDate(date); +export function formatISO(date: DateArg & {}, options?: FormatISOOptions): string { + const date_ = toDate(date, options?.in); - if (isNaN(_date.getTime())) { + if (isNaN(+date_)) { throw new RangeError('Invalid time value'); } @@ -62,9 +64,9 @@ export function formatISO(date: DateType | number | strin // Representation is either 'date' or 'complete' if (representation !== 'time') { - const day = addLeadingZeros(_date.getDate(), 2); - const month = addLeadingZeros(_date.getMonth() + 1, 2); - const year = addLeadingZeros(_date.getFullYear(), 4); + const day = addLeadingZeros(date_.getDate(), 2); + const month = addLeadingZeros(date_.getMonth() + 1, 2); + const year = addLeadingZeros(date_.getFullYear(), 4); // yyyyMMdd or yyyy-MM-dd. result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; @@ -73,7 +75,7 @@ export function formatISO(date: DateType | number | strin // Representation is either 'time' or 'complete' if (representation !== 'date') { // Add the timezone. - const offset = _date.getTimezoneOffset(); + const offset = date_.getTimezoneOffset(); if (offset !== 0) { const absoluteOffset = Math.abs(offset); @@ -87,9 +89,9 @@ export function formatISO(date: DateType | number | strin tzOffset = 'Z'; } - const hour = addLeadingZeros(_date.getHours(), 2); - const minute = addLeadingZeros(_date.getMinutes(), 2); - const second = addLeadingZeros(_date.getSeconds(), 2); + const hour = addLeadingZeros(date_.getHours(), 2); + const minute = addLeadingZeros(date_.getMinutes(), 2); + const second = addLeadingZeros(date_.getSeconds(), 2); // If there's also date, separate it with time with 'T' const separator = result === '' ? '' : 'T'; @@ -103,3 +105,5 @@ export function formatISO(date: DateType | number | strin return result; } + +/* eslint-enable */ diff --git a/src/date-fns/formatISO9075/index.ts b/src/date-fns/formatISO9075/index.ts index 1e20657..6f25325 100644 --- a/src/date-fns/formatISO9075/index.ts +++ b/src/date-fns/formatISO9075/index.ts @@ -1,12 +1,16 @@ -import { isValid } from '../isValid/index'; -import { toDate } from '../toDate/index'; -import type { ISOFormatOptions } from '../types'; -import { addLeadingZeros } from '../_lib/addLeadingZeros/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addLeadingZeros } from '../_lib/addLeadingZeros/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, ISOFormatOptions } from '../types.ts'; /** * The {@link formatISO9075} function options. */ -export interface FormatISO9075Options extends ISOFormatOptions {} +export interface FormatISO9075Options extends ISOFormatOptions, ContextOptions {} /** * @name formatISO9075 @@ -16,8 +20,6 @@ export interface FormatISO9075Options extends ISOFormatOptions {} * @description * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * @param options - An object with options. * @@ -45,13 +47,10 @@ export interface FormatISO9075Options extends ISOFormatOptions {} * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' }) * //=> '19:00:52' */ -export function formatISO9075( - date: DateType | number | string, - options?: FormatISO9075Options, -): string { - const _date = toDate(date); +export function formatISO9075(date: DateArg & {}, options?: FormatISO9075Options): string { + const date_ = toDate(date, options?.in); - if (!isValid(_date)) { + if (!isValid(date_)) { throw new RangeError('Invalid time value'); } @@ -65,9 +64,9 @@ export function formatISO9075( // Representation is either 'date' or 'complete' if (representation !== 'time') { - const day = addLeadingZeros(_date.getDate(), 2); - const month = addLeadingZeros(_date.getMonth() + 1, 2); - const year = addLeadingZeros(_date.getFullYear(), 4); + const day = addLeadingZeros(date_.getDate(), 2); + const month = addLeadingZeros(date_.getMonth() + 1, 2); + const year = addLeadingZeros(date_.getFullYear(), 4); // yyyyMMdd or yyyy-MM-dd. result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`; @@ -75,9 +74,9 @@ export function formatISO9075( // Representation is either 'time' or 'complete' if (representation !== 'date') { - const hour = addLeadingZeros(_date.getHours(), 2); - const minute = addLeadingZeros(_date.getMinutes(), 2); - const second = addLeadingZeros(_date.getSeconds(), 2); + const hour = addLeadingZeros(date_.getHours(), 2); + const minute = addLeadingZeros(date_.getMinutes(), 2); + const second = addLeadingZeros(date_.getSeconds(), 2); // If there's also date, separate it with time with a space const separator = result === '' ? '' : ' '; @@ -88,3 +87,5 @@ export function formatISO9075( return result; } + +/* eslint-enable */ diff --git a/src/date-fns/formatISODuration/index.ts b/src/date-fns/formatISODuration/index.ts index 59c7104..a0b7cda 100644 --- a/src/date-fns/formatISODuration/index.ts +++ b/src/date-fns/formatISODuration/index.ts @@ -1,4 +1,8 @@ -import type { Duration } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Duration } from '../types.ts'; /** * @name formatISODuration @@ -29,3 +33,5 @@ export function formatISODuration(duration: Duration): string { return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`; } + +/* eslint-enable */ diff --git a/src/date-fns/formatRFC3339/index.ts b/src/date-fns/formatRFC3339/index.ts index 625aeed..33273fc 100644 --- a/src/date-fns/formatRFC3339/index.ts +++ b/src/date-fns/formatRFC3339/index.ts @@ -1,11 +1,16 @@ -import { isValid } from '../isValid/index'; -import { toDate } from '../toDate/index'; -import { addLeadingZeros } from '../_lib/addLeadingZeros/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addLeadingZeros } from '../_lib/addLeadingZeros/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; /** * The {@link formatRFC3339} function options. */ -export interface FormatRFC3339Options { +export interface FormatRFC3339Options extends ContextOptions { /** The number of digits after the decimal point after seconds, defaults to 0 */ fractionDigits?: 0 | 1 | 2 | 3; } @@ -18,8 +23,6 @@ export interface FormatRFC3339Options { * @description * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * @param options - An object with options. * @@ -39,35 +42,32 @@ export interface FormatRFC3339Options { * }) * //=> '2019-09-18T19:00:52.234Z' */ -export function formatRFC3339( - date: DateType | number | string, - options?: FormatRFC3339Options, -): string { - const _date = toDate(date); +export function formatRFC3339(date: DateArg & {}, options?: FormatRFC3339Options): string { + const date_ = toDate(date, options?.in); - if (!isValid(_date)) { + if (!isValid(date_)) { throw new RangeError('Invalid time value'); } const fractionDigits = options?.fractionDigits ?? 0; - const day = addLeadingZeros(_date.getDate(), 2); - const month = addLeadingZeros(_date.getMonth() + 1, 2); - const year = _date.getFullYear(); + const day = addLeadingZeros(date_.getDate(), 2); + const month = addLeadingZeros(date_.getMonth() + 1, 2); + const year = date_.getFullYear(); - const hour = addLeadingZeros(_date.getHours(), 2); - const minute = addLeadingZeros(_date.getMinutes(), 2); - const second = addLeadingZeros(_date.getSeconds(), 2); + const hour = addLeadingZeros(date_.getHours(), 2); + const minute = addLeadingZeros(date_.getMinutes(), 2); + const second = addLeadingZeros(date_.getSeconds(), 2); let fractionalSecond = ''; if (fractionDigits > 0) { - const milliseconds = _date.getMilliseconds(); + const milliseconds = date_.getMilliseconds(); const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, fractionDigits - 3)); fractionalSecond = '.' + addLeadingZeros(fractionalSeconds, fractionDigits); } let offset = ''; - const tzOffset = _date.getTimezoneOffset(); + const tzOffset = date_.getTimezoneOffset(); if (tzOffset !== 0) { const absoluteOffset = Math.abs(tzOffset); @@ -83,3 +83,5 @@ export function formatRFC3339( return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`; } + +/* eslint-enable */ diff --git a/src/date-fns/formatRFC7231/index.ts b/src/date-fns/formatRFC7231/index.ts index 3f85008..c3056e1 100644 --- a/src/date-fns/formatRFC7231/index.ts +++ b/src/date-fns/formatRFC7231/index.ts @@ -1,6 +1,11 @@ -import { isValid } from '../isValid/index'; -import { toDate } from '../toDate/index'; -import { addLeadingZeros } from '../_lib/addLeadingZeros/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addLeadingZeros } from '../_lib/addLeadingZeros/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; @@ -15,8 +20,6 @@ const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', ' * Return the formatted date string in RFC 7231 format. * The result will always be in UTC timezone. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * * @returns The formatted date string @@ -28,7 +31,7 @@ const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', ' * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52)) * //=> 'Wed, 18 Sep 2019 19:00:52 GMT' */ -export function formatRFC7231(date: DateType | number | string): string { +export function formatRFC7231(date: DateArg & {}): string { const _date = toDate(date); if (!isValid(_date)) { @@ -47,3 +50,5 @@ export function formatRFC7231(date: DateType | number | s // Result variables. return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`; } + +/* eslint-enable */ diff --git a/src/date-fns/formatRelative/index.ts b/src/date-fns/formatRelative/index.ts index ab1592d..679d899 100644 --- a/src/date-fns/formatRelative/index.ts +++ b/src/date-fns/formatRelative/index.ts @@ -1,17 +1,22 @@ -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { format } from '../format/index'; -import type { FormatRelativeToken } from '../locale/types'; -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { format } from '../format/index.ts'; +import type { FormatRelativeToken } from '../locale/types.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link formatRelative} function options. */ export interface FormatRelativeOptions extends LocalizedOptions<'options' | 'localize' | 'formatLong' | 'formatRelative'>, - WeekOptions {} + WeekOptions, + ContextOptions {} /** * @name formatRelative @@ -30,8 +35,6 @@ export interface FormatRelativeOptions * | Next 6 days | Sunday at 04:30 AM | * | Other | 12/31/2017 | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to format * @param baseDate - The date to compare with * @param options - An object with options @@ -49,13 +52,12 @@ export interface FormatRelativeOptions * const result = formatRelative(subDays(new Date(), 6), new Date()) * //=> "last Thursday at 12:45 AM" */ -export function formatRelative( - date: DateType | number | string, - baseDate: DateType | number | string, +export function formatRelative( + date: DateArg & {}, + baseDate: DateArg & {}, options?: FormatRelativeOptions, ): string { - const _date = toDate(date); - const _baseDate = toDate(baseDate); + const [date_, baseDate_] = normalizeDates(options?.in, date, baseDate); const defaultOptions = getDefaultOptions(); const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale; @@ -66,7 +68,7 @@ export function formatRelative( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const diff = differenceInCalendarDays(_date, _baseDate); + const diff = differenceInCalendarDays(date_, baseDate_); if (isNaN(diff)) { throw new RangeError('Invalid time value'); @@ -89,9 +91,11 @@ export function formatRelative( token = 'other'; } - const formatStr = locale.formatRelative(token, _date, _baseDate, { + const formatStr = locale.formatRelative(token, date_, baseDate_, { locale, weekStartsOn, }); - return format(_date, formatStr, { locale, weekStartsOn }); + return format(date_, formatStr, { locale, weekStartsOn }); } + +/* eslint-enable */ diff --git a/src/date-fns/fp/_lib/convertToFP/index.ts b/src/date-fns/fp/_lib/convertToFP/index.ts deleted file mode 100644 index 5f704a6..0000000 --- a/src/date-fns/fp/_lib/convertToFP/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { FPArity, FPFn, FPFnInput } from '../../types'; - -/** - * Converts a function to a curried function that accepts arguments in reverse - * order. - * - * @param fn - The function to convert to FP - * @param arity - The arity of the function - * @param curriedArgs - The curried arguments - * - * @returns FP version of the function - * - * @private - */ -export function convertToFP( - fn: Fn, - arity: Arity, - curriedArgs: unknown[] = [], -): FPFn { - return ( - curriedArgs.length >= arity - ? fn(...curriedArgs.slice(0, arity).reverse()) - : (...args: unknown[]) => convertToFP(fn, arity, curriedArgs.concat(args)) - ) as FPFn; -} diff --git a/src/date-fns/fp/add/index.ts b/src/date-fns/fp/add/index.ts deleted file mode 100644 index ad341de..0000000 --- a/src/date-fns/fp/add/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { add as fn } from '../../add/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const add = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addBusinessDays/index.ts b/src/date-fns/fp/addBusinessDays/index.ts deleted file mode 100644 index 5d4a925..0000000 --- a/src/date-fns/fp/addBusinessDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addBusinessDays as fn } from '../../addBusinessDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addBusinessDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addDays/index.ts b/src/date-fns/fp/addDays/index.ts deleted file mode 100644 index 434867f..0000000 --- a/src/date-fns/fp/addDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addDays as fn } from '../../addDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addHours/index.ts b/src/date-fns/fp/addHours/index.ts deleted file mode 100644 index 537bf92..0000000 --- a/src/date-fns/fp/addHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addHours as fn } from '../../addHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addHours = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addISOWeekYears/index.ts b/src/date-fns/fp/addISOWeekYears/index.ts deleted file mode 100644 index bf1a3f1..0000000 --- a/src/date-fns/fp/addISOWeekYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addISOWeekYears as fn } from '../../addISOWeekYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addISOWeekYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addMilliseconds/index.ts b/src/date-fns/fp/addMilliseconds/index.ts deleted file mode 100644 index 0a6ad7b..0000000 --- a/src/date-fns/fp/addMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addMilliseconds as fn } from '../../addMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addMilliseconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addMinutes/index.ts b/src/date-fns/fp/addMinutes/index.ts deleted file mode 100644 index e8f2d7f..0000000 --- a/src/date-fns/fp/addMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addMinutes as fn } from '../../addMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addMinutes = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addMonths/index.ts b/src/date-fns/fp/addMonths/index.ts deleted file mode 100644 index 85ff8ed..0000000 --- a/src/date-fns/fp/addMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addMonths as fn } from '../../addMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addMonths = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addQuarters/index.ts b/src/date-fns/fp/addQuarters/index.ts deleted file mode 100644 index 9bc2a9e..0000000 --- a/src/date-fns/fp/addQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addQuarters as fn } from '../../addQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addQuarters = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addSeconds/index.ts b/src/date-fns/fp/addSeconds/index.ts deleted file mode 100644 index 1caef08..0000000 --- a/src/date-fns/fp/addSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addSeconds as fn } from '../../addSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addSeconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addWeeks/index.ts b/src/date-fns/fp/addWeeks/index.ts deleted file mode 100644 index a37afc8..0000000 --- a/src/date-fns/fp/addWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addWeeks as fn } from '../../addWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addWeeks = convertToFP(fn, 2); diff --git a/src/date-fns/fp/addYears/index.ts b/src/date-fns/fp/addYears/index.ts deleted file mode 100644 index d774629..0000000 --- a/src/date-fns/fp/addYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { addYears as fn } from '../../addYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const addYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/areIntervalsOverlapping/index.ts b/src/date-fns/fp/areIntervalsOverlapping/index.ts deleted file mode 100644 index c772694..0000000 --- a/src/date-fns/fp/areIntervalsOverlapping/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { areIntervalsOverlapping as fn } from '../../areIntervalsOverlapping/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const areIntervalsOverlapping = convertToFP(fn, 2); diff --git a/src/date-fns/fp/areIntervalsOverlappingWithOptions/index.ts b/src/date-fns/fp/areIntervalsOverlappingWithOptions/index.ts deleted file mode 100644 index 327b117..0000000 --- a/src/date-fns/fp/areIntervalsOverlappingWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { areIntervalsOverlapping as fn } from '../../areIntervalsOverlapping/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const areIntervalsOverlappingWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/clamp/index.ts b/src/date-fns/fp/clamp/index.ts deleted file mode 100644 index 050161d..0000000 --- a/src/date-fns/fp/clamp/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { clamp as fn } from '../../clamp/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const clamp = convertToFP(fn, 2); diff --git a/src/date-fns/fp/closestIndexTo/index.ts b/src/date-fns/fp/closestIndexTo/index.ts deleted file mode 100644 index a35ebc9..0000000 --- a/src/date-fns/fp/closestIndexTo/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { closestIndexTo as fn } from '../../closestIndexTo/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const closestIndexTo = convertToFP(fn, 2); diff --git a/src/date-fns/fp/closestTo/index.ts b/src/date-fns/fp/closestTo/index.ts deleted file mode 100644 index 5faa95b..0000000 --- a/src/date-fns/fp/closestTo/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { closestTo as fn } from '../../closestTo/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const closestTo = convertToFP(fn, 2); diff --git a/src/date-fns/fp/compareAsc/index.ts b/src/date-fns/fp/compareAsc/index.ts deleted file mode 100644 index 32d3c9f..0000000 --- a/src/date-fns/fp/compareAsc/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { compareAsc as fn } from '../../compareAsc/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const compareAsc = convertToFP(fn, 2); diff --git a/src/date-fns/fp/compareDesc/index.ts b/src/date-fns/fp/compareDesc/index.ts deleted file mode 100644 index 39b6c82..0000000 --- a/src/date-fns/fp/compareDesc/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { compareDesc as fn } from '../../compareDesc/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const compareDesc = convertToFP(fn, 2); diff --git a/src/date-fns/fp/constructFrom/index.ts b/src/date-fns/fp/constructFrom/index.ts deleted file mode 100644 index 33437b1..0000000 --- a/src/date-fns/fp/constructFrom/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { constructFrom as fn } from '../../constructFrom/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const constructFrom = convertToFP(fn, 2); diff --git a/src/date-fns/fp/daysToWeeks/index.ts b/src/date-fns/fp/daysToWeeks/index.ts deleted file mode 100644 index 06f5e83..0000000 --- a/src/date-fns/fp/daysToWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { daysToWeeks as fn } from '../../daysToWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const daysToWeeks = convertToFP(fn, 1); diff --git a/src/date-fns/fp/differenceInBusinessDays/index.ts b/src/date-fns/fp/differenceInBusinessDays/index.ts deleted file mode 100644 index ef6f86b..0000000 --- a/src/date-fns/fp/differenceInBusinessDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInBusinessDays as fn } from '../../differenceInBusinessDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInBusinessDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarDays/index.ts b/src/date-fns/fp/differenceInCalendarDays/index.ts deleted file mode 100644 index c1729f5..0000000 --- a/src/date-fns/fp/differenceInCalendarDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarDays as fn } from '../../differenceInCalendarDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarISOWeekYears/index.ts b/src/date-fns/fp/differenceInCalendarISOWeekYears/index.ts deleted file mode 100644 index 154f8a4..0000000 --- a/src/date-fns/fp/differenceInCalendarISOWeekYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarISOWeekYears as fn } from '../../differenceInCalendarISOWeekYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarISOWeekYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarISOWeeks/index.ts b/src/date-fns/fp/differenceInCalendarISOWeeks/index.ts deleted file mode 100644 index 638c18d..0000000 --- a/src/date-fns/fp/differenceInCalendarISOWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarISOWeeks as fn } from '../../differenceInCalendarISOWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarISOWeeks = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarMonths/index.ts b/src/date-fns/fp/differenceInCalendarMonths/index.ts deleted file mode 100644 index 68836c1..0000000 --- a/src/date-fns/fp/differenceInCalendarMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarMonths as fn } from '../../differenceInCalendarMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarMonths = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarQuarters/index.ts b/src/date-fns/fp/differenceInCalendarQuarters/index.ts deleted file mode 100644 index 569ff56..0000000 --- a/src/date-fns/fp/differenceInCalendarQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarQuarters as fn } from '../../differenceInCalendarQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarQuarters = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarWeeks/index.ts b/src/date-fns/fp/differenceInCalendarWeeks/index.ts deleted file mode 100644 index d4eeca6..0000000 --- a/src/date-fns/fp/differenceInCalendarWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarWeeks as fn } from '../../differenceInCalendarWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarWeeks = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInCalendarWeeksWithOptions/index.ts b/src/date-fns/fp/differenceInCalendarWeeksWithOptions/index.ts deleted file mode 100644 index d4c24d3..0000000 --- a/src/date-fns/fp/differenceInCalendarWeeksWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarWeeks as fn } from '../../differenceInCalendarWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarWeeksWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInCalendarYears/index.ts b/src/date-fns/fp/differenceInCalendarYears/index.ts deleted file mode 100644 index 1f1bec9..0000000 --- a/src/date-fns/fp/differenceInCalendarYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInCalendarYears as fn } from '../../differenceInCalendarYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInCalendarYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInDays/index.ts b/src/date-fns/fp/differenceInDays/index.ts deleted file mode 100644 index 7ff74cb..0000000 --- a/src/date-fns/fp/differenceInDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInDays as fn } from '../../differenceInDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInHours/index.ts b/src/date-fns/fp/differenceInHours/index.ts deleted file mode 100644 index 493190e..0000000 --- a/src/date-fns/fp/differenceInHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInHours as fn } from '../../differenceInHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInHours = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInHoursWithOptions/index.ts b/src/date-fns/fp/differenceInHoursWithOptions/index.ts deleted file mode 100644 index 71157d3..0000000 --- a/src/date-fns/fp/differenceInHoursWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInHours as fn } from '../../differenceInHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInHoursWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInISOWeekYears/index.ts b/src/date-fns/fp/differenceInISOWeekYears/index.ts deleted file mode 100644 index 5cafd45..0000000 --- a/src/date-fns/fp/differenceInISOWeekYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInISOWeekYears as fn } from '../../differenceInISOWeekYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInISOWeekYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInMilliseconds/index.ts b/src/date-fns/fp/differenceInMilliseconds/index.ts deleted file mode 100644 index c918cc6..0000000 --- a/src/date-fns/fp/differenceInMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInMilliseconds as fn } from '../../differenceInMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInMilliseconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInMinutes/index.ts b/src/date-fns/fp/differenceInMinutes/index.ts deleted file mode 100644 index 95062fb..0000000 --- a/src/date-fns/fp/differenceInMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInMinutes as fn } from '../../differenceInMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInMinutes = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInMinutesWithOptions/index.ts b/src/date-fns/fp/differenceInMinutesWithOptions/index.ts deleted file mode 100644 index 888c91a..0000000 --- a/src/date-fns/fp/differenceInMinutesWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInMinutes as fn } from '../../differenceInMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInMinutesWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInMonths/index.ts b/src/date-fns/fp/differenceInMonths/index.ts deleted file mode 100644 index 6e180e7..0000000 --- a/src/date-fns/fp/differenceInMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInMonths as fn } from '../../differenceInMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInMonths = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInQuarters/index.ts b/src/date-fns/fp/differenceInQuarters/index.ts deleted file mode 100644 index f21805d..0000000 --- a/src/date-fns/fp/differenceInQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInQuarters as fn } from '../../differenceInQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInQuarters = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInQuartersWithOptions/index.ts b/src/date-fns/fp/differenceInQuartersWithOptions/index.ts deleted file mode 100644 index db01365..0000000 --- a/src/date-fns/fp/differenceInQuartersWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInQuarters as fn } from '../../differenceInQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInQuartersWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInSeconds/index.ts b/src/date-fns/fp/differenceInSeconds/index.ts deleted file mode 100644 index 234a5c5..0000000 --- a/src/date-fns/fp/differenceInSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInSeconds as fn } from '../../differenceInSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInSeconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInSecondsWithOptions/index.ts b/src/date-fns/fp/differenceInSecondsWithOptions/index.ts deleted file mode 100644 index 4f17252..0000000 --- a/src/date-fns/fp/differenceInSecondsWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInSeconds as fn } from '../../differenceInSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInSecondsWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInWeeks/index.ts b/src/date-fns/fp/differenceInWeeks/index.ts deleted file mode 100644 index 4d9ede5..0000000 --- a/src/date-fns/fp/differenceInWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInWeeks as fn } from '../../differenceInWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInWeeks = convertToFP(fn, 2); diff --git a/src/date-fns/fp/differenceInWeeksWithOptions/index.ts b/src/date-fns/fp/differenceInWeeksWithOptions/index.ts deleted file mode 100644 index 11df6f0..0000000 --- a/src/date-fns/fp/differenceInWeeksWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInWeeks as fn } from '../../differenceInWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInWeeksWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/differenceInYears/index.ts b/src/date-fns/fp/differenceInYears/index.ts deleted file mode 100644 index 97d9ffe..0000000 --- a/src/date-fns/fp/differenceInYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { differenceInYears as fn } from '../../differenceInYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const differenceInYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachDayOfInterval/index.ts b/src/date-fns/fp/eachDayOfInterval/index.ts deleted file mode 100644 index 2989abf..0000000 --- a/src/date-fns/fp/eachDayOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachDayOfInterval as fn } from '../../eachDayOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachDayOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachDayOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachDayOfIntervalWithOptions/index.ts deleted file mode 100644 index 8430d60..0000000 --- a/src/date-fns/fp/eachDayOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachDayOfInterval as fn } from '../../eachDayOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachDayOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachHourOfInterval/index.ts b/src/date-fns/fp/eachHourOfInterval/index.ts deleted file mode 100644 index ccedf31..0000000 --- a/src/date-fns/fp/eachHourOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachHourOfInterval as fn } from '../../eachHourOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachHourOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachHourOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachHourOfIntervalWithOptions/index.ts deleted file mode 100644 index a4bf09d..0000000 --- a/src/date-fns/fp/eachHourOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachHourOfInterval as fn } from '../../eachHourOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachHourOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachMinuteOfInterval/index.ts b/src/date-fns/fp/eachMinuteOfInterval/index.ts deleted file mode 100644 index fc1e290..0000000 --- a/src/date-fns/fp/eachMinuteOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachMinuteOfInterval as fn } from '../../eachMinuteOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachMinuteOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachMinuteOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachMinuteOfIntervalWithOptions/index.ts deleted file mode 100644 index 0079bec..0000000 --- a/src/date-fns/fp/eachMinuteOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachMinuteOfInterval as fn } from '../../eachMinuteOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachMinuteOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachMonthOfInterval/index.ts b/src/date-fns/fp/eachMonthOfInterval/index.ts deleted file mode 100644 index 8a4cb5d..0000000 --- a/src/date-fns/fp/eachMonthOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachMonthOfInterval as fn } from '../../eachMonthOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachMonthOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachMonthOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachMonthOfIntervalWithOptions/index.ts deleted file mode 100644 index cec65d3..0000000 --- a/src/date-fns/fp/eachMonthOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachMonthOfInterval as fn } from '../../eachMonthOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachMonthOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachQuarterOfInterval/index.ts b/src/date-fns/fp/eachQuarterOfInterval/index.ts deleted file mode 100644 index 5d3d044..0000000 --- a/src/date-fns/fp/eachQuarterOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachQuarterOfInterval as fn } from '../../eachQuarterOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachQuarterOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachQuarterOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachQuarterOfIntervalWithOptions/index.ts deleted file mode 100644 index b3d4f32..0000000 --- a/src/date-fns/fp/eachQuarterOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachQuarterOfInterval as fn } from '../../eachQuarterOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachQuarterOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachWeekOfInterval/index.ts b/src/date-fns/fp/eachWeekOfInterval/index.ts deleted file mode 100644 index 16d69c1..0000000 --- a/src/date-fns/fp/eachWeekOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachWeekOfInterval as fn } from '../../eachWeekOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachWeekOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachWeekOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachWeekOfIntervalWithOptions/index.ts deleted file mode 100644 index dd85290..0000000 --- a/src/date-fns/fp/eachWeekOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachWeekOfInterval as fn } from '../../eachWeekOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachWeekOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/eachWeekendOfInterval/index.ts b/src/date-fns/fp/eachWeekendOfInterval/index.ts deleted file mode 100644 index 38baef9..0000000 --- a/src/date-fns/fp/eachWeekendOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachWeekendOfInterval as fn } from '../../eachWeekendOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachWeekendOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachWeekendOfMonth/index.ts b/src/date-fns/fp/eachWeekendOfMonth/index.ts deleted file mode 100644 index f2ade8b..0000000 --- a/src/date-fns/fp/eachWeekendOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachWeekendOfMonth as fn } from '../../eachWeekendOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachWeekendOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachWeekendOfYear/index.ts b/src/date-fns/fp/eachWeekendOfYear/index.ts deleted file mode 100644 index 3de5f88..0000000 --- a/src/date-fns/fp/eachWeekendOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachWeekendOfYear as fn } from '../../eachWeekendOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachWeekendOfYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachYearOfInterval/index.ts b/src/date-fns/fp/eachYearOfInterval/index.ts deleted file mode 100644 index 4ac90a1..0000000 --- a/src/date-fns/fp/eachYearOfInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachYearOfInterval as fn } from '../../eachYearOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachYearOfInterval = convertToFP(fn, 1); diff --git a/src/date-fns/fp/eachYearOfIntervalWithOptions/index.ts b/src/date-fns/fp/eachYearOfIntervalWithOptions/index.ts deleted file mode 100644 index 91be636..0000000 --- a/src/date-fns/fp/eachYearOfIntervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { eachYearOfInterval as fn } from '../../eachYearOfInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const eachYearOfIntervalWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/endOfDay/index.ts b/src/date-fns/fp/endOfDay/index.ts deleted file mode 100644 index a617823..0000000 --- a/src/date-fns/fp/endOfDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfDay as fn } from '../../endOfDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfDay = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfDecade/index.ts b/src/date-fns/fp/endOfDecade/index.ts deleted file mode 100644 index e4fd41d..0000000 --- a/src/date-fns/fp/endOfDecade/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfDecade as fn } from '../../endOfDecade/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfDecade = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfHour/index.ts b/src/date-fns/fp/endOfHour/index.ts deleted file mode 100644 index 54f0a81..0000000 --- a/src/date-fns/fp/endOfHour/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfHour as fn } from '../../endOfHour/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfHour = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfISOWeek/index.ts b/src/date-fns/fp/endOfISOWeek/index.ts deleted file mode 100644 index 7a95ccf..0000000 --- a/src/date-fns/fp/endOfISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfISOWeek as fn } from '../../endOfISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfISOWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfISOWeekYear/index.ts b/src/date-fns/fp/endOfISOWeekYear/index.ts deleted file mode 100644 index 18a3714..0000000 --- a/src/date-fns/fp/endOfISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfISOWeekYear as fn } from '../../endOfISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfISOWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfMinute/index.ts b/src/date-fns/fp/endOfMinute/index.ts deleted file mode 100644 index a76105b..0000000 --- a/src/date-fns/fp/endOfMinute/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfMinute as fn } from '../../endOfMinute/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfMinute = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfMonth/index.ts b/src/date-fns/fp/endOfMonth/index.ts deleted file mode 100644 index 01a78e1..0000000 --- a/src/date-fns/fp/endOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfMonth as fn } from '../../endOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfQuarter/index.ts b/src/date-fns/fp/endOfQuarter/index.ts deleted file mode 100644 index 180c9cf..0000000 --- a/src/date-fns/fp/endOfQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfQuarter as fn } from '../../endOfQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfQuarter = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfSecond/index.ts b/src/date-fns/fp/endOfSecond/index.ts deleted file mode 100644 index b59b98d..0000000 --- a/src/date-fns/fp/endOfSecond/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfSecond as fn } from '../../endOfSecond/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfSecond = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfWeek/index.ts b/src/date-fns/fp/endOfWeek/index.ts deleted file mode 100644 index a3bf378..0000000 --- a/src/date-fns/fp/endOfWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfWeek as fn } from '../../endOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/endOfWeekWithOptions/index.ts b/src/date-fns/fp/endOfWeekWithOptions/index.ts deleted file mode 100644 index e5043cc..0000000 --- a/src/date-fns/fp/endOfWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfWeek as fn } from '../../endOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfWeekWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/endOfYear/index.ts b/src/date-fns/fp/endOfYear/index.ts deleted file mode 100644 index aef3a42..0000000 --- a/src/date-fns/fp/endOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { endOfYear as fn } from '../../endOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const endOfYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/format/index.ts b/src/date-fns/fp/format/index.ts deleted file mode 100644 index c54dc5e..0000000 --- a/src/date-fns/fp/format/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { format as fn } from '../../format/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const format = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatDistance/index.ts b/src/date-fns/fp/formatDistance/index.ts deleted file mode 100644 index dfcb98d..0000000 --- a/src/date-fns/fp/formatDistance/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDistance as fn } from '../../formatDistance/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDistance = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatDistanceStrict/index.ts b/src/date-fns/fp/formatDistanceStrict/index.ts deleted file mode 100644 index 42694d4..0000000 --- a/src/date-fns/fp/formatDistanceStrict/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDistanceStrict as fn } from '../../formatDistanceStrict/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDistanceStrict = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatDistanceStrictWithOptions/index.ts b/src/date-fns/fp/formatDistanceStrictWithOptions/index.ts deleted file mode 100644 index f946a48..0000000 --- a/src/date-fns/fp/formatDistanceStrictWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDistanceStrict as fn } from '../../formatDistanceStrict/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDistanceStrictWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/formatDistanceWithOptions/index.ts b/src/date-fns/fp/formatDistanceWithOptions/index.ts deleted file mode 100644 index 631fd9c..0000000 --- a/src/date-fns/fp/formatDistanceWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDistance as fn } from '../../formatDistance/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDistanceWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/formatDuration/index.ts b/src/date-fns/fp/formatDuration/index.ts deleted file mode 100644 index 78cd554..0000000 --- a/src/date-fns/fp/formatDuration/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDuration as fn } from '../../formatDuration/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDuration = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatDurationWithOptions/index.ts b/src/date-fns/fp/formatDurationWithOptions/index.ts deleted file mode 100644 index 10d706f..0000000 --- a/src/date-fns/fp/formatDurationWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatDuration as fn } from '../../formatDuration/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatDurationWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatISO/index.ts b/src/date-fns/fp/formatISO/index.ts deleted file mode 100644 index cfe81c9..0000000 --- a/src/date-fns/fp/formatISO/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatISO as fn } from '../../formatISO/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatISO = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatISO9075/index.ts b/src/date-fns/fp/formatISO9075/index.ts deleted file mode 100644 index 61f5f20..0000000 --- a/src/date-fns/fp/formatISO9075/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatISO9075 as fn } from '../../formatISO9075/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatISO9075 = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatISO9075WithOptions/index.ts b/src/date-fns/fp/formatISO9075WithOptions/index.ts deleted file mode 100644 index 46298c3..0000000 --- a/src/date-fns/fp/formatISO9075WithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatISO9075 as fn } from '../../formatISO9075/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatISO9075WithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatISODuration/index.ts b/src/date-fns/fp/formatISODuration/index.ts deleted file mode 100644 index 0b928ce..0000000 --- a/src/date-fns/fp/formatISODuration/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatISODuration as fn } from '../../formatISODuration/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatISODuration = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatISOWithOptions/index.ts b/src/date-fns/fp/formatISOWithOptions/index.ts deleted file mode 100644 index c19042a..0000000 --- a/src/date-fns/fp/formatISOWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatISO as fn } from '../../formatISO/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatISOWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatRFC3339/index.ts b/src/date-fns/fp/formatRFC3339/index.ts deleted file mode 100644 index 87f2c7b..0000000 --- a/src/date-fns/fp/formatRFC3339/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatRFC3339 as fn } from '../../formatRFC3339/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatRFC3339 = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatRFC3339WithOptions/index.ts b/src/date-fns/fp/formatRFC3339WithOptions/index.ts deleted file mode 100644 index 32de9f4..0000000 --- a/src/date-fns/fp/formatRFC3339WithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatRFC3339 as fn } from '../../formatRFC3339/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatRFC3339WithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatRFC7231/index.ts b/src/date-fns/fp/formatRFC7231/index.ts deleted file mode 100644 index 8415c2a..0000000 --- a/src/date-fns/fp/formatRFC7231/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatRFC7231 as fn } from '../../formatRFC7231/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatRFC7231 = convertToFP(fn, 1); diff --git a/src/date-fns/fp/formatRelative/index.ts b/src/date-fns/fp/formatRelative/index.ts deleted file mode 100644 index 78c173b..0000000 --- a/src/date-fns/fp/formatRelative/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatRelative as fn } from '../../formatRelative/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatRelative = convertToFP(fn, 2); diff --git a/src/date-fns/fp/formatRelativeWithOptions/index.ts b/src/date-fns/fp/formatRelativeWithOptions/index.ts deleted file mode 100644 index 9e32ef9..0000000 --- a/src/date-fns/fp/formatRelativeWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { formatRelative as fn } from '../../formatRelative/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatRelativeWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/formatWithOptions/index.ts b/src/date-fns/fp/formatWithOptions/index.ts deleted file mode 100644 index 66528d9..0000000 --- a/src/date-fns/fp/formatWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { format as fn } from '../../format/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const formatWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/fromUnixTime/index.ts b/src/date-fns/fp/fromUnixTime/index.ts deleted file mode 100644 index 1b4b80e..0000000 --- a/src/date-fns/fp/fromUnixTime/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { fromUnixTime as fn } from '../../fromUnixTime/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const fromUnixTime = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDate/index.ts b/src/date-fns/fp/getDate/index.ts deleted file mode 100644 index d41cb99..0000000 --- a/src/date-fns/fp/getDate/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDate as fn } from '../../getDate/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDate = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDay/index.ts b/src/date-fns/fp/getDay/index.ts deleted file mode 100644 index a487c3c..0000000 --- a/src/date-fns/fp/getDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDay as fn } from '../../getDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDay = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDayOfYear/index.ts b/src/date-fns/fp/getDayOfYear/index.ts deleted file mode 100644 index ea5a272..0000000 --- a/src/date-fns/fp/getDayOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDayOfYear as fn } from '../../getDayOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDayOfYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDaysInMonth/index.ts b/src/date-fns/fp/getDaysInMonth/index.ts deleted file mode 100644 index dda9287..0000000 --- a/src/date-fns/fp/getDaysInMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDaysInMonth as fn } from '../../getDaysInMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDaysInMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDaysInYear/index.ts b/src/date-fns/fp/getDaysInYear/index.ts deleted file mode 100644 index f3ceffd..0000000 --- a/src/date-fns/fp/getDaysInYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDaysInYear as fn } from '../../getDaysInYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDaysInYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getDecade/index.ts b/src/date-fns/fp/getDecade/index.ts deleted file mode 100644 index bce6e7a..0000000 --- a/src/date-fns/fp/getDecade/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getDecade as fn } from '../../getDecade/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getDecade = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getHours/index.ts b/src/date-fns/fp/getHours/index.ts deleted file mode 100644 index 067cbc6..0000000 --- a/src/date-fns/fp/getHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getHours as fn } from '../../getHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getHours = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getISODay/index.ts b/src/date-fns/fp/getISODay/index.ts deleted file mode 100644 index 22c2962..0000000 --- a/src/date-fns/fp/getISODay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getISODay as fn } from '../../getISODay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getISODay = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getISOWeek/index.ts b/src/date-fns/fp/getISOWeek/index.ts deleted file mode 100644 index c64d8ad..0000000 --- a/src/date-fns/fp/getISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getISOWeek as fn } from '../../getISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getISOWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getISOWeekYear/index.ts b/src/date-fns/fp/getISOWeekYear/index.ts deleted file mode 100644 index 6af113b..0000000 --- a/src/date-fns/fp/getISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getISOWeekYear as fn } from '../../getISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getISOWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getISOWeeksInYear/index.ts b/src/date-fns/fp/getISOWeeksInYear/index.ts deleted file mode 100644 index f984898..0000000 --- a/src/date-fns/fp/getISOWeeksInYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getISOWeeksInYear as fn } from '../../getISOWeeksInYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getISOWeeksInYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getMilliseconds/index.ts b/src/date-fns/fp/getMilliseconds/index.ts deleted file mode 100644 index de61d75..0000000 --- a/src/date-fns/fp/getMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getMilliseconds as fn } from '../../getMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getMilliseconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getMinutes/index.ts b/src/date-fns/fp/getMinutes/index.ts deleted file mode 100644 index 56b9204..0000000 --- a/src/date-fns/fp/getMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getMinutes as fn } from '../../getMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getMinutes = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getMonth/index.ts b/src/date-fns/fp/getMonth/index.ts deleted file mode 100644 index a100095..0000000 --- a/src/date-fns/fp/getMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getMonth as fn } from '../../getMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getOverlappingDaysInIntervals/index.ts b/src/date-fns/fp/getOverlappingDaysInIntervals/index.ts deleted file mode 100644 index 861bcae..0000000 --- a/src/date-fns/fp/getOverlappingDaysInIntervals/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getOverlappingDaysInIntervals as fn } from '../../getOverlappingDaysInIntervals/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getOverlappingDaysInIntervals = convertToFP(fn, 2); diff --git a/src/date-fns/fp/getQuarter/index.ts b/src/date-fns/fp/getQuarter/index.ts deleted file mode 100644 index af9b7de..0000000 --- a/src/date-fns/fp/getQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getQuarter as fn } from '../../getQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getQuarter = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getSeconds/index.ts b/src/date-fns/fp/getSeconds/index.ts deleted file mode 100644 index c775598..0000000 --- a/src/date-fns/fp/getSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getSeconds as fn } from '../../getSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getSeconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getTime/index.ts b/src/date-fns/fp/getTime/index.ts deleted file mode 100644 index e43d805..0000000 --- a/src/date-fns/fp/getTime/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getTime as fn } from '../../getTime/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getTime = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getUnixTime/index.ts b/src/date-fns/fp/getUnixTime/index.ts deleted file mode 100644 index afbee9b..0000000 --- a/src/date-fns/fp/getUnixTime/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getUnixTime as fn } from '../../getUnixTime/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getUnixTime = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getWeek/index.ts b/src/date-fns/fp/getWeek/index.ts deleted file mode 100644 index 578930d..0000000 --- a/src/date-fns/fp/getWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeek as fn } from '../../getWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getWeekOfMonth/index.ts b/src/date-fns/fp/getWeekOfMonth/index.ts deleted file mode 100644 index 94cb474..0000000 --- a/src/date-fns/fp/getWeekOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeekOfMonth as fn } from '../../getWeekOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeekOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getWeekOfMonthWithOptions/index.ts b/src/date-fns/fp/getWeekOfMonthWithOptions/index.ts deleted file mode 100644 index 1340ba2..0000000 --- a/src/date-fns/fp/getWeekOfMonthWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeekOfMonth as fn } from '../../getWeekOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeekOfMonthWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/getWeekWithOptions/index.ts b/src/date-fns/fp/getWeekWithOptions/index.ts deleted file mode 100644 index bda0da6..0000000 --- a/src/date-fns/fp/getWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeek as fn } from '../../getWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeekWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/getWeekYear/index.ts b/src/date-fns/fp/getWeekYear/index.ts deleted file mode 100644 index 68e8b8c..0000000 --- a/src/date-fns/fp/getWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeekYear as fn } from '../../getWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getWeekYearWithOptions/index.ts b/src/date-fns/fp/getWeekYearWithOptions/index.ts deleted file mode 100644 index 3f4d835..0000000 --- a/src/date-fns/fp/getWeekYearWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeekYear as fn } from '../../getWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeekYearWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/getWeeksInMonth/index.ts b/src/date-fns/fp/getWeeksInMonth/index.ts deleted file mode 100644 index 2863cee..0000000 --- a/src/date-fns/fp/getWeeksInMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeeksInMonth as fn } from '../../getWeeksInMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeeksInMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/getWeeksInMonthWithOptions/index.ts b/src/date-fns/fp/getWeeksInMonthWithOptions/index.ts deleted file mode 100644 index fdc4947..0000000 --- a/src/date-fns/fp/getWeeksInMonthWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getWeeksInMonth as fn } from '../../getWeeksInMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getWeeksInMonthWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/getYear/index.ts b/src/date-fns/fp/getYear/index.ts deleted file mode 100644 index ab4e51c..0000000 --- a/src/date-fns/fp/getYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { getYear as fn } from '../../getYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const getYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/hoursToMilliseconds/index.ts b/src/date-fns/fp/hoursToMilliseconds/index.ts deleted file mode 100644 index bd213c3..0000000 --- a/src/date-fns/fp/hoursToMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { hoursToMilliseconds as fn } from '../../hoursToMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const hoursToMilliseconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/hoursToMinutes/index.ts b/src/date-fns/fp/hoursToMinutes/index.ts deleted file mode 100644 index 5217afe..0000000 --- a/src/date-fns/fp/hoursToMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { hoursToMinutes as fn } from '../../hoursToMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const hoursToMinutes = convertToFP(fn, 1); diff --git a/src/date-fns/fp/hoursToSeconds/index.ts b/src/date-fns/fp/hoursToSeconds/index.ts deleted file mode 100644 index 482e58f..0000000 --- a/src/date-fns/fp/hoursToSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { hoursToSeconds as fn } from '../../hoursToSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const hoursToSeconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/index.ts b/src/date-fns/fp/index.ts deleted file mode 100644 index 8609351..0000000 --- a/src/date-fns/fp/index.ts +++ /dev/null @@ -1,265 +0,0 @@ -// This file is generated automatically by `scripts/build/indices.ts`. Please, don't change it. - -export * from './add/index'; -export * from './addBusinessDays/index'; -export * from './addDays/index'; -export * from './addHours/index'; -export * from './addISOWeekYears/index'; -export * from './addMilliseconds/index'; -export * from './addMinutes/index'; -export * from './addMonths/index'; -export * from './addQuarters/index'; -export * from './addSeconds/index'; -export * from './addWeeks/index'; -export * from './addYears/index'; -export * from './areIntervalsOverlapping/index'; -export * from './areIntervalsOverlappingWithOptions/index'; -export * from './clamp/index'; -export * from './closestIndexTo/index'; -export * from './closestTo/index'; -export * from './compareAsc/index'; -export * from './compareDesc/index'; -export * from './constructFrom/index'; -export * from './daysToWeeks/index'; -export * from './differenceInBusinessDays/index'; -export * from './differenceInCalendarDays/index'; -export * from './differenceInCalendarISOWeekYears/index'; -export * from './differenceInCalendarISOWeeks/index'; -export * from './differenceInCalendarMonths/index'; -export * from './differenceInCalendarQuarters/index'; -export * from './differenceInCalendarWeeks/index'; -export * from './differenceInCalendarWeeksWithOptions/index'; -export * from './differenceInCalendarYears/index'; -export * from './differenceInDays/index'; -export * from './differenceInHours/index'; -export * from './differenceInHoursWithOptions/index'; -export * from './differenceInISOWeekYears/index'; -export * from './differenceInMilliseconds/index'; -export * from './differenceInMinutes/index'; -export * from './differenceInMinutesWithOptions/index'; -export * from './differenceInMonths/index'; -export * from './differenceInQuarters/index'; -export * from './differenceInQuartersWithOptions/index'; -export * from './differenceInSeconds/index'; -export * from './differenceInSecondsWithOptions/index'; -export * from './differenceInWeeks/index'; -export * from './differenceInWeeksWithOptions/index'; -export * from './differenceInYears/index'; -export * from './eachDayOfInterval/index'; -export * from './eachDayOfIntervalWithOptions/index'; -export * from './eachHourOfInterval/index'; -export * from './eachHourOfIntervalWithOptions/index'; -export * from './eachMinuteOfInterval/index'; -export * from './eachMinuteOfIntervalWithOptions/index'; -export * from './eachMonthOfInterval/index'; -export * from './eachMonthOfIntervalWithOptions/index'; -export * from './eachQuarterOfInterval/index'; -export * from './eachQuarterOfIntervalWithOptions/index'; -export * from './eachWeekOfInterval/index'; -export * from './eachWeekOfIntervalWithOptions/index'; -export * from './eachWeekendOfInterval/index'; -export * from './eachWeekendOfMonth/index'; -export * from './eachWeekendOfYear/index'; -export * from './eachYearOfInterval/index'; -export * from './eachYearOfIntervalWithOptions/index'; -export * from './endOfDay/index'; -export * from './endOfDecade/index'; -export * from './endOfHour/index'; -export * from './endOfISOWeek/index'; -export * from './endOfISOWeekYear/index'; -export * from './endOfMinute/index'; -export * from './endOfMonth/index'; -export * from './endOfQuarter/index'; -export * from './endOfSecond/index'; -export * from './endOfWeek/index'; -export * from './endOfWeekWithOptions/index'; -export * from './endOfYear/index'; -export * from './format/index'; -export * from './formatDistance/index'; -export * from './formatDistanceStrict/index'; -export * from './formatDistanceStrictWithOptions/index'; -export * from './formatDistanceWithOptions/index'; -export * from './formatDuration/index'; -export * from './formatDurationWithOptions/index'; -export * from './formatISO/index'; -export * from './formatISO9075/index'; -export * from './formatISO9075WithOptions/index'; -export * from './formatISODuration/index'; -export * from './formatISOWithOptions/index'; -export * from './formatRFC3339/index'; -export * from './formatRFC3339WithOptions/index'; -export * from './formatRFC7231/index'; -export * from './formatRelative/index'; -export * from './formatRelativeWithOptions/index'; -export * from './formatWithOptions/index'; -export * from './fromUnixTime/index'; -export * from './getDate/index'; -export * from './getDay/index'; -export * from './getDayOfYear/index'; -export * from './getDaysInMonth/index'; -export * from './getDaysInYear/index'; -export * from './getDecade/index'; -export * from './getHours/index'; -export * from './getISODay/index'; -export * from './getISOWeek/index'; -export * from './getISOWeekYear/index'; -export * from './getISOWeeksInYear/index'; -export * from './getMilliseconds/index'; -export * from './getMinutes/index'; -export * from './getMonth/index'; -export * from './getOverlappingDaysInIntervals/index'; -export * from './getQuarter/index'; -export * from './getSeconds/index'; -export * from './getTime/index'; -export * from './getUnixTime/index'; -export * from './getWeek/index'; -export * from './getWeekOfMonth/index'; -export * from './getWeekOfMonthWithOptions/index'; -export * from './getWeekWithOptions/index'; -export * from './getWeekYear/index'; -export * from './getWeekYearWithOptions/index'; -export * from './getWeeksInMonth/index'; -export * from './getWeeksInMonthWithOptions/index'; -export * from './getYear/index'; -export * from './hoursToMilliseconds/index'; -export * from './hoursToMinutes/index'; -export * from './hoursToSeconds/index'; -export * from './interval/index'; -export * from './intervalToDuration/index'; -export * from './intervalWithOptions/index'; -export * from './intlFormat/index'; -export * from './intlFormatDistance/index'; -export * from './intlFormatDistanceWithOptions/index'; -export * from './isAfter/index'; -export * from './isBefore/index'; -export * from './isDate/index'; -export * from './isEqual/index'; -export * from './isExists/index'; -export * from './isFirstDayOfMonth/index'; -export * from './isFriday/index'; -export * from './isLastDayOfMonth/index'; -export * from './isLeapYear/index'; -export * from './isMatch/index'; -export * from './isMatchWithOptions/index'; -export * from './isMonday/index'; -export * from './isSameDay/index'; -export * from './isSameHour/index'; -export * from './isSameISOWeek/index'; -export * from './isSameISOWeekYear/index'; -export * from './isSameMinute/index'; -export * from './isSameMonth/index'; -export * from './isSameQuarter/index'; -export * from './isSameSecond/index'; -export * from './isSameWeek/index'; -export * from './isSameWeekWithOptions/index'; -export * from './isSameYear/index'; -export * from './isSaturday/index'; -export * from './isSunday/index'; -export * from './isThursday/index'; -export * from './isTuesday/index'; -export * from './isValid/index'; -export * from './isWednesday/index'; -export * from './isWeekend/index'; -export * from './isWithinInterval/index'; -export * from './lastDayOfDecade/index'; -export * from './lastDayOfISOWeek/index'; -export * from './lastDayOfISOWeekYear/index'; -export * from './lastDayOfMonth/index'; -export * from './lastDayOfQuarter/index'; -export * from './lastDayOfWeek/index'; -export * from './lastDayOfWeekWithOptions/index'; -export * from './lastDayOfYear/index'; -export * from './lightFormat/index'; -export * from './max/index'; -export * from './milliseconds/index'; -export * from './millisecondsToHours/index'; -export * from './millisecondsToMinutes/index'; -export * from './millisecondsToSeconds/index'; -export * from './min/index'; -export * from './minutesToHours/index'; -export * from './minutesToMilliseconds/index'; -export * from './minutesToSeconds/index'; -export * from './monthsToQuarters/index'; -export * from './monthsToYears/index'; -export * from './nextDay/index'; -export * from './nextFriday/index'; -export * from './nextMonday/index'; -export * from './nextSaturday/index'; -export * from './nextSunday/index'; -export * from './nextThursday/index'; -export * from './nextTuesday/index'; -export * from './nextWednesday/index'; -export * from './parse/index'; -export * from './parseISO/index'; -export * from './parseISOWithOptions/index'; -export * from './parseJSON/index'; -export * from './parseWithOptions/index'; -export * from './previousDay/index'; -export * from './previousFriday/index'; -export * from './previousMonday/index'; -export * from './previousSaturday/index'; -export * from './previousSunday/index'; -export * from './previousThursday/index'; -export * from './previousTuesday/index'; -export * from './previousWednesday/index'; -export * from './quartersToMonths/index'; -export * from './quartersToYears/index'; -export * from './roundToNearestHours/index'; -export * from './roundToNearestHoursWithOptions/index'; -export * from './roundToNearestMinutes/index'; -export * from './roundToNearestMinutesWithOptions/index'; -export * from './secondsToHours/index'; -export * from './secondsToMilliseconds/index'; -export * from './secondsToMinutes/index'; -export * from './set/index'; -export * from './setDate/index'; -export * from './setDay/index'; -export * from './setDayOfYear/index'; -export * from './setDayWithOptions/index'; -export * from './setHours/index'; -export * from './setISODay/index'; -export * from './setISOWeek/index'; -export * from './setISOWeekYear/index'; -export * from './setMilliseconds/index'; -export * from './setMinutes/index'; -export * from './setMonth/index'; -export * from './setQuarter/index'; -export * from './setSeconds/index'; -export * from './setWeek/index'; -export * from './setWeekWithOptions/index'; -export * from './setWeekYear/index'; -export * from './setWeekYearWithOptions/index'; -export * from './setYear/index'; -export * from './startOfDay/index'; -export * from './startOfDecade/index'; -export * from './startOfHour/index'; -export * from './startOfISOWeek/index'; -export * from './startOfISOWeekYear/index'; -export * from './startOfMinute/index'; -export * from './startOfMonth/index'; -export * from './startOfQuarter/index'; -export * from './startOfSecond/index'; -export * from './startOfWeek/index'; -export * from './startOfWeekWithOptions/index'; -export * from './startOfWeekYear/index'; -export * from './startOfWeekYearWithOptions/index'; -export * from './startOfYear/index'; -export * from './sub/index'; -export * from './subBusinessDays/index'; -export * from './subDays/index'; -export * from './subHours/index'; -export * from './subISOWeekYears/index'; -export * from './subMilliseconds/index'; -export * from './subMinutes/index'; -export * from './subMonths/index'; -export * from './subQuarters/index'; -export * from './subSeconds/index'; -export * from './subWeeks/index'; -export * from './subYears/index'; -export * from './toDate/index'; -export * from './transpose/index'; -export * from './weeksToDays/index'; -export * from './yearsToDays/index'; -export * from './yearsToMonths/index'; -export * from './yearsToQuarters/index'; -export type * from '../types'; diff --git a/src/date-fns/fp/interval/index.ts b/src/date-fns/fp/interval/index.ts deleted file mode 100644 index 534730f..0000000 --- a/src/date-fns/fp/interval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { interval as fn } from '../../interval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const interval = convertToFP(fn, 2); diff --git a/src/date-fns/fp/intervalToDuration/index.ts b/src/date-fns/fp/intervalToDuration/index.ts deleted file mode 100644 index 36b5557..0000000 --- a/src/date-fns/fp/intervalToDuration/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { intervalToDuration as fn } from '../../intervalToDuration/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const intervalToDuration = convertToFP(fn, 1); diff --git a/src/date-fns/fp/intervalWithOptions/index.ts b/src/date-fns/fp/intervalWithOptions/index.ts deleted file mode 100644 index f8d42f5..0000000 --- a/src/date-fns/fp/intervalWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { interval as fn } from '../../interval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const intervalWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/intlFormat/index.ts b/src/date-fns/fp/intlFormat/index.ts deleted file mode 100644 index 8a19a58..0000000 --- a/src/date-fns/fp/intlFormat/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { intlFormat as fn } from '../../intlFormat/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const intlFormat = convertToFP(fn, 3); diff --git a/src/date-fns/fp/intlFormatDistance/index.ts b/src/date-fns/fp/intlFormatDistance/index.ts deleted file mode 100644 index 81ee1c0..0000000 --- a/src/date-fns/fp/intlFormatDistance/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { intlFormatDistance as fn } from '../../intlFormatDistance/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const intlFormatDistance = convertToFP(fn, 2); diff --git a/src/date-fns/fp/intlFormatDistanceWithOptions/index.ts b/src/date-fns/fp/intlFormatDistanceWithOptions/index.ts deleted file mode 100644 index 9950e17..0000000 --- a/src/date-fns/fp/intlFormatDistanceWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { intlFormatDistance as fn } from '../../intlFormatDistance/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const intlFormatDistanceWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/isAfter/index.ts b/src/date-fns/fp/isAfter/index.ts deleted file mode 100644 index fc72f28..0000000 --- a/src/date-fns/fp/isAfter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isAfter as fn } from '../../isAfter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isAfter = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isBefore/index.ts b/src/date-fns/fp/isBefore/index.ts deleted file mode 100644 index f8d2d3b..0000000 --- a/src/date-fns/fp/isBefore/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isBefore as fn } from '../../isBefore/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isBefore = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isDate/index.ts b/src/date-fns/fp/isDate/index.ts deleted file mode 100644 index cbeffe9..0000000 --- a/src/date-fns/fp/isDate/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isDate as fn } from '../../isDate/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isDate = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isEqual/index.ts b/src/date-fns/fp/isEqual/index.ts deleted file mode 100644 index 43755e5..0000000 --- a/src/date-fns/fp/isEqual/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isEqual as fn } from '../../isEqual/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isEqual = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isExists/index.ts b/src/date-fns/fp/isExists/index.ts deleted file mode 100644 index 1abc3b2..0000000 --- a/src/date-fns/fp/isExists/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isExists as fn } from '../../isExists/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isExists = convertToFP(fn, 3); diff --git a/src/date-fns/fp/isFirstDayOfMonth/index.ts b/src/date-fns/fp/isFirstDayOfMonth/index.ts deleted file mode 100644 index 67ac38a..0000000 --- a/src/date-fns/fp/isFirstDayOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isFirstDayOfMonth as fn } from '../../isFirstDayOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isFirstDayOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isFriday/index.ts b/src/date-fns/fp/isFriday/index.ts deleted file mode 100644 index e045d75..0000000 --- a/src/date-fns/fp/isFriday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isFriday as fn } from '../../isFriday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isFriday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isLastDayOfMonth/index.ts b/src/date-fns/fp/isLastDayOfMonth/index.ts deleted file mode 100644 index 340b09e..0000000 --- a/src/date-fns/fp/isLastDayOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isLastDayOfMonth as fn } from '../../isLastDayOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isLastDayOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isLeapYear/index.ts b/src/date-fns/fp/isLeapYear/index.ts deleted file mode 100644 index d546fea..0000000 --- a/src/date-fns/fp/isLeapYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isLeapYear as fn } from '../../isLeapYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isLeapYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isMatch/index.ts b/src/date-fns/fp/isMatch/index.ts deleted file mode 100644 index 96974d0..0000000 --- a/src/date-fns/fp/isMatch/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isMatch as fn } from '../../isMatch/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isMatch = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isMatchWithOptions/index.ts b/src/date-fns/fp/isMatchWithOptions/index.ts deleted file mode 100644 index 97895b9..0000000 --- a/src/date-fns/fp/isMatchWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isMatch as fn } from '../../isMatch/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isMatchWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/isMonday/index.ts b/src/date-fns/fp/isMonday/index.ts deleted file mode 100644 index 4b3c6e5..0000000 --- a/src/date-fns/fp/isMonday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isMonday as fn } from '../../isMonday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isMonday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isSameDay/index.ts b/src/date-fns/fp/isSameDay/index.ts deleted file mode 100644 index 6a866ca..0000000 --- a/src/date-fns/fp/isSameDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameDay as fn } from '../../isSameDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameDay = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameHour/index.ts b/src/date-fns/fp/isSameHour/index.ts deleted file mode 100644 index 163ef54..0000000 --- a/src/date-fns/fp/isSameHour/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameHour as fn } from '../../isSameHour/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameHour = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameISOWeek/index.ts b/src/date-fns/fp/isSameISOWeek/index.ts deleted file mode 100644 index dd61875..0000000 --- a/src/date-fns/fp/isSameISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameISOWeek as fn } from '../../isSameISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameISOWeek = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameISOWeekYear/index.ts b/src/date-fns/fp/isSameISOWeekYear/index.ts deleted file mode 100644 index 74daef7..0000000 --- a/src/date-fns/fp/isSameISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameISOWeekYear as fn } from '../../isSameISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameISOWeekYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameMinute/index.ts b/src/date-fns/fp/isSameMinute/index.ts deleted file mode 100644 index 3cc58f0..0000000 --- a/src/date-fns/fp/isSameMinute/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameMinute as fn } from '../../isSameMinute/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameMinute = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameMonth/index.ts b/src/date-fns/fp/isSameMonth/index.ts deleted file mode 100644 index 91e0400..0000000 --- a/src/date-fns/fp/isSameMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameMonth as fn } from '../../isSameMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameMonth = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameQuarter/index.ts b/src/date-fns/fp/isSameQuarter/index.ts deleted file mode 100644 index d689209..0000000 --- a/src/date-fns/fp/isSameQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameQuarter as fn } from '../../isSameQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameQuarter = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameSecond/index.ts b/src/date-fns/fp/isSameSecond/index.ts deleted file mode 100644 index b84ff61..0000000 --- a/src/date-fns/fp/isSameSecond/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameSecond as fn } from '../../isSameSecond/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameSecond = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameWeek/index.ts b/src/date-fns/fp/isSameWeek/index.ts deleted file mode 100644 index 1d42732..0000000 --- a/src/date-fns/fp/isSameWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameWeek as fn } from '../../isSameWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameWeek = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSameWeekWithOptions/index.ts b/src/date-fns/fp/isSameWeekWithOptions/index.ts deleted file mode 100644 index 3493e62..0000000 --- a/src/date-fns/fp/isSameWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameWeek as fn } from '../../isSameWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameWeekWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/isSameYear/index.ts b/src/date-fns/fp/isSameYear/index.ts deleted file mode 100644 index db1ebc5..0000000 --- a/src/date-fns/fp/isSameYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSameYear as fn } from '../../isSameYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSameYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/isSaturday/index.ts b/src/date-fns/fp/isSaturday/index.ts deleted file mode 100644 index 7a84666..0000000 --- a/src/date-fns/fp/isSaturday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSaturday as fn } from '../../isSaturday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSaturday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isSunday/index.ts b/src/date-fns/fp/isSunday/index.ts deleted file mode 100644 index cbc1d7e..0000000 --- a/src/date-fns/fp/isSunday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isSunday as fn } from '../../isSunday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isSunday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isThursday/index.ts b/src/date-fns/fp/isThursday/index.ts deleted file mode 100644 index 91211fd..0000000 --- a/src/date-fns/fp/isThursday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isThursday as fn } from '../../isThursday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isThursday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isTuesday/index.ts b/src/date-fns/fp/isTuesday/index.ts deleted file mode 100644 index b0fcc87..0000000 --- a/src/date-fns/fp/isTuesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isTuesday as fn } from '../../isTuesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isTuesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isValid/index.ts b/src/date-fns/fp/isValid/index.ts deleted file mode 100644 index 99e6181..0000000 --- a/src/date-fns/fp/isValid/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isValid as fn } from '../../isValid/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isValid = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isWednesday/index.ts b/src/date-fns/fp/isWednesday/index.ts deleted file mode 100644 index ec3d892..0000000 --- a/src/date-fns/fp/isWednesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isWednesday as fn } from '../../isWednesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isWednesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isWeekend/index.ts b/src/date-fns/fp/isWeekend/index.ts deleted file mode 100644 index 70195e5..0000000 --- a/src/date-fns/fp/isWeekend/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isWeekend as fn } from '../../isWeekend/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isWeekend = convertToFP(fn, 1); diff --git a/src/date-fns/fp/isWithinInterval/index.ts b/src/date-fns/fp/isWithinInterval/index.ts deleted file mode 100644 index a91bcb3..0000000 --- a/src/date-fns/fp/isWithinInterval/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { isWithinInterval as fn } from '../../isWithinInterval/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const isWithinInterval = convertToFP(fn, 2); diff --git a/src/date-fns/fp/lastDayOfDecade/index.ts b/src/date-fns/fp/lastDayOfDecade/index.ts deleted file mode 100644 index c949c79..0000000 --- a/src/date-fns/fp/lastDayOfDecade/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfDecade as fn } from '../../lastDayOfDecade/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfDecade = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfISOWeek/index.ts b/src/date-fns/fp/lastDayOfISOWeek/index.ts deleted file mode 100644 index 89ddeb3..0000000 --- a/src/date-fns/fp/lastDayOfISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfISOWeek as fn } from '../../lastDayOfISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfISOWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfISOWeekYear/index.ts b/src/date-fns/fp/lastDayOfISOWeekYear/index.ts deleted file mode 100644 index 62c5ece..0000000 --- a/src/date-fns/fp/lastDayOfISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfISOWeekYear as fn } from '../../lastDayOfISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfISOWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfMonth/index.ts b/src/date-fns/fp/lastDayOfMonth/index.ts deleted file mode 100644 index d23909e..0000000 --- a/src/date-fns/fp/lastDayOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfMonth as fn } from '../../lastDayOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfQuarter/index.ts b/src/date-fns/fp/lastDayOfQuarter/index.ts deleted file mode 100644 index 3817b8b..0000000 --- a/src/date-fns/fp/lastDayOfQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfQuarter as fn } from '../../lastDayOfQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfQuarter = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfWeek/index.ts b/src/date-fns/fp/lastDayOfWeek/index.ts deleted file mode 100644 index 484b8d5..0000000 --- a/src/date-fns/fp/lastDayOfWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfWeek as fn } from '../../lastDayOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lastDayOfWeekWithOptions/index.ts b/src/date-fns/fp/lastDayOfWeekWithOptions/index.ts deleted file mode 100644 index f32f2d4..0000000 --- a/src/date-fns/fp/lastDayOfWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfWeek as fn } from '../../lastDayOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfWeekWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/lastDayOfYear/index.ts b/src/date-fns/fp/lastDayOfYear/index.ts deleted file mode 100644 index fb98cdc..0000000 --- a/src/date-fns/fp/lastDayOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lastDayOfYear as fn } from '../../lastDayOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lastDayOfYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/lightFormat/index.ts b/src/date-fns/fp/lightFormat/index.ts deleted file mode 100644 index 9c21351..0000000 --- a/src/date-fns/fp/lightFormat/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { lightFormat as fn } from '../../lightFormat/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const lightFormat = convertToFP(fn, 2); diff --git a/src/date-fns/fp/max/index.ts b/src/date-fns/fp/max/index.ts deleted file mode 100644 index aab8ffb..0000000 --- a/src/date-fns/fp/max/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { max as fn } from '../../max/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const max = convertToFP(fn, 1); diff --git a/src/date-fns/fp/milliseconds/index.ts b/src/date-fns/fp/milliseconds/index.ts deleted file mode 100644 index d9f76d8..0000000 --- a/src/date-fns/fp/milliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { milliseconds as fn } from '../../milliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const milliseconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/millisecondsToHours/index.ts b/src/date-fns/fp/millisecondsToHours/index.ts deleted file mode 100644 index 4f18564..0000000 --- a/src/date-fns/fp/millisecondsToHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { millisecondsToHours as fn } from '../../millisecondsToHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const millisecondsToHours = convertToFP(fn, 1); diff --git a/src/date-fns/fp/millisecondsToMinutes/index.ts b/src/date-fns/fp/millisecondsToMinutes/index.ts deleted file mode 100644 index b640264..0000000 --- a/src/date-fns/fp/millisecondsToMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { millisecondsToMinutes as fn } from '../../millisecondsToMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const millisecondsToMinutes = convertToFP(fn, 1); diff --git a/src/date-fns/fp/millisecondsToSeconds/index.ts b/src/date-fns/fp/millisecondsToSeconds/index.ts deleted file mode 100644 index 8368f77..0000000 --- a/src/date-fns/fp/millisecondsToSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { millisecondsToSeconds as fn } from '../../millisecondsToSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const millisecondsToSeconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/min/index.ts b/src/date-fns/fp/min/index.ts deleted file mode 100644 index 7338580..0000000 --- a/src/date-fns/fp/min/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { min as fn } from '../../min/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const min = convertToFP(fn, 1); diff --git a/src/date-fns/fp/minutesToHours/index.ts b/src/date-fns/fp/minutesToHours/index.ts deleted file mode 100644 index 900d645..0000000 --- a/src/date-fns/fp/minutesToHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { minutesToHours as fn } from '../../minutesToHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const minutesToHours = convertToFP(fn, 1); diff --git a/src/date-fns/fp/minutesToMilliseconds/index.ts b/src/date-fns/fp/minutesToMilliseconds/index.ts deleted file mode 100644 index 18aa899..0000000 --- a/src/date-fns/fp/minutesToMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { minutesToMilliseconds as fn } from '../../minutesToMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const minutesToMilliseconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/minutesToSeconds/index.ts b/src/date-fns/fp/minutesToSeconds/index.ts deleted file mode 100644 index 7586fe0..0000000 --- a/src/date-fns/fp/minutesToSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { minutesToSeconds as fn } from '../../minutesToSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const minutesToSeconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/monthsToQuarters/index.ts b/src/date-fns/fp/monthsToQuarters/index.ts deleted file mode 100644 index bf524f3..0000000 --- a/src/date-fns/fp/monthsToQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { monthsToQuarters as fn } from '../../monthsToQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const monthsToQuarters = convertToFP(fn, 1); diff --git a/src/date-fns/fp/monthsToYears/index.ts b/src/date-fns/fp/monthsToYears/index.ts deleted file mode 100644 index 8b20671..0000000 --- a/src/date-fns/fp/monthsToYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { monthsToYears as fn } from '../../monthsToYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const monthsToYears = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextDay/index.ts b/src/date-fns/fp/nextDay/index.ts deleted file mode 100644 index 4930a01..0000000 --- a/src/date-fns/fp/nextDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextDay as fn } from '../../nextDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextDay = convertToFP(fn, 2); diff --git a/src/date-fns/fp/nextFriday/index.ts b/src/date-fns/fp/nextFriday/index.ts deleted file mode 100644 index f590ea7..0000000 --- a/src/date-fns/fp/nextFriday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextFriday as fn } from '../../nextFriday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextFriday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextMonday/index.ts b/src/date-fns/fp/nextMonday/index.ts deleted file mode 100644 index efb5d2b..0000000 --- a/src/date-fns/fp/nextMonday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextMonday as fn } from '../../nextMonday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextMonday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextSaturday/index.ts b/src/date-fns/fp/nextSaturday/index.ts deleted file mode 100644 index d3be636..0000000 --- a/src/date-fns/fp/nextSaturday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextSaturday as fn } from '../../nextSaturday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextSaturday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextSunday/index.ts b/src/date-fns/fp/nextSunday/index.ts deleted file mode 100644 index 75fb357..0000000 --- a/src/date-fns/fp/nextSunday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextSunday as fn } from '../../nextSunday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextSunday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextThursday/index.ts b/src/date-fns/fp/nextThursday/index.ts deleted file mode 100644 index 8a83f2e..0000000 --- a/src/date-fns/fp/nextThursday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextThursday as fn } from '../../nextThursday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextThursday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextTuesday/index.ts b/src/date-fns/fp/nextTuesday/index.ts deleted file mode 100644 index 44130e6..0000000 --- a/src/date-fns/fp/nextTuesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextTuesday as fn } from '../../nextTuesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextTuesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/nextWednesday/index.ts b/src/date-fns/fp/nextWednesday/index.ts deleted file mode 100644 index e81b526..0000000 --- a/src/date-fns/fp/nextWednesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { nextWednesday as fn } from '../../nextWednesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const nextWednesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/parse/index.ts b/src/date-fns/fp/parse/index.ts deleted file mode 100644 index 16e864b..0000000 --- a/src/date-fns/fp/parse/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { parse as fn } from '../../parse/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const parse = convertToFP(fn, 3); diff --git a/src/date-fns/fp/parseISO/index.ts b/src/date-fns/fp/parseISO/index.ts deleted file mode 100644 index 6d4ebe8..0000000 --- a/src/date-fns/fp/parseISO/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { parseISO as fn } from '../../parseISO/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const parseISO = convertToFP(fn, 1); diff --git a/src/date-fns/fp/parseISOWithOptions/index.ts b/src/date-fns/fp/parseISOWithOptions/index.ts deleted file mode 100644 index f18012b..0000000 --- a/src/date-fns/fp/parseISOWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { parseISO as fn } from '../../parseISO/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const parseISOWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/parseJSON/index.ts b/src/date-fns/fp/parseJSON/index.ts deleted file mode 100644 index fdb5ef3..0000000 --- a/src/date-fns/fp/parseJSON/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { parseJSON as fn } from '../../parseJSON/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const parseJSON = convertToFP(fn, 1); diff --git a/src/date-fns/fp/parseWithOptions/index.ts b/src/date-fns/fp/parseWithOptions/index.ts deleted file mode 100644 index 8ae534d..0000000 --- a/src/date-fns/fp/parseWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { parse as fn } from '../../parse/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const parseWithOptions = convertToFP(fn, 4); diff --git a/src/date-fns/fp/previousDay/index.ts b/src/date-fns/fp/previousDay/index.ts deleted file mode 100644 index 75d0699..0000000 --- a/src/date-fns/fp/previousDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousDay as fn } from '../../previousDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousDay = convertToFP(fn, 2); diff --git a/src/date-fns/fp/previousFriday/index.ts b/src/date-fns/fp/previousFriday/index.ts deleted file mode 100644 index 94b1a95..0000000 --- a/src/date-fns/fp/previousFriday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousFriday as fn } from '../../previousFriday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousFriday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousMonday/index.ts b/src/date-fns/fp/previousMonday/index.ts deleted file mode 100644 index 7bfaac2..0000000 --- a/src/date-fns/fp/previousMonday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousMonday as fn } from '../../previousMonday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousMonday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousSaturday/index.ts b/src/date-fns/fp/previousSaturday/index.ts deleted file mode 100644 index 3442412..0000000 --- a/src/date-fns/fp/previousSaturday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousSaturday as fn } from '../../previousSaturday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousSaturday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousSunday/index.ts b/src/date-fns/fp/previousSunday/index.ts deleted file mode 100644 index c381fb9..0000000 --- a/src/date-fns/fp/previousSunday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousSunday as fn } from '../../previousSunday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousSunday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousThursday/index.ts b/src/date-fns/fp/previousThursday/index.ts deleted file mode 100644 index c74023f..0000000 --- a/src/date-fns/fp/previousThursday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousThursday as fn } from '../../previousThursday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousThursday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousTuesday/index.ts b/src/date-fns/fp/previousTuesday/index.ts deleted file mode 100644 index b531da5..0000000 --- a/src/date-fns/fp/previousTuesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousTuesday as fn } from '../../previousTuesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousTuesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/previousWednesday/index.ts b/src/date-fns/fp/previousWednesday/index.ts deleted file mode 100644 index 697f287..0000000 --- a/src/date-fns/fp/previousWednesday/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { previousWednesday as fn } from '../../previousWednesday/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const previousWednesday = convertToFP(fn, 1); diff --git a/src/date-fns/fp/quartersToMonths/index.ts b/src/date-fns/fp/quartersToMonths/index.ts deleted file mode 100644 index 26dde10..0000000 --- a/src/date-fns/fp/quartersToMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { quartersToMonths as fn } from '../../quartersToMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const quartersToMonths = convertToFP(fn, 1); diff --git a/src/date-fns/fp/quartersToYears/index.ts b/src/date-fns/fp/quartersToYears/index.ts deleted file mode 100644 index fb89ae5..0000000 --- a/src/date-fns/fp/quartersToYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { quartersToYears as fn } from '../../quartersToYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const quartersToYears = convertToFP(fn, 1); diff --git a/src/date-fns/fp/roundToNearestHours/index.ts b/src/date-fns/fp/roundToNearestHours/index.ts deleted file mode 100644 index 4e7ee81..0000000 --- a/src/date-fns/fp/roundToNearestHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { roundToNearestHours as fn } from '../../roundToNearestHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const roundToNearestHours = convertToFP(fn, 1); diff --git a/src/date-fns/fp/roundToNearestHoursWithOptions/index.ts b/src/date-fns/fp/roundToNearestHoursWithOptions/index.ts deleted file mode 100644 index a24e28f..0000000 --- a/src/date-fns/fp/roundToNearestHoursWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { roundToNearestHours as fn } from '../../roundToNearestHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const roundToNearestHoursWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/roundToNearestMinutes/index.ts b/src/date-fns/fp/roundToNearestMinutes/index.ts deleted file mode 100644 index 1f99417..0000000 --- a/src/date-fns/fp/roundToNearestMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { roundToNearestMinutes as fn } from '../../roundToNearestMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const roundToNearestMinutes = convertToFP(fn, 1); diff --git a/src/date-fns/fp/roundToNearestMinutesWithOptions/index.ts b/src/date-fns/fp/roundToNearestMinutesWithOptions/index.ts deleted file mode 100644 index 7930fd2..0000000 --- a/src/date-fns/fp/roundToNearestMinutesWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { roundToNearestMinutes as fn } from '../../roundToNearestMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const roundToNearestMinutesWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/secondsToHours/index.ts b/src/date-fns/fp/secondsToHours/index.ts deleted file mode 100644 index 4f37fc7..0000000 --- a/src/date-fns/fp/secondsToHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { secondsToHours as fn } from '../../secondsToHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const secondsToHours = convertToFP(fn, 1); diff --git a/src/date-fns/fp/secondsToMilliseconds/index.ts b/src/date-fns/fp/secondsToMilliseconds/index.ts deleted file mode 100644 index 2352b6d..0000000 --- a/src/date-fns/fp/secondsToMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { secondsToMilliseconds as fn } from '../../secondsToMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const secondsToMilliseconds = convertToFP(fn, 1); diff --git a/src/date-fns/fp/secondsToMinutes/index.ts b/src/date-fns/fp/secondsToMinutes/index.ts deleted file mode 100644 index 4979bf3..0000000 --- a/src/date-fns/fp/secondsToMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { secondsToMinutes as fn } from '../../secondsToMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const secondsToMinutes = convertToFP(fn, 1); diff --git a/src/date-fns/fp/set/index.ts b/src/date-fns/fp/set/index.ts deleted file mode 100644 index 10a1671..0000000 --- a/src/date-fns/fp/set/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { set as fn } from '../../set/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const set = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setDate/index.ts b/src/date-fns/fp/setDate/index.ts deleted file mode 100644 index 5eb34a5..0000000 --- a/src/date-fns/fp/setDate/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setDate as fn } from '../../setDate/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setDate = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setDay/index.ts b/src/date-fns/fp/setDay/index.ts deleted file mode 100644 index b1051f6..0000000 --- a/src/date-fns/fp/setDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setDay as fn } from '../../setDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setDay = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setDayOfYear/index.ts b/src/date-fns/fp/setDayOfYear/index.ts deleted file mode 100644 index 7b43b0b..0000000 --- a/src/date-fns/fp/setDayOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setDayOfYear as fn } from '../../setDayOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setDayOfYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setDayWithOptions/index.ts b/src/date-fns/fp/setDayWithOptions/index.ts deleted file mode 100644 index 63237cc..0000000 --- a/src/date-fns/fp/setDayWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setDay as fn } from '../../setDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setDayWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/setHours/index.ts b/src/date-fns/fp/setHours/index.ts deleted file mode 100644 index 3c1da05..0000000 --- a/src/date-fns/fp/setHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setHours as fn } from '../../setHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setHours = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setISODay/index.ts b/src/date-fns/fp/setISODay/index.ts deleted file mode 100644 index d7c7e3b..0000000 --- a/src/date-fns/fp/setISODay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setISODay as fn } from '../../setISODay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setISODay = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setISOWeek/index.ts b/src/date-fns/fp/setISOWeek/index.ts deleted file mode 100644 index c5a7306..0000000 --- a/src/date-fns/fp/setISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setISOWeek as fn } from '../../setISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setISOWeek = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setISOWeekYear/index.ts b/src/date-fns/fp/setISOWeekYear/index.ts deleted file mode 100644 index d614eba..0000000 --- a/src/date-fns/fp/setISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setISOWeekYear as fn } from '../../setISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setISOWeekYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setMilliseconds/index.ts b/src/date-fns/fp/setMilliseconds/index.ts deleted file mode 100644 index c870e9d..0000000 --- a/src/date-fns/fp/setMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setMilliseconds as fn } from '../../setMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setMilliseconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setMinutes/index.ts b/src/date-fns/fp/setMinutes/index.ts deleted file mode 100644 index fd125ec..0000000 --- a/src/date-fns/fp/setMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setMinutes as fn } from '../../setMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setMinutes = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setMonth/index.ts b/src/date-fns/fp/setMonth/index.ts deleted file mode 100644 index 55bad93..0000000 --- a/src/date-fns/fp/setMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setMonth as fn } from '../../setMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setMonth = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setQuarter/index.ts b/src/date-fns/fp/setQuarter/index.ts deleted file mode 100644 index 6cda1f2..0000000 --- a/src/date-fns/fp/setQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setQuarter as fn } from '../../setQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setQuarter = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setSeconds/index.ts b/src/date-fns/fp/setSeconds/index.ts deleted file mode 100644 index 263298a..0000000 --- a/src/date-fns/fp/setSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setSeconds as fn } from '../../setSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setSeconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setWeek/index.ts b/src/date-fns/fp/setWeek/index.ts deleted file mode 100644 index 1601596..0000000 --- a/src/date-fns/fp/setWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setWeek as fn } from '../../setWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setWeek = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setWeekWithOptions/index.ts b/src/date-fns/fp/setWeekWithOptions/index.ts deleted file mode 100644 index e233613..0000000 --- a/src/date-fns/fp/setWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setWeek as fn } from '../../setWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setWeekWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/setWeekYear/index.ts b/src/date-fns/fp/setWeekYear/index.ts deleted file mode 100644 index 1c8c5df..0000000 --- a/src/date-fns/fp/setWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setWeekYear as fn } from '../../setWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setWeekYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/setWeekYearWithOptions/index.ts b/src/date-fns/fp/setWeekYearWithOptions/index.ts deleted file mode 100644 index e4ab1eb..0000000 --- a/src/date-fns/fp/setWeekYearWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setWeekYear as fn } from '../../setWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setWeekYearWithOptions = convertToFP(fn, 3); diff --git a/src/date-fns/fp/setYear/index.ts b/src/date-fns/fp/setYear/index.ts deleted file mode 100644 index 4eb7507..0000000 --- a/src/date-fns/fp/setYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { setYear as fn } from '../../setYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const setYear = convertToFP(fn, 2); diff --git a/src/date-fns/fp/startOfDay/index.ts b/src/date-fns/fp/startOfDay/index.ts deleted file mode 100644 index a3d0822..0000000 --- a/src/date-fns/fp/startOfDay/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfDay as fn } from '../../startOfDay/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfDay = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfDecade/index.ts b/src/date-fns/fp/startOfDecade/index.ts deleted file mode 100644 index 50217ac..0000000 --- a/src/date-fns/fp/startOfDecade/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfDecade as fn } from '../../startOfDecade/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfDecade = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfHour/index.ts b/src/date-fns/fp/startOfHour/index.ts deleted file mode 100644 index 2b2afd6..0000000 --- a/src/date-fns/fp/startOfHour/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfHour as fn } from '../../startOfHour/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfHour = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfISOWeek/index.ts b/src/date-fns/fp/startOfISOWeek/index.ts deleted file mode 100644 index e239cd2..0000000 --- a/src/date-fns/fp/startOfISOWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfISOWeek as fn } from '../../startOfISOWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfISOWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfISOWeekYear/index.ts b/src/date-fns/fp/startOfISOWeekYear/index.ts deleted file mode 100644 index 6141a23..0000000 --- a/src/date-fns/fp/startOfISOWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfISOWeekYear as fn } from '../../startOfISOWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfISOWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfMinute/index.ts b/src/date-fns/fp/startOfMinute/index.ts deleted file mode 100644 index 39a7d88..0000000 --- a/src/date-fns/fp/startOfMinute/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfMinute as fn } from '../../startOfMinute/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfMinute = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfMonth/index.ts b/src/date-fns/fp/startOfMonth/index.ts deleted file mode 100644 index 4423d2f..0000000 --- a/src/date-fns/fp/startOfMonth/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfMonth as fn } from '../../startOfMonth/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfMonth = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfQuarter/index.ts b/src/date-fns/fp/startOfQuarter/index.ts deleted file mode 100644 index ffe290e..0000000 --- a/src/date-fns/fp/startOfQuarter/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfQuarter as fn } from '../../startOfQuarter/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfQuarter = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfSecond/index.ts b/src/date-fns/fp/startOfSecond/index.ts deleted file mode 100644 index 8d91170..0000000 --- a/src/date-fns/fp/startOfSecond/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfSecond as fn } from '../../startOfSecond/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfSecond = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfWeek/index.ts b/src/date-fns/fp/startOfWeek/index.ts deleted file mode 100644 index 8e8d68a..0000000 --- a/src/date-fns/fp/startOfWeek/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfWeek as fn } from '../../startOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfWeek = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfWeekWithOptions/index.ts b/src/date-fns/fp/startOfWeekWithOptions/index.ts deleted file mode 100644 index 1118a07..0000000 --- a/src/date-fns/fp/startOfWeekWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfWeek as fn } from '../../startOfWeek/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfWeekWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/startOfWeekYear/index.ts b/src/date-fns/fp/startOfWeekYear/index.ts deleted file mode 100644 index a6baced..0000000 --- a/src/date-fns/fp/startOfWeekYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfWeekYear as fn } from '../../startOfWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfWeekYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/startOfWeekYearWithOptions/index.ts b/src/date-fns/fp/startOfWeekYearWithOptions/index.ts deleted file mode 100644 index fb39d71..0000000 --- a/src/date-fns/fp/startOfWeekYearWithOptions/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfWeekYear as fn } from '../../startOfWeekYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfWeekYearWithOptions = convertToFP(fn, 2); diff --git a/src/date-fns/fp/startOfYear/index.ts b/src/date-fns/fp/startOfYear/index.ts deleted file mode 100644 index 538947b..0000000 --- a/src/date-fns/fp/startOfYear/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { startOfYear as fn } from '../../startOfYear/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const startOfYear = convertToFP(fn, 1); diff --git a/src/date-fns/fp/sub/index.ts b/src/date-fns/fp/sub/index.ts deleted file mode 100644 index ee77d9b..0000000 --- a/src/date-fns/fp/sub/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { sub as fn } from '../../sub/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const sub = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subBusinessDays/index.ts b/src/date-fns/fp/subBusinessDays/index.ts deleted file mode 100644 index faaf5d3..0000000 --- a/src/date-fns/fp/subBusinessDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subBusinessDays as fn } from '../../subBusinessDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subBusinessDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subDays/index.ts b/src/date-fns/fp/subDays/index.ts deleted file mode 100644 index 06e38b2..0000000 --- a/src/date-fns/fp/subDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subDays as fn } from '../../subDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subDays = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subHours/index.ts b/src/date-fns/fp/subHours/index.ts deleted file mode 100644 index cdb436c..0000000 --- a/src/date-fns/fp/subHours/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subHours as fn } from '../../subHours/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subHours = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subISOWeekYears/index.ts b/src/date-fns/fp/subISOWeekYears/index.ts deleted file mode 100644 index c8f2cdc..0000000 --- a/src/date-fns/fp/subISOWeekYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subISOWeekYears as fn } from '../../subISOWeekYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subISOWeekYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subMilliseconds/index.ts b/src/date-fns/fp/subMilliseconds/index.ts deleted file mode 100644 index f0cb01f..0000000 --- a/src/date-fns/fp/subMilliseconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subMilliseconds as fn } from '../../subMilliseconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subMilliseconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subMinutes/index.ts b/src/date-fns/fp/subMinutes/index.ts deleted file mode 100644 index 172375b..0000000 --- a/src/date-fns/fp/subMinutes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subMinutes as fn } from '../../subMinutes/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subMinutes = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subMonths/index.ts b/src/date-fns/fp/subMonths/index.ts deleted file mode 100644 index f08c8f1..0000000 --- a/src/date-fns/fp/subMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subMonths as fn } from '../../subMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subMonths = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subQuarters/index.ts b/src/date-fns/fp/subQuarters/index.ts deleted file mode 100644 index 4415f24..0000000 --- a/src/date-fns/fp/subQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subQuarters as fn } from '../../subQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subQuarters = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subSeconds/index.ts b/src/date-fns/fp/subSeconds/index.ts deleted file mode 100644 index 8f67365..0000000 --- a/src/date-fns/fp/subSeconds/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subSeconds as fn } from '../../subSeconds/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subSeconds = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subWeeks/index.ts b/src/date-fns/fp/subWeeks/index.ts deleted file mode 100644 index a0fb51e..0000000 --- a/src/date-fns/fp/subWeeks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subWeeks as fn } from '../../subWeeks/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subWeeks = convertToFP(fn, 2); diff --git a/src/date-fns/fp/subYears/index.ts b/src/date-fns/fp/subYears/index.ts deleted file mode 100644 index b0de8f3..0000000 --- a/src/date-fns/fp/subYears/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { subYears as fn } from '../../subYears/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const subYears = convertToFP(fn, 2); diff --git a/src/date-fns/fp/toDate/index.ts b/src/date-fns/fp/toDate/index.ts deleted file mode 100644 index 5f6a4ce..0000000 --- a/src/date-fns/fp/toDate/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { toDate as fn } from '../../toDate/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const toDate = convertToFP(fn, 1); diff --git a/src/date-fns/fp/transpose/index.ts b/src/date-fns/fp/transpose/index.ts deleted file mode 100644 index 0774437..0000000 --- a/src/date-fns/fp/transpose/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { transpose as fn } from '../../transpose/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const transpose = convertToFP(fn, 2); diff --git a/src/date-fns/fp/types.ts b/src/date-fns/fp/types.ts deleted file mode 100644 index 633f85e..0000000 --- a/src/date-fns/fp/types.ts +++ /dev/null @@ -1,120 +0,0 @@ -/** - * The type of a function that can be converted to FP. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We want any here. -export type FPFnInput = (...args: any[]) => any; - -/** - * The supported arity type. - */ -export type FPArity = 1 | 2 | 3 | 4; - -/** - * FP function interface. It infers the arity of the function and returns the - * corresponding FP function interface. - */ -export type FPFn = Arity extends 4 - ? FPFn4, Parameters[3], Parameters[2], Parameters[1], Parameters[0]> - : Arity extends 3 - ? FPFn3, Parameters[2], Parameters[1], Parameters[0]> - : Arity extends 2 - ? FPFn2, Parameters[1], Parameters[0]> - : Arity extends 1 - ? FPFn1, Parameters[0]> - : never; - -/** - * FP function interface with 1 arguments. - */ -export interface FPFn1 { - /** - * Curried version of the function. Returns itself. - */ - (): FPFn1; - - /** - * Returns the result of the function call. - */ - (arg: Arg): Result; -} - -/** - * FP function interface with 2 arguments. - */ -export interface FPFn2 { - /** - * Curried version of the function. Returns itself. - */ - (): FPFn2; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg2: Arg2): FPFn1; - - /** - * Returns the result of the function call. - */ - (arg2: Arg2, arg1: Arg1): Result; -} - -/** - * FP function interface with 3 arguments. - */ -export interface FPFn3 { - /** - * Curried version of the function. Returns itself. - */ - (): FPFn3; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg3: Arg3): FPFn2; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg3: Arg3, arg2: Arg2): FPFn1; - - /** - * Returns the result of the function call. - */ - (arg3: Arg3, arg2: Arg2, arg1: Arg1): Result; -} - -/** - * FP function interface with 4 arguments. - */ -export interface FPFn4 { - /** - * Curried version of the function. Returns itself. - */ - (): FPFn4; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg4: Arg4): FPFn3; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg4: Arg4, arg3: Arg3): FPFn2; - - /** - * Curried version of the function. Returns a function that accepts the rest - * arguments. - */ - (arg4: Arg4, arg3: Arg3, arg2: Arg2): FPFn1; - - /** - * Returns the result of the function call. - */ - (arg4: Arg4, arg3: Arg3, arg2: Arg2, arg1: Arg1): Result; -} diff --git a/src/date-fns/fp/weeksToDays/index.ts b/src/date-fns/fp/weeksToDays/index.ts deleted file mode 100644 index edeb75d..0000000 --- a/src/date-fns/fp/weeksToDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { weeksToDays as fn } from '../../weeksToDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const weeksToDays = convertToFP(fn, 1); diff --git a/src/date-fns/fp/yearsToDays/index.ts b/src/date-fns/fp/yearsToDays/index.ts deleted file mode 100644 index 0986948..0000000 --- a/src/date-fns/fp/yearsToDays/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { yearsToDays as fn } from '../../yearsToDays/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const yearsToDays = convertToFP(fn, 1); diff --git a/src/date-fns/fp/yearsToMonths/index.ts b/src/date-fns/fp/yearsToMonths/index.ts deleted file mode 100644 index 8221811..0000000 --- a/src/date-fns/fp/yearsToMonths/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { yearsToMonths as fn } from '../../yearsToMonths/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const yearsToMonths = convertToFP(fn, 1); diff --git a/src/date-fns/fp/yearsToQuarters/index.ts b/src/date-fns/fp/yearsToQuarters/index.ts deleted file mode 100644 index 51ad4b4..0000000 --- a/src/date-fns/fp/yearsToQuarters/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it. - -import { yearsToQuarters as fn } from '../../yearsToQuarters/index'; -import { convertToFP } from '../_lib/convertToFP/index'; - -export const yearsToQuarters = convertToFP(fn, 1); diff --git a/src/date-fns/fromUnixTime/index.ts b/src/date-fns/fromUnixTime/index.ts index 2d68c98..33703d6 100644 --- a/src/date-fns/fromUnixTime/index.ts +++ b/src/date-fns/fromUnixTime/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link fromUnixTime} function options. + */ +export interface FromUnixTimeOptions extends ContextOptions {} /** * @name fromUnixTime @@ -9,6 +19,9 @@ import { toDate } from '../toDate/index'; * Create a date from a Unix timestamp (in seconds). Decimal values will be discarded. * * @param unixTime - The given Unix timestamp (in seconds) + * @param options - An object with options. Allows to pass a context. + * + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). * * @returns The date * @@ -17,6 +30,11 @@ import { toDate } from '../toDate/index'; * const result = fromUnixTime(1330515905) * //=> Wed Feb 29 2012 11:45:05 */ -export function fromUnixTime(unixTime: number): Date { - return toDate(unixTime * 1000); +export function fromUnixTime( + unixTime: number, + options?: FromUnixTimeOptions | undefined, +): DateType { + return toDate(unixTime * 1000, options?.in); } + +/* eslint-enable */ diff --git a/src/date-fns/getDate/index.ts b/src/date-fns/getDate/index.ts index d28485a..00a5fdd 100644 --- a/src/date-fns/getDate/index.ts +++ b/src/date-fns/getDate/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDate} function options. + */ +export interface GetDateOptions extends ContextOptions {} /** * @name getDate @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the day of the month of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options. * * @returns The day of month * @@ -19,8 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getDate(new Date(2012, 1, 29)) * //=> 29 */ -export function getDate(date: DateType | number | string): number { - const _date = toDate(date); - const dayOfMonth = _date.getDate(); - return dayOfMonth; +export function getDate(date: DateArg & {}, options?: GetDateOptions | undefined): number { + return toDate(date, options?.in).getDate(); } + +/* eslint-enable */ diff --git a/src/date-fns/getDay/index.ts b/src/date-fns/getDay/index.ts index 2b756a8..515db2c 100644 --- a/src/date-fns/getDay/index.ts +++ b/src/date-fns/getDay/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDay} function options. + */ +export interface GetDayOptions extends ContextOptions {} /** * @name getDay @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the day of the week of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - The options * * @returns The day of week, 0 represents Sunday * @@ -19,8 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getDay(new Date(2012, 1, 29)) * //=> 3 */ -export function getDay(date: DateType | number | string): number { - const _date = toDate(date); - const day = _date.getDay(); - return day; +export function getDay(date: DateArg & {}, options?: GetDayOptions | undefined): number { + return toDate(date, options?.in).getDay(); } + +/* eslint-enable */ diff --git a/src/date-fns/getDayOfYear/index.ts b/src/date-fns/getDayOfYear/index.ts index 63ad3c9..e4a8556 100644 --- a/src/date-fns/getDayOfYear/index.ts +++ b/src/date-fns/getDayOfYear/index.ts @@ -1,6 +1,16 @@ -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { startOfYear } from '../startOfYear/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { startOfYear } from '../startOfYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDayOfYear} function options. + */ +export interface GetDayOfYearOptions extends ContextOptions {} /** * @name getDayOfYear @@ -10,9 +20,8 @@ import { toDate } from '../toDate/index'; * @description * Get the day of the year of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - The options * * @returns The day of year * @@ -21,9 +30,11 @@ import { toDate } from '../toDate/index'; * const result = getDayOfYear(new Date(2014, 6, 2)) * //=> 183 */ -export function getDayOfYear(date: DateType | number | string): number { - const _date = toDate(date); +export function getDayOfYear(date: DateArg & {}, options?: GetDayOfYearOptions | undefined): number { + const _date = toDate(date, options?.in); const diff = differenceInCalendarDays(_date, startOfYear(_date)); const dayOfYear = diff + 1; return dayOfYear; } + +/* eslint-enable */ diff --git a/src/date-fns/getDaysInMonth/index.ts b/src/date-fns/getDaysInMonth/index.ts index 5504f12..9e278ee 100644 --- a/src/date-fns/getDaysInMonth/index.ts +++ b/src/date-fns/getDaysInMonth/index.ts @@ -1,5 +1,15 @@ -import { toDate } from '../toDate/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDaysInMonth} function options. + */ +export interface GetDaysInMonthOptions extends ContextOptions {} /** * @name getDaysInMonth @@ -7,11 +17,10 @@ import { constructFrom } from '../constructFrom/index'; * @summary Get the number of days in a month of the given date. * * @description - * Get the number of days in a month of the given date. - * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * Get the number of days in a month of the given date, considering the context if provided. * * @param date - The given date + * @param options - An object with options * * @returns The number of days in a month * @@ -20,12 +29,14 @@ import { constructFrom } from '../constructFrom/index'; * const result = getDaysInMonth(new Date(2000, 1)) * //=> 29 */ -export function getDaysInMonth(date: DateType | number | string): number { - const _date = toDate(date); +export function getDaysInMonth(date: DateArg & {}, options?: GetDaysInMonthOptions | undefined): number { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const monthIndex = _date.getMonth(); - const lastDayOfMonth = constructFrom(date, 0); + const lastDayOfMonth = constructFrom(_date, 0); lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); lastDayOfMonth.setHours(0, 0, 0, 0); return lastDayOfMonth.getDate(); } + +/* eslint-enable */ diff --git a/src/date-fns/getDaysInYear/index.ts b/src/date-fns/getDaysInYear/index.ts index dfc05de..40a6086 100644 --- a/src/date-fns/getDaysInYear/index.ts +++ b/src/date-fns/getDaysInYear/index.ts @@ -1,5 +1,15 @@ -import { isLeapYear } from '../isLeapYear/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { isLeapYear } from '../isLeapYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDaysInYear} function options. + */ +export interface GetDaysInYearOptions extends ContextOptions {} /** * @name getDaysInYear @@ -9,9 +19,8 @@ import { toDate } from '../toDate/index'; * @description * Get the number of days in a year of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The number of days in a year * @@ -20,12 +29,10 @@ import { toDate } from '../toDate/index'; * const result = getDaysInYear(new Date(2012, 0, 1)) * //=> 366 */ -export function getDaysInYear(date: DateType | number | string): number { - const _date = toDate(date); - - if (String(new Date(_date)) === 'Invalid Date') { - return NaN; - } - +export function getDaysInYear(date: DateArg & {}, options?: GetDaysInYearOptions | undefined): number { + const _date = toDate(date, options?.in); + if (Number.isNaN(+_date)) return NaN; return isLeapYear(_date) ? 366 : 365; } + +/* eslint-enable */ diff --git a/src/date-fns/getDecade/index.ts b/src/date-fns/getDecade/index.ts index d723a6f..9c01947 100644 --- a/src/date-fns/getDecade/index.ts +++ b/src/date-fns/getDecade/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getDecade} function options. + */ +export interface GetDecadeOptions extends ContextOptions {} /** * @name getDecade @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the decade of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The year of decade * @@ -19,12 +28,14 @@ import { toDate } from '../toDate/index'; * const result = getDecade(new Date(1942, 10, 27)) * //=> 1940 */ -export function getDecade(date: DateType | number | string): number { +export function getDecade(date: DateArg & {}, options?: GetDecadeOptions | undefined): number { // TODO: Switch to more technical definition in of decades that start with 1 // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking // change, so it can only be done in 4.0. - const _date = toDate(date); + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const decade = Math.floor(year / 10) * 10; return decade; } + +/* eslint-enable */ diff --git a/src/date-fns/getDefaultOptions/index.ts b/src/date-fns/getDefaultOptions/index.ts index 8df1d8a..531f509 100644 --- a/src/date-fns/getDefaultOptions/index.ts +++ b/src/date-fns/getDefaultOptions/index.ts @@ -1,5 +1,9 @@ -import type { DefaultOptions } from '../_lib/defaultOptions/index'; -import { getDefaultOptions as getInternalDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { DefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { getDefaultOptions as getInternalDefaultOptions } from '../_lib/defaultOptions/index.ts'; /** * @name getDefaultOptions @@ -28,3 +32,5 @@ import { getDefaultOptions as getInternalDefaultOptions } from '../_lib/defaultO export function getDefaultOptions(): DefaultOptions { return Object.assign({}, getInternalDefaultOptions()); } + +/* eslint-enable */ diff --git a/src/date-fns/getHours/index.ts b/src/date-fns/getHours/index.ts index 9dce651..ebccfcd 100644 --- a/src/date-fns/getHours/index.ts +++ b/src/date-fns/getHours/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getHours} function options. + */ +export interface GetHoursOptions extends ContextOptions {} /** * @name getHours @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the hours of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The hours * @@ -19,8 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getHours(new Date(2012, 1, 29, 11, 45)) * //=> 11 */ -export function getHours(date: DateType | number | string): number { - const _date = toDate(date); - const hours = _date.getHours(); - return hours; +export function getHours(date: DateArg & {}, options?: GetHoursOptions | undefined): number { + return toDate(date, options?.in).getHours(); } + +/* eslint-enable */ diff --git a/src/date-fns/getISODay/index.ts b/src/date-fns/getISODay/index.ts index 824371c..8c207d1 100644 --- a/src/date-fns/getISODay/index.ts +++ b/src/date-fns/getISODay/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getISODay} function options. + */ +export interface GetISODayOptions extends ContextOptions {} /** * @name getISODay @@ -11,9 +21,8 @@ import { toDate } from '../toDate/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The day of ISO week * @@ -22,13 +31,9 @@ import { toDate } from '../toDate/index'; * const result = getISODay(new Date(2012, 1, 26)) * //=> 7 */ -export function getISODay(date: DateType | number | string): number { - const _date = toDate(date); - let day = _date.getDay(); - - if (day === 0) { - day = 7; - } - - return day; +export function getISODay(date: DateArg & {}, options?: GetISODayOptions): number { + const day = toDate(date, options?.in).getDay(); + return day === 0 ? 7 : day; } + +/* eslint-enable */ diff --git a/src/date-fns/getISOWeek/index.ts b/src/date-fns/getISOWeek/index.ts index e853b3b..7143284 100644 --- a/src/date-fns/getISOWeek/index.ts +++ b/src/date-fns/getISOWeek/index.ts @@ -1,7 +1,17 @@ -import { millisecondsInWeek } from '../constants/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInWeek } from '../constants/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import { startOfISOWeekYear } from '../startOfISOWeekYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getISOWeek} function options. + */ +export interface GetISOWeekOptions extends ContextOptions {} /** * @name getISOWeek @@ -13,9 +23,8 @@ import { toDate } from '../toDate/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - The options * * @returns The ISO week * @@ -24,8 +33,8 @@ import { toDate } from '../toDate/index'; * const result = getISOWeek(new Date(2005, 0, 2)) * //=> 53 */ -export function getISOWeek(date: DateType | number | string): number { - const _date = toDate(date); +export function getISOWeek(date: DateArg & {}, options?: GetISOWeekOptions | undefined): number { + const _date = toDate(date, options?.in); const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date); // Round the number of weeks to the nearest integer because the number of @@ -33,3 +42,5 @@ export function getISOWeek(date: DateType | number | stri // the daylight saving time clock shift). return Math.round(diff / millisecondsInWeek) + 1; } + +/* eslint-enable */ diff --git a/src/date-fns/getISOWeekYear/index.ts b/src/date-fns/getISOWeekYear/index.ts index d9b30ef..9006974 100644 --- a/src/date-fns/getISOWeekYear/index.ts +++ b/src/date-fns/getISOWeekYear/index.ts @@ -1,6 +1,16 @@ -import { constructFrom } from '../constructFrom/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getISOWeekYear} function options. + */ +export interface GetISOWeekYearOptions extends ContextOptions {} /** * @name getISOWeekYear @@ -13,8 +23,6 @@ import { toDate } from '../toDate/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * * @returns The ISO week-numbering year @@ -24,16 +32,16 @@ import { toDate } from '../toDate/index'; * const result = getISOWeekYear(new Date(2005, 0, 2)) * //=> 2004 */ -export function getISOWeekYear(date: DateType | number | string): number { - const _date = toDate(date); +export function getISOWeekYear(date: DateArg & {}, options?: GetISOWeekYearOptions | undefined): number { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); - const fourthOfJanuaryOfNextYear = constructFrom(date, 0); + const fourthOfJanuaryOfNextYear = constructFrom(_date, 0); fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear); - const fourthOfJanuaryOfThisYear = constructFrom(date, 0); + const fourthOfJanuaryOfThisYear = constructFrom(_date, 0); fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear); @@ -46,3 +54,5 @@ export function getISOWeekYear(date: DateType | number | return year - 1; } } + +/* eslint-enable */ diff --git a/src/date-fns/getISOWeeksInYear/index.ts b/src/date-fns/getISOWeeksInYear/index.ts index 765183e..06cee70 100644 --- a/src/date-fns/getISOWeeksInYear/index.ts +++ b/src/date-fns/getISOWeeksInYear/index.ts @@ -1,6 +1,16 @@ -import { addWeeks } from '../addWeeks/index'; -import { millisecondsInWeek } from '../constants/index'; -import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addWeeks } from '../addWeeks/index.ts'; +import { millisecondsInWeek } from '../constants/index.ts'; +import { startOfISOWeekYear } from '../startOfISOWeekYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getISOWeeksInYear} function options. + */ +export interface GetISOWeeksInYearOptions extends ContextOptions {} /** * @name getISOWeeksInYear @@ -12,9 +22,8 @@ import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The number of ISO weeks in a year * @@ -23,8 +32,8 @@ import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; * const result = getISOWeeksInYear(new Date(2015, 1, 11)) * //=> 53 */ -export function getISOWeeksInYear(date: DateType | number | string): number { - const thisYear = startOfISOWeekYear(date); +export function getISOWeeksInYear(date: DateArg & {}, options?: GetISOWeeksInYearOptions | undefined): number { + const thisYear = startOfISOWeekYear(date, options); const nextYear = startOfISOWeekYear(addWeeks(thisYear, 60)); const diff = +nextYear - +thisYear; @@ -33,3 +42,5 @@ export function getISOWeeksInYear(date: DateType | number // the daylight saving time clock shift). return Math.round(diff / millisecondsInWeek); } + +/* eslint-enable */ diff --git a/src/date-fns/getMilliseconds/index.ts b/src/date-fns/getMilliseconds/index.ts index 03834f2..5e0a411 100644 --- a/src/date-fns/getMilliseconds/index.ts +++ b/src/date-fns/getMilliseconds/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name getMilliseconds @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Get the milliseconds of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * * @returns The milliseconds @@ -19,8 +22,8 @@ import { toDate } from '../toDate/index'; * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 123 */ -export function getMilliseconds(date: DateType | number | string): number { - const _date = toDate(date); - const milliseconds = _date.getMilliseconds(); - return milliseconds; +export function getMilliseconds(date: DateArg & {}): number { + return toDate(date).getMilliseconds(); } + +/* eslint-enable */ diff --git a/src/date-fns/getMinutes/index.ts b/src/date-fns/getMinutes/index.ts index 64960fe..54095dd 100644 --- a/src/date-fns/getMinutes/index.ts +++ b/src/date-fns/getMinutes/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getMinutes} function options. + */ +export interface GetMinutesOptions extends ContextOptions {} /** * @name getMinutes @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the minutes of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - The options * * @returns The minutes * @@ -19,8 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) * //=> 45 */ -export function getMinutes(date: DateType | number | string): number { - const _date = toDate(date); - const minutes = _date.getMinutes(); - return minutes; +export function getMinutes(date: DateArg & {}, options?: GetMinutesOptions | undefined): number { + return toDate(date, options?.in).getMinutes(); } + +/* eslint-enable */ diff --git a/src/date-fns/getMonth/index.ts b/src/date-fns/getMonth/index.ts index 330cb16..2da3fd7 100644 --- a/src/date-fns/getMonth/index.ts +++ b/src/date-fns/getMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getMonth} function options. + */ +export interface GetMonthOptions extends ContextOptions {} /** * @name getMonth @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the month of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The month index (0-11) * @@ -19,8 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getMonth(new Date(2012, 1, 29)) * //=> 1 */ -export function getMonth(date: DateType | number | string): number { - const _date = toDate(date); - const month = _date.getMonth(); - return month; +export function getMonth(date: DateArg & {}, options?: GetMonthOptions | undefined): number { + return toDate(date, options?.in).getMonth(); } + +/* eslint-enable */ diff --git a/src/date-fns/getOverlappingDaysInIntervals/index.ts b/src/date-fns/getOverlappingDaysInIntervals/index.ts index 3e8c5d8..de673b6 100644 --- a/src/date-fns/getOverlappingDaysInIntervals/index.ts +++ b/src/date-fns/getOverlappingDaysInIntervals/index.ts @@ -1,7 +1,11 @@ -import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index'; -import { millisecondsInDay } from '../constants/index'; -import { toDate } from '../toDate/index'; -import type { Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getTimezoneOffsetInMilliseconds } from '../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { millisecondsInDay } from '../constants/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { Interval } from '../types.ts'; /** * @name getOverlappingDaysInIntervals @@ -16,10 +20,9 @@ import type { Interval } from '../types'; * Two equal 0-length intervals will result in 0. Two equal 1ms intervals will * result in 1. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param intervalLeft - The first interval to compare. * @param intervalRight - The second interval to compare. + * @param options - An object with options * * @returns The number of days that overlap in two time intervals * @@ -40,23 +43,22 @@ import type { Interval } from '../types'; * //=> 0 */ -export function getOverlappingDaysInIntervals( - intervalLeft: Interval, - intervalRight: Interval, -): number { +export function getOverlappingDaysInIntervals(intervalLeft: Interval, intervalRight: Interval): number { const [leftStart, leftEnd] = [+toDate(intervalLeft.start), +toDate(intervalLeft.end)].sort((a, b) => a - b); const [rightStart, rightEnd] = [+toDate(intervalRight.start), +toDate(intervalRight.end)].sort((a, b) => a - b); // Prevent NaN result if intervals don't overlap at all. - const isOverlapping = leftStart! < rightEnd! && rightStart! < leftEnd!; + const isOverlapping = leftStart < rightEnd && rightStart < leftEnd; if (!isOverlapping) return 0; // Remove the timezone offset to negate the DST effect on calculations. - const overlapLeft = rightStart! < leftStart! ? leftStart : rightStart; - const left = overlapLeft! - getTimezoneOffsetInMilliseconds(overlapLeft!); - const overlapRight = rightEnd! > leftEnd! ? leftEnd : rightEnd; - const right = overlapRight! - getTimezoneOffsetInMilliseconds(overlapRight!); + const overlapLeft = rightStart < leftStart ? leftStart : rightStart; + const left = overlapLeft - getTimezoneOffsetInMilliseconds(overlapLeft); + const overlapRight = rightEnd > leftEnd ? leftEnd : rightEnd; + const right = overlapRight - getTimezoneOffsetInMilliseconds(overlapRight); // Ceil the number to include partial days too. return Math.ceil((right - left) / millisecondsInDay); } + +/* eslint-enable */ diff --git a/src/date-fns/getQuarter/index.ts b/src/date-fns/getQuarter/index.ts index adc6173..b73fb03 100644 --- a/src/date-fns/getQuarter/index.ts +++ b/src/date-fns/getQuarter/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getQuarter} function options. + */ +export interface GetQuarterOptions extends ContextOptions {} /** * @name getQuarter @@ -8,19 +18,20 @@ import { toDate } from '../toDate/index'; * @description * Get the year quarter of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The quarter * * @example * // Which quarter is 2 July 2014? - * const result = getQuarter(new Date(2014, 6, 2)) + * const result = getQuarter(new Date(2014, 6, 2)); * //=> 3 */ -export function getQuarter(date: DateType | number | string): number { - const _date = toDate(date); +export function getQuarter(date: DateArg & {}, options?: GetQuarterOptions | undefined): number { + const _date = toDate(date, options?.in); const quarter = Math.trunc(_date.getMonth() / 3) + 1; return quarter; } + +/* eslint-enable */ diff --git a/src/date-fns/getSeconds/index.ts b/src/date-fns/getSeconds/index.ts index 132b575..97fdc77 100644 --- a/src/date-fns/getSeconds/index.ts +++ b/src/date-fns/getSeconds/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name getSeconds @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Get the seconds of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * * @returns The seconds @@ -19,8 +22,8 @@ import { toDate } from '../toDate/index'; * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 5 */ -export function getSeconds(date: DateType | number | string): number { - const _date = toDate(date); - const seconds = _date.getSeconds(); - return seconds; +export function getSeconds(date: DateArg & {}): number { + return toDate(date).getSeconds(); } + +/* eslint-enable */ diff --git a/src/date-fns/getTime/index.ts b/src/date-fns/getTime/index.ts index 0ba154f..d2e5732 100644 --- a/src/date-fns/getTime/index.ts +++ b/src/date-fns/getTime/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name getTime @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Get the milliseconds timestamp of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * * @returns The timestamp @@ -19,8 +22,8 @@ import { toDate } from '../toDate/index'; * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 1330515905123 */ -export function getTime(date: DateType | number | string): number { - const _date = toDate(date); - const timestamp = _date.getTime(); - return timestamp; +export function getTime(date: DateArg & {}): number { + return +toDate(date); } + +/* eslint-enable */ diff --git a/src/date-fns/getUnixTime/index.ts b/src/date-fns/getUnixTime/index.ts index b1a8a13..34ea424 100644 --- a/src/date-fns/getUnixTime/index.ts +++ b/src/date-fns/getUnixTime/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name getUnixTime @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Get the seconds timestamp of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * * @returns The timestamp @@ -19,6 +22,8 @@ import { toDate } from '../toDate/index'; * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) * //=> 1330512305 */ -export function getUnixTime(date: DateType | number | string): number { +export function getUnixTime(date: DateArg & {}): number { return Math.trunc(+toDate(date) / 1000); } + +/* eslint-enable */ diff --git a/src/date-fns/getWeek/index.ts b/src/date-fns/getWeek/index.ts index fb3e0eb..d125c91 100644 --- a/src/date-fns/getWeek/index.ts +++ b/src/date-fns/getWeek/index.ts @@ -1,13 +1,21 @@ -import { millisecondsInWeek } from '../constants/index'; -import { startOfWeek } from '../startOfWeek/index'; -import { startOfWeekYear } from '../startOfWeekYear/index'; -import { toDate } from '../toDate/index'; -import type { FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInWeek } from '../constants/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import { startOfWeekYear } from '../startOfWeekYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link getWeek} function options. */ -export interface GetWeekOptions extends LocalizedOptions<'options'>, WeekOptions, FirstWeekContainsDateOptions {} +export interface GetWeekOptions + extends LocalizedOptions<'options'>, + WeekOptions, + FirstWeekContainsDateOptions, + ContextOptions {} /** * @name getWeek @@ -23,8 +31,6 @@ export interface GetWeekOptions extends LocalizedOptions<'options'>, WeekOptions * * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - An object with options * @@ -45,9 +51,8 @@ export interface GetWeekOptions extends LocalizedOptions<'options'>, WeekOptions * }) * //=> 53 */ - -export function getWeek(date: DateType | number | string, options?: GetWeekOptions): number { - const _date = toDate(date); +export function getWeek(date: DateArg & {}, options?: GetWeekOptions | undefined): number { + const _date = toDate(date, options?.in); const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options); // Round the number of weeks to the nearest integer because the number of @@ -55,3 +60,5 @@ export function getWeek(date: DateType | number | string, // the daylight saving time clock shift). return Math.round(diff / millisecondsInWeek) + 1; } + +/* eslint-enable */ diff --git a/src/date-fns/getWeekOfMonth/index.ts b/src/date-fns/getWeekOfMonth/index.ts index 949491c..12fd003 100644 --- a/src/date-fns/getWeekOfMonth/index.ts +++ b/src/date-fns/getWeekOfMonth/index.ts @@ -1,13 +1,18 @@ -import { getDate } from '../getDate/index'; -import { getDay } from '../getDay/index'; -import { startOfMonth } from '../startOfMonth/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { getDate } from '../getDate/index.ts'; +import { getDay } from '../getDay/index.ts'; +import { startOfMonth } from '../startOfMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link getWeekOfMonth} function options. */ -export interface GetWeekOfMonthOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface GetWeekOfMonthOptions extends LocalizedOptions<'options'>, WeekOptions, ContextOptions {} /** * @name getWeekOfMonth @@ -17,8 +22,6 @@ export interface GetWeekOfMonthOptions extends LocalizedOptions<'options'>, Week * @description * Get the week of the month of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - An object with options. * @@ -29,10 +32,7 @@ export interface GetWeekOfMonthOptions extends LocalizedOptions<'options'>, Week * const result = getWeekOfMonth(new Date(2017, 10, 9)) * //=> 2 */ -export function getWeekOfMonth( - date: DateType | number | string, - options?: GetWeekOfMonthOptions, -): number { +export function getWeekOfMonth(date: DateArg & {}, options?: GetWeekOfMonthOptions): number { const defaultOptions = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? @@ -41,10 +41,10 @@ export function getWeekOfMonth( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const currentDayOfMonth = getDate(date); + const currentDayOfMonth = getDate(toDate(date, options?.in)); if (isNaN(currentDayOfMonth)) return NaN; - const startWeekDay = getDay(startOfMonth(date)); + const startWeekDay = getDay(startOfMonth(date, options)); let lastDayOfFirstWeek = weekStartsOn - startWeekDay; if (lastDayOfFirstWeek <= 0) lastDayOfFirstWeek += 7; @@ -52,3 +52,5 @@ export function getWeekOfMonth( const remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek; return Math.ceil(remainingDaysAfterFirstWeek / 7) + 1; } + +/* eslint-enable */ diff --git a/src/date-fns/getWeekYear/index.ts b/src/date-fns/getWeekYear/index.ts index f14600b..b578681 100644 --- a/src/date-fns/getWeekYear/index.ts +++ b/src/date-fns/getWeekYear/index.ts @@ -1,13 +1,21 @@ -import { constructFrom } from '../constructFrom/index'; -import { startOfWeek } from '../startOfWeek/index'; -import { toDate } from '../toDate/index'; -import type { FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link getWeekYear} function options. */ -export interface GetWeekYearOptions extends LocalizedOptions<'options'>, WeekOptions, FirstWeekContainsDateOptions {} +export interface GetWeekYearOptions + extends LocalizedOptions<'options'>, + WeekOptions, + FirstWeekContainsDateOptions, + ContextOptions {} /** * @name getWeekYear @@ -23,8 +31,6 @@ export interface GetWeekYearOptions extends LocalizedOptions<'options'>, WeekOpt * * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - An object with options. * @@ -45,11 +51,8 @@ export interface GetWeekYearOptions extends LocalizedOptions<'options'>, WeekOpt * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) * //=> 2004 */ -export function getWeekYear( - date: DateType | number | string, - options?: GetWeekYearOptions, -): number { - const _date = toDate(date); +export function getWeekYear(date: DateArg & {}, options?: GetWeekYearOptions): number { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const defaultOptions = getDefaultOptions(); @@ -60,21 +63,23 @@ export function getWeekYear( defaultOptions.locale?.options?.firstWeekContainsDate ?? 1; - const firstWeekOfNextYear = constructFrom(date, 0); + const firstWeekOfNextYear = constructFrom(options?.in || date, 0); firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setHours(0, 0, 0, 0); const startOfNextYear = startOfWeek(firstWeekOfNextYear, options); - const firstWeekOfThisYear = constructFrom(date, 0); + const firstWeekOfThisYear = constructFrom(options?.in || date, 0); firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setHours(0, 0, 0, 0); const startOfThisYear = startOfWeek(firstWeekOfThisYear, options); - if (_date.getTime() >= startOfNextYear.getTime()) { + if (+_date >= +startOfNextYear) { return year + 1; - } else if (_date.getTime() >= startOfThisYear.getTime()) { + } else if (+_date >= +startOfThisYear) { return year; } else { return year - 1; } } + +/* eslint-enable */ diff --git a/src/date-fns/getWeeksInMonth/index.ts b/src/date-fns/getWeeksInMonth/index.ts index b715c3b..6131ebf 100644 --- a/src/date-fns/getWeeksInMonth/index.ts +++ b/src/date-fns/getWeeksInMonth/index.ts @@ -1,12 +1,17 @@ -import { differenceInCalendarWeeks } from '../differenceInCalendarWeeks/index'; -import { lastDayOfMonth } from '../lastDayOfMonth/index'; -import { startOfMonth } from '../startOfMonth/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { differenceInCalendarWeeks } from '../differenceInCalendarWeeks/index.ts'; +import { lastDayOfMonth } from '../lastDayOfMonth/index.ts'; +import { startOfMonth } from '../startOfMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link getWeeksInMonth} function options. */ -export interface GetWeeksInMonthOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface GetWeeksInMonthOptions extends LocalizedOptions<'options'>, WeekOptions, ContextOptions {} /** * @name getWeeksInMonth @@ -16,8 +21,6 @@ export interface GetWeeksInMonthOptions extends LocalizedOptions<'options'>, Wee * @description * Get the number of calendar weeks the month in the given date spans. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date * @param options - An object with options. * @@ -34,9 +37,11 @@ export interface GetWeeksInMonthOptions extends LocalizedOptions<'options'>, Wee * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) * //=> 6 */ -export function getWeeksInMonth( - date: DateType | number | string, - options?: GetWeeksInMonthOptions, -): number { - return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1; +export function getWeeksInMonth(date: DateArg & {}, options?: GetWeeksInMonthOptions | undefined): number { + const contextDate = toDate(date, options?.in); + return ( + differenceInCalendarWeeks(lastDayOfMonth(contextDate, options), startOfMonth(contextDate, options), options) + 1 + ); } + +/* eslint-enable */ diff --git a/src/date-fns/getYear/index.ts b/src/date-fns/getYear/index.ts index e3a41a1..98d5ff8 100644 --- a/src/date-fns/getYear/index.ts +++ b/src/date-fns/getYear/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link getYear} function options. + */ +export interface GetYearOptions extends ContextOptions {} /** * @name getYear @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Get the year of the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The given date + * @param options - An object with options * * @returns The year * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = getYear(new Date(2014, 6, 2)) * //=> 2014 */ -export function getYear(date: DateType | number | string): number { - return toDate(date).getFullYear(); +export function getYear(date: DateArg & {}, options?: GetYearOptions | undefined): number { + return toDate(date, options?.in).getFullYear(); } + +/* eslint-enable */ diff --git a/src/date-fns/hoursToMilliseconds/index.ts b/src/date-fns/hoursToMilliseconds/index.ts index f4ffe08..fe10606 100644 --- a/src/date-fns/hoursToMilliseconds/index.ts +++ b/src/date-fns/hoursToMilliseconds/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInHour } from '../constants/index.ts'; /** * @name hoursToMilliseconds @@ -8,8 +12,6 @@ import { millisecondsInHour } from '../constants/index'; * @description * Convert a number of hours to a full number of milliseconds. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param hours - number of hours to be converted * * @returns The number of hours converted to milliseconds @@ -22,3 +24,5 @@ import { millisecondsInHour } from '../constants/index'; export function hoursToMilliseconds(hours: number): number { return Math.trunc(hours * millisecondsInHour); } + +/* eslint-enable */ diff --git a/src/date-fns/hoursToMinutes/index.ts b/src/date-fns/hoursToMinutes/index.ts index 52e1d12..f517638 100644 --- a/src/date-fns/hoursToMinutes/index.ts +++ b/src/date-fns/hoursToMinutes/index.ts @@ -1,4 +1,8 @@ -import { minutesInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { minutesInHour } from '../constants/index.ts'; /** * @name hoursToMinutes @@ -8,8 +12,6 @@ import { minutesInHour } from '../constants/index'; * @description * Convert a number of hours to a full number of minutes. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param hours - number of hours to be converted * * @returns The number of hours converted in minutes @@ -22,3 +24,5 @@ import { minutesInHour } from '../constants/index'; export function hoursToMinutes(hours: number): number { return Math.trunc(hours * minutesInHour); } + +/* eslint-enable */ diff --git a/src/date-fns/hoursToSeconds/index.ts b/src/date-fns/hoursToSeconds/index.ts index 2fe0dd5..edf21f3 100644 --- a/src/date-fns/hoursToSeconds/index.ts +++ b/src/date-fns/hoursToSeconds/index.ts @@ -1,4 +1,8 @@ -import { secondsInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { secondsInHour } from '../constants/index.ts'; /** * @name hoursToSeconds @@ -8,8 +12,6 @@ import { secondsInHour } from '../constants/index'; * @description * Convert a number of hours to a full number of seconds. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param hours - The number of hours to be converted * * @returns The number of hours converted in seconds @@ -22,3 +24,5 @@ import { secondsInHour } from '../constants/index'; export function hoursToSeconds(hours: number): number { return Math.trunc(hours * secondsInHour); } + +/* eslint-enable */ diff --git a/src/date-fns/index.ts b/src/date-fns/index.ts old mode 100755 new mode 100644 index cdf4d54..4f4cb3d --- a/src/date-fns/index.ts +++ b/src/date-fns/index.ts @@ -1,248 +1,254 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + // This file is generated automatically by `scripts/build/indices.ts`. Please, don't change it. -export * from './add/index'; -export * from './addBusinessDays/index'; -export * from './addDays/index'; -export * from './addHours/index'; -export * from './addISOWeekYears/index'; -export * from './addMilliseconds/index'; -export * from './addMinutes/index'; -export * from './addMonths/index'; -export * from './addQuarters/index'; -export * from './addSeconds/index'; -export * from './addWeeks/index'; -export * from './addYears/index'; -export * from './areIntervalsOverlapping/index'; -export * from './clamp/index'; -export * from './closestIndexTo/index'; -export * from './closestTo/index'; -export * from './compareAsc/index'; -export * from './compareDesc/index'; -export * from './constructFrom/index'; -export * from './constructNow/index'; -export * from './daysToWeeks/index'; -export * from './differenceInBusinessDays/index'; -export * from './differenceInCalendarDays/index'; -export * from './differenceInCalendarISOWeekYears/index'; -export * from './differenceInCalendarISOWeeks/index'; -export * from './differenceInCalendarMonths/index'; -export * from './differenceInCalendarQuarters/index'; -export * from './differenceInCalendarWeeks/index'; -export * from './differenceInCalendarYears/index'; -export * from './differenceInDays/index'; -export * from './differenceInHours/index'; -export * from './differenceInISOWeekYears/index'; -export * from './differenceInMilliseconds/index'; -export * from './differenceInMinutes/index'; -export * from './differenceInMonths/index'; -export * from './differenceInQuarters/index'; -export * from './differenceInSeconds/index'; -export * from './differenceInWeeks/index'; -export * from './differenceInYears/index'; -export * from './eachDayOfInterval/index'; -export * from './eachHourOfInterval/index'; -export * from './eachMinuteOfInterval/index'; -export * from './eachMonthOfInterval/index'; -export * from './eachQuarterOfInterval/index'; -export * from './eachWeekOfInterval/index'; -export * from './eachWeekendOfInterval/index'; -export * from './eachWeekendOfMonth/index'; -export * from './eachWeekendOfYear/index'; -export * from './eachYearOfInterval/index'; -export * from './endOfDay/index'; -export * from './endOfDecade/index'; -export * from './endOfHour/index'; -export * from './endOfISOWeek/index'; -export * from './endOfISOWeekYear/index'; -export * from './endOfMinute/index'; -export * from './endOfMonth/index'; -export * from './endOfQuarter/index'; -export * from './endOfSecond/index'; -export * from './endOfToday/index'; -export * from './endOfTomorrow/index'; -export * from './endOfWeek/index'; -export * from './endOfYear/index'; -export * from './endOfYesterday/index'; -export * from './format/index'; -export * from './formatDistance/index'; -export * from './formatDistanceStrict/index'; -export * from './formatDistanceToNow/index'; -export * from './formatDistanceToNowStrict/index'; -export * from './formatDuration/index'; -export * from './formatISO/index'; -export * from './formatISO9075/index'; -export * from './formatISODuration/index'; -export * from './formatRFC3339/index'; -export * from './formatRFC7231/index'; -export * from './formatRelative/index'; -export * from './fromUnixTime/index'; -export * from './getDate/index'; -export * from './getDay/index'; -export * from './getDayOfYear/index'; -export * from './getDaysInMonth/index'; -export * from './getDaysInYear/index'; -export * from './getDecade/index'; -export * from './getDefaultOptions/index'; -export * from './getHours/index'; -export * from './getISODay/index'; -export * from './getISOWeek/index'; -export * from './getISOWeekYear/index'; -export * from './getISOWeeksInYear/index'; -export * from './getMilliseconds/index'; -export * from './getMinutes/index'; -export * from './getMonth/index'; -export * from './getOverlappingDaysInIntervals/index'; -export * from './getQuarter/index'; -export * from './getSeconds/index'; -export * from './getTime/index'; -export * from './getUnixTime/index'; -export * from './getWeek/index'; -export * from './getWeekOfMonth/index'; -export * from './getWeekYear/index'; -export * from './getWeeksInMonth/index'; -export * from './getYear/index'; -export * from './hoursToMilliseconds/index'; -export * from './hoursToMinutes/index'; -export * from './hoursToSeconds/index'; -export * from './interval/index'; -export * from './intervalToDuration/index'; -export * from './intlFormat/index'; -export * from './intlFormatDistance/index'; -export * from './isAfter/index'; -export * from './isBefore/index'; -export * from './isDate/index'; -export * from './isEqual/index'; -export * from './isExists/index'; -export * from './isFirstDayOfMonth/index'; -export * from './isFriday/index'; -export * from './isFuture/index'; -export * from './isLastDayOfMonth/index'; -export * from './isLeapYear/index'; -export * from './isMatch/index'; -export * from './isMonday/index'; -export * from './isPast/index'; -export * from './isSameDay/index'; -export * from './isSameHour/index'; -export * from './isSameISOWeek/index'; -export * from './isSameISOWeekYear/index'; -export * from './isSameMinute/index'; -export * from './isSameMonth/index'; -export * from './isSameQuarter/index'; -export * from './isSameSecond/index'; -export * from './isSameWeek/index'; -export * from './isSameYear/index'; -export * from './isSaturday/index'; -export * from './isSunday/index'; -export * from './isThisHour/index'; -export * from './isThisISOWeek/index'; -export * from './isThisMinute/index'; -export * from './isThisMonth/index'; -export * from './isThisQuarter/index'; -export * from './isThisSecond/index'; -export * from './isThisWeek/index'; -export * from './isThisYear/index'; -export * from './isThursday/index'; -export * from './isToday/index'; -export * from './isTomorrow/index'; -export * from './isTuesday/index'; -export * from './isValid/index'; -export * from './isWednesday/index'; -export * from './isWeekend/index'; -export * from './isWithinInterval/index'; -export * from './isYesterday/index'; -export * from './lastDayOfDecade/index'; -export * from './lastDayOfISOWeek/index'; -export * from './lastDayOfISOWeekYear/index'; -export * from './lastDayOfMonth/index'; -export * from './lastDayOfQuarter/index'; -export * from './lastDayOfWeek/index'; -export * from './lastDayOfYear/index'; -export * from './lightFormat/index'; -export * from './max/index'; -export * from './milliseconds/index'; -export * from './millisecondsToHours/index'; -export * from './millisecondsToMinutes/index'; -export * from './millisecondsToSeconds/index'; -export * from './min/index'; -export * from './minutesToHours/index'; -export * from './minutesToMilliseconds/index'; -export * from './minutesToSeconds/index'; -export * from './monthsToQuarters/index'; -export * from './monthsToYears/index'; -export * from './nextDay/index'; -export * from './nextFriday/index'; -export * from './nextMonday/index'; -export * from './nextSaturday/index'; -export * from './nextSunday/index'; -export * from './nextThursday/index'; -export * from './nextTuesday/index'; -export * from './nextWednesday/index'; -export * from './parse/index'; -export * from './parseISO/index'; -export * from './parseJSON/index'; -export * from './previousDay/index'; -export * from './previousFriday/index'; -export * from './previousMonday/index'; -export * from './previousSaturday/index'; -export * from './previousSunday/index'; -export * from './previousThursday/index'; -export * from './previousTuesday/index'; -export * from './previousWednesday/index'; -export * from './quartersToMonths/index'; -export * from './quartersToYears/index'; -export * from './roundToNearestHours/index'; -export * from './roundToNearestMinutes/index'; -export * from './secondsToHours/index'; -export * from './secondsToMilliseconds/index'; -export * from './secondsToMinutes/index'; -export * from './set/index'; -export * from './setDate/index'; -export * from './setDay/index'; -export * from './setDayOfYear/index'; -export * from './setDefaultOptions/index'; -export * from './setHours/index'; -export * from './setISODay/index'; -export * from './setISOWeek/index'; -export * from './setISOWeekYear/index'; -export * from './setMilliseconds/index'; -export * from './setMinutes/index'; -export * from './setMonth/index'; -export * from './setQuarter/index'; -export * from './setSeconds/index'; -export * from './setWeek/index'; -export * from './setWeekYear/index'; -export * from './setYear/index'; -export * from './startOfDay/index'; -export * from './startOfDecade/index'; -export * from './startOfHour/index'; -export * from './startOfISOWeek/index'; -export * from './startOfISOWeekYear/index'; -export * from './startOfMinute/index'; -export * from './startOfMonth/index'; -export * from './startOfQuarter/index'; -export * from './startOfSecond/index'; -export * from './startOfToday/index'; -export * from './startOfTomorrow/index'; -export * from './startOfWeek/index'; -export * from './startOfWeekYear/index'; -export * from './startOfYear/index'; -export * from './startOfYesterday/index'; -export * from './sub/index'; -export * from './subBusinessDays/index'; -export * from './subDays/index'; -export * from './subHours/index'; -export * from './subISOWeekYears/index'; -export * from './subMilliseconds/index'; -export * from './subMinutes/index'; -export * from './subMonths/index'; -export * from './subQuarters/index'; -export * from './subSeconds/index'; -export * from './subWeeks/index'; -export * from './subYears/index'; -export * from './toDate/index'; -export * from './transpose/index'; -export * from './weeksToDays/index'; -export * from './yearsToDays/index'; -export * from './yearsToMonths/index'; -export * from './yearsToQuarters/index'; -export type * from './types'; +export * from './add/index.ts'; +export * from './addBusinessDays/index.ts'; +export * from './addDays/index.ts'; +export * from './addHours/index.ts'; +export * from './addISOWeekYears/index.ts'; +export * from './addMilliseconds/index.ts'; +export * from './addMinutes/index.ts'; +export * from './addMonths/index.ts'; +export * from './addQuarters/index.ts'; +export * from './addSeconds/index.ts'; +export * from './addWeeks/index.ts'; +export * from './addYears/index.ts'; +export * from './areIntervalsOverlapping/index.ts'; +export * from './clamp/index.ts'; +export * from './closestIndexTo/index.ts'; +export * from './closestTo/index.ts'; +export * from './compareAsc/index.ts'; +export * from './compareDesc/index.ts'; +export * from './constructFrom/index.ts'; +export * from './constructNow/index.ts'; +export * from './daysToWeeks/index.ts'; +export * from './differenceInBusinessDays/index.ts'; +export * from './differenceInCalendarDays/index.ts'; +export * from './differenceInCalendarISOWeekYears/index.ts'; +export * from './differenceInCalendarISOWeeks/index.ts'; +export * from './differenceInCalendarMonths/index.ts'; +export * from './differenceInCalendarQuarters/index.ts'; +export * from './differenceInCalendarWeeks/index.ts'; +export * from './differenceInCalendarYears/index.ts'; +export * from './differenceInDays/index.ts'; +export * from './differenceInHours/index.ts'; +export * from './differenceInISOWeekYears/index.ts'; +export * from './differenceInMilliseconds/index.ts'; +export * from './differenceInMinutes/index.ts'; +export * from './differenceInMonths/index.ts'; +export * from './differenceInQuarters/index.ts'; +export * from './differenceInSeconds/index.ts'; +export * from './differenceInWeeks/index.ts'; +export * from './differenceInYears/index.ts'; +export * from './eachDayOfInterval/index.ts'; +export * from './eachHourOfInterval/index.ts'; +export * from './eachMinuteOfInterval/index.ts'; +export * from './eachMonthOfInterval/index.ts'; +export * from './eachQuarterOfInterval/index.ts'; +export * from './eachWeekOfInterval/index.ts'; +export * from './eachWeekendOfInterval/index.ts'; +export * from './eachWeekendOfMonth/index.ts'; +export * from './eachWeekendOfYear/index.ts'; +export * from './eachYearOfInterval/index.ts'; +export * from './endOfDay/index.ts'; +export * from './endOfDecade/index.ts'; +export * from './endOfHour/index.ts'; +export * from './endOfISOWeek/index.ts'; +export * from './endOfISOWeekYear/index.ts'; +export * from './endOfMinute/index.ts'; +export * from './endOfMonth/index.ts'; +export * from './endOfQuarter/index.ts'; +export * from './endOfSecond/index.ts'; +export * from './endOfToday/index.ts'; +export * from './endOfTomorrow/index.ts'; +export * from './endOfWeek/index.ts'; +export * from './endOfYear/index.ts'; +export * from './endOfYesterday/index.ts'; +export * from './format/index.ts'; +export * from './formatDistance/index.ts'; +export * from './formatDistanceStrict/index.ts'; +export * from './formatDistanceToNow/index.ts'; +export * from './formatDistanceToNowStrict/index.ts'; +export * from './formatDuration/index.ts'; +export * from './formatISO/index.ts'; +export * from './formatISO9075/index.ts'; +export * from './formatISODuration/index.ts'; +export * from './formatRFC3339/index.ts'; +export * from './formatRFC7231/index.ts'; +export * from './formatRelative/index.ts'; +export * from './fromUnixTime/index.ts'; +export * from './getDate/index.ts'; +export * from './getDay/index.ts'; +export * from './getDayOfYear/index.ts'; +export * from './getDaysInMonth/index.ts'; +export * from './getDaysInYear/index.ts'; +export * from './getDecade/index.ts'; +export * from './getDefaultOptions/index.ts'; +export * from './getHours/index.ts'; +export * from './getISODay/index.ts'; +export * from './getISOWeek/index.ts'; +export * from './getISOWeekYear/index.ts'; +export * from './getISOWeeksInYear/index.ts'; +export * from './getMilliseconds/index.ts'; +export * from './getMinutes/index.ts'; +export * from './getMonth/index.ts'; +export * from './getOverlappingDaysInIntervals/index.ts'; +export * from './getQuarter/index.ts'; +export * from './getSeconds/index.ts'; +export * from './getTime/index.ts'; +export * from './getUnixTime/index.ts'; +export * from './getWeek/index.ts'; +export * from './getWeekOfMonth/index.ts'; +export * from './getWeekYear/index.ts'; +export * from './getWeeksInMonth/index.ts'; +export * from './getYear/index.ts'; +export * from './hoursToMilliseconds/index.ts'; +export * from './hoursToMinutes/index.ts'; +export * from './hoursToSeconds/index.ts'; +export * from './interval/index.ts'; +export * from './intervalToDuration/index.ts'; +export * from './intlFormat/index.ts'; +export * from './intlFormatDistance/index.ts'; +export * from './isAfter/index.ts'; +export * from './isBefore/index.ts'; +export * from './isDate/index.ts'; +export * from './isEqual/index.ts'; +export * from './isExists/index.ts'; +export * from './isFirstDayOfMonth/index.ts'; +export * from './isFriday/index.ts'; +export * from './isFuture/index.ts'; +export * from './isLastDayOfMonth/index.ts'; +export * from './isLeapYear/index.ts'; +export * from './isMatch/index.ts'; +export * from './isMonday/index.ts'; +export * from './isPast/index.ts'; +export * from './isSameDay/index.ts'; +export * from './isSameHour/index.ts'; +export * from './isSameISOWeek/index.ts'; +export * from './isSameISOWeekYear/index.ts'; +export * from './isSameMinute/index.ts'; +export * from './isSameMonth/index.ts'; +export * from './isSameQuarter/index.ts'; +export * from './isSameSecond/index.ts'; +export * from './isSameWeek/index.ts'; +export * from './isSameYear/index.ts'; +export * from './isSaturday/index.ts'; +export * from './isSunday/index.ts'; +export * from './isThisHour/index.ts'; +export * from './isThisISOWeek/index.ts'; +export * from './isThisMinute/index.ts'; +export * from './isThisMonth/index.ts'; +export * from './isThisQuarter/index.ts'; +export * from './isThisSecond/index.ts'; +export * from './isThisWeek/index.ts'; +export * from './isThisYear/index.ts'; +export * from './isThursday/index.ts'; +export * from './isToday/index.ts'; +export * from './isTomorrow/index.ts'; +export * from './isTuesday/index.ts'; +export * from './isValid/index.ts'; +export * from './isWednesday/index.ts'; +export * from './isWeekend/index.ts'; +export * from './isWithinInterval/index.ts'; +export * from './isYesterday/index.ts'; +export * from './lastDayOfDecade/index.ts'; +export * from './lastDayOfISOWeek/index.ts'; +export * from './lastDayOfISOWeekYear/index.ts'; +export * from './lastDayOfMonth/index.ts'; +export * from './lastDayOfQuarter/index.ts'; +export * from './lastDayOfWeek/index.ts'; +export * from './lastDayOfYear/index.ts'; +export * from './lightFormat/index.ts'; +export * from './max/index.ts'; +export * from './milliseconds/index.ts'; +export * from './millisecondsToHours/index.ts'; +export * from './millisecondsToMinutes/index.ts'; +export * from './millisecondsToSeconds/index.ts'; +export * from './min/index.ts'; +export * from './minutesToHours/index.ts'; +export * from './minutesToMilliseconds/index.ts'; +export * from './minutesToSeconds/index.ts'; +export * from './monthsToQuarters/index.ts'; +export * from './monthsToYears/index.ts'; +export * from './nextDay/index.ts'; +export * from './nextFriday/index.ts'; +export * from './nextMonday/index.ts'; +export * from './nextSaturday/index.ts'; +export * from './nextSunday/index.ts'; +export * from './nextThursday/index.ts'; +export * from './nextTuesday/index.ts'; +export * from './nextWednesday/index.ts'; +export * from './parse/index.ts'; +export * from './parseISO/index.ts'; +export * from './parseJSON/index.ts'; +export * from './previousDay/index.ts'; +export * from './previousFriday/index.ts'; +export * from './previousMonday/index.ts'; +export * from './previousSaturday/index.ts'; +export * from './previousSunday/index.ts'; +export * from './previousThursday/index.ts'; +export * from './previousTuesday/index.ts'; +export * from './previousWednesday/index.ts'; +export * from './quartersToMonths/index.ts'; +export * from './quartersToYears/index.ts'; +export * from './roundToNearestHours/index.ts'; +export * from './roundToNearestMinutes/index.ts'; +export * from './secondsToHours/index.ts'; +export * from './secondsToMilliseconds/index.ts'; +export * from './secondsToMinutes/index.ts'; +export * from './set/index.ts'; +export * from './setDate/index.ts'; +export * from './setDay/index.ts'; +export * from './setDayOfYear/index.ts'; +export * from './setDefaultOptions/index.ts'; +export * from './setHours/index.ts'; +export * from './setISODay/index.ts'; +export * from './setISOWeek/index.ts'; +export * from './setISOWeekYear/index.ts'; +export * from './setMilliseconds/index.ts'; +export * from './setMinutes/index.ts'; +export * from './setMonth/index.ts'; +export * from './setQuarter/index.ts'; +export * from './setSeconds/index.ts'; +export * from './setWeek/index.ts'; +export * from './setWeekYear/index.ts'; +export * from './setYear/index.ts'; +export * from './startOfDay/index.ts'; +export * from './startOfDecade/index.ts'; +export * from './startOfHour/index.ts'; +export * from './startOfISOWeek/index.ts'; +export * from './startOfISOWeekYear/index.ts'; +export * from './startOfMinute/index.ts'; +export * from './startOfMonth/index.ts'; +export * from './startOfQuarter/index.ts'; +export * from './startOfSecond/index.ts'; +export * from './startOfToday/index.ts'; +export * from './startOfTomorrow/index.ts'; +export * from './startOfWeek/index.ts'; +export * from './startOfWeekYear/index.ts'; +export * from './startOfYear/index.ts'; +export * from './startOfYesterday/index.ts'; +export * from './sub/index.ts'; +export * from './subBusinessDays/index.ts'; +export * from './subDays/index.ts'; +export * from './subHours/index.ts'; +export * from './subISOWeekYears/index.ts'; +export * from './subMilliseconds/index.ts'; +export * from './subMinutes/index.ts'; +export * from './subMonths/index.ts'; +export * from './subQuarters/index.ts'; +export * from './subSeconds/index.ts'; +export * from './subWeeks/index.ts'; +export * from './subYears/index.ts'; +export * from './toDate/index.ts'; +export * from './transpose/index.ts'; +export * from './weeksToDays/index.ts'; +export * from './yearsToDays/index.ts'; +export * from './yearsToMonths/index.ts'; +export * from './yearsToQuarters/index.ts'; +export type * from './types.ts'; + +/* eslint-enable */ diff --git a/src/date-fns/interval/index.ts b/src/date-fns/interval/index.ts index c544e61..992cc2d 100644 --- a/src/date-fns/interval/index.ts +++ b/src/date-fns/interval/index.ts @@ -1,14 +1,38 @@ -import { toDate } from '../toDate/index'; -import type { NormalizedInterval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import type { ContextOptions, DateArg, NormalizedInterval } from '../types.ts'; /** * The {@link interval} function options. */ -export interface IntervalOptions { +export interface IntervalOptions extends ContextOptions { /** Asserts that the interval is positive (start is after the end). */ assertPositive?: boolean; } +/** + * The {@link interval} function result type. It resolves the proper data type. + * It uses the first argument date object type, starting from the start argument, + * then the end interval date. If a context function is passed, it uses the context + * function return type. + */ +export type IntervalResult< + StartDate extends DateArg, + EndDate extends DateArg, + Options extends IntervalOptions | undefined = undefined, +> = NormalizedInterval< + Options extends IntervalOptions + ? DateType + : StartDate extends Date + ? StartDate + : EndDate extends Date + ? EndDate + : Date +>; + /** * @name interval * @category Interval Helpers @@ -17,7 +41,9 @@ export interface IntervalOptions { * @description * Creates a normalized interval object and validates its values. If the interval is invalid, an exception is thrown. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam StartDate - Start date type. + * @typeParam EndDate - End date type. + * @typeParam Options - Options type. * * @param start - The start of the interval. * @param end - The end of the interval. @@ -29,18 +55,19 @@ export interface IntervalOptions { * * @returns The normalized and validated interval object. */ -export function interval( - start: DateType | number | string, - end: DateType | number | string, - options?: IntervalOptions, -): NormalizedInterval { - const _start = toDate(start); - if (isNaN(+_start)) throw new TypeError('Start date is invalid'); +export function interval< + StartDate extends DateArg, + EndDate extends DateArg, + Options extends IntervalOptions | undefined = undefined, +>(start: StartDate, end: EndDate, options?: Options): IntervalResult { + const [_start, _end] = normalizeDates(options?.in, start, end); - const _end = toDate(end); + if (isNaN(+_start)) throw new TypeError('Start date is invalid'); if (isNaN(+_end)) throw new TypeError('End date is invalid'); if (options?.assertPositive && +_start > +_end) throw new TypeError('End date must be after start date'); - return { start: _start, end: _end }; + return { start: _start, end: _end } as IntervalResult; } + +/* eslint-enable */ diff --git a/src/date-fns/intervalToDuration/index.ts b/src/date-fns/intervalToDuration/index.ts index 6a4e9b7..04f7310 100644 --- a/src/date-fns/intervalToDuration/index.ts +++ b/src/date-fns/intervalToDuration/index.ts @@ -1,12 +1,21 @@ -import { add } from '../add/index'; -import { differenceInDays } from '../differenceInDays/index'; -import { differenceInHours } from '../differenceInHours/index'; -import { differenceInMinutes } from '../differenceInMinutes/index'; -import { differenceInMonths } from '../differenceInMonths/index'; -import { differenceInSeconds } from '../differenceInSeconds/index'; -import { differenceInYears } from '../differenceInYears/index'; -import { toDate } from '../toDate/index'; -import type { Duration, Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeInterval } from '../_lib/normalizeInterval/index.ts'; +import { add } from '../add/index.ts'; +import { differenceInDays } from '../differenceInDays/index.ts'; +import { differenceInHours } from '../differenceInHours/index.ts'; +import { differenceInMinutes } from '../differenceInMinutes/index.ts'; +import { differenceInMonths } from '../differenceInMonths/index.ts'; +import { differenceInSeconds } from '../differenceInSeconds/index.ts'; +import { differenceInYears } from '../differenceInYears/index.ts'; +import type { ContextOptions, Duration, Interval } from '../types.ts'; + +/** + * The {@link intervalToDuration} function options. + */ +export interface IntervalToDurationOptions extends ContextOptions {} /** * @name intervalToDuration @@ -14,11 +23,10 @@ import type { Duration, Interval } from '../types'; * @summary Convert interval to duration * * @description - * Convert a interval object to a duration object. - * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * Convert an interval object to a duration object. * * @param interval - The interval to convert to duration + * @param options - The context options * * @returns The duration object * @@ -27,43 +35,37 @@ import type { Duration, Interval } from '../types'; * intervalToDuration({ * start: new Date(1929, 0, 15, 12, 0, 0), * end: new Date(1968, 3, 4, 19, 5, 0) - * }) - * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } + * }); + * //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } */ -export function intervalToDuration(interval: Interval): Duration { - const start = toDate(interval.start); - const end = toDate(interval.end); - +export function intervalToDuration(interval: Interval, options?: IntervalToDurationOptions | undefined): Duration { + const { start, end } = normalizeInterval(options?.in, interval); const duration: Duration = {}; const years = differenceInYears(end, start); if (years) duration.years = years; - // @ts-ignore const remainingMonths = add(start, { years: duration.years }); - const months = differenceInMonths(end, remainingMonths); if (months) duration.months = months; - const remainingDays = add(remainingMonths, { months: duration.months! }); - + const remainingDays = add(remainingMonths, { months: duration.months }); const days = differenceInDays(end, remainingDays); if (days) duration.days = days; - const remainingHours = add(remainingDays, { days: duration.days! }); - + const remainingHours = add(remainingDays, { days: duration.days }); const hours = differenceInHours(end, remainingHours); if (hours) duration.hours = hours; - const remainingMinutes = add(remainingHours, { hours: duration.hours! }); - + const remainingMinutes = add(remainingHours, { hours: duration.hours }); const minutes = differenceInMinutes(end, remainingMinutes); if (minutes) duration.minutes = minutes; - const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes! }); - + const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes }); const seconds = differenceInSeconds(end, remainingSeconds); if (seconds) duration.seconds = seconds; return duration; } + +/* eslint-enable */ diff --git a/src/date-fns/intlFormat/index.ts b/src/date-fns/intlFormat/index.ts index 840f512..07b62a1 100644 --- a/src/date-fns/intlFormat/index.ts +++ b/src/date-fns/intlFormat/index.ts @@ -1,7 +1,15 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg, MaybeArray } from '../types.ts'; /** * The locale string (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). + * @deprecated + * + * [TODO] Remove in v4 */ export type IntlFormatLocale = Intl.ResolvedDateTimeFormatOptions['locale']; @@ -14,8 +22,8 @@ export type IntlFormatFormatOptions = Intl.DateTimeFormatOptions; * The locale options. */ export interface IntlFormatLocaleOptions { - /** The locale(s) to use (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument) */ - locale: IntlFormatLocale | IntlFormatLocale[]; + /** The locales to use (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument) */ + locale: MaybeArray; } /** @@ -30,8 +38,6 @@ export interface IntlFormatLocaleOptions { * * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to format * * @returns The formatted date string @@ -43,11 +49,9 @@ export interface IntlFormatLocaleOptions { * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456)) * //=> 10/4/2019 */ -export function intlFormat(date: DateType | number | string): string; +export function intlFormat(date: DateArg & {}): string; /** - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to format * @param localeOptions - An object with locale * @@ -63,14 +67,9 @@ export function intlFormat(date: DateType | number | stri * }) * //=> 2019. 10. 4. */ -export function intlFormat( - date: DateType | number | string, - localeOptions: IntlFormatLocaleOptions, -): string; +export function intlFormat(date: DateArg & {}, localeOptions: IntlFormatLocaleOptions): string; /** - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to format * @param formatOptions - The format options * @@ -89,14 +88,9 @@ export function intlFormat( * }) * //=> 10/4/2019, 12 PM */ -export function intlFormat( - date: DateType | number | string, - formatOptions: IntlFormatFormatOptions, -): string; +export function intlFormat(date: DateArg & {}, formatOptions: IntlFormatFormatOptions): string; /** - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to format * @param formatOptions - The format options * @param localeOptions - An object with locale @@ -118,14 +112,14 @@ export function intlFormat( * }) * //=> Freitag, 4. Oktober 2019 */ -export function intlFormat( - date: DateType | number | string, +export function intlFormat( + date: DateArg & {}, formatOptions: IntlFormatFormatOptions, localeOptions: IntlFormatLocaleOptions, ): string; -export function intlFormat( - date: DateType | number | string, +export function intlFormat( + date: DateArg & {}, formatOrLocale?: IntlFormatFormatOptions | IntlFormatLocaleOptions, localeOptions?: IntlFormatLocaleOptions, ): string { @@ -145,3 +139,5 @@ function isFormatOptions( ): opts is IntlFormatFormatOptions { return opts !== undefined && !('locale' in opts); } + +/* eslint-enable */ diff --git a/src/date-fns/intlFormatDistance/index.ts b/src/date-fns/intlFormatDistance/index.ts index b339545..737e6be 100644 --- a/src/date-fns/intlFormatDistance/index.ts +++ b/src/date-fns/intlFormatDistance/index.ts @@ -1,3 +1,8 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; import { secondsInDay, secondsInHour, @@ -6,31 +11,25 @@ import { secondsInQuarter, secondsInWeek, secondsInYear, -} from '../constants/index'; -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { differenceInCalendarMonths } from '../differenceInCalendarMonths/index'; -import { differenceInCalendarQuarters } from '../differenceInCalendarQuarters/index'; -import { differenceInCalendarWeeks } from '../differenceInCalendarWeeks/index'; -import { differenceInCalendarYears } from '../differenceInCalendarYears/index'; -import { differenceInHours } from '../differenceInHours/index'; -import { differenceInMinutes } from '../differenceInMinutes/index'; -import { differenceInSeconds } from '../differenceInSeconds/index'; -import { toDate } from '../toDate/index'; +} from '../constants/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { differenceInCalendarMonths } from '../differenceInCalendarMonths/index.ts'; +import { differenceInCalendarQuarters } from '../differenceInCalendarQuarters/index.ts'; +import { differenceInCalendarWeeks } from '../differenceInCalendarWeeks/index.ts'; +import { differenceInCalendarYears } from '../differenceInCalendarYears/index.ts'; +import { differenceInHours } from '../differenceInHours/index.ts'; +import { differenceInMinutes } from '../differenceInMinutes/index.ts'; +import { differenceInSeconds } from '../differenceInSeconds/index.ts'; +import type { ContextOptions, DateArg, MaybeArray } from '../types.ts'; /** * The {@link intlFormatDistance} function options. */ -export interface IntlFormatDistanceOptions { +export interface IntlFormatDistanceOptions extends Intl.RelativeTimeFormatOptions, ContextOptions { /** Force the distance unit */ unit?: IntlFormatDistanceUnit; - /** The locale(s) to use (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument) */ - locale?: Intl.UnicodeBCP47LocaleIdentifier | Intl.UnicodeBCP47LocaleIdentifier[]; - /** The locale matching algorithm to use. Other value: 'lookup'. See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) */ - localeMatcher?: Intl.RelativeTimeFormatLocaleMatcher; - /** The output message format. The values are 'auto' (e.g. `yesterday`), 'always'(e.g. `1 day ago`) */ - numeric?: Intl.RelativeTimeFormatNumeric; - /** The length of the result. The values are: 'long' (e.g. `1 month`), 'short' (e.g. 'in 1 mo.'), 'narrow' (e.g. 'in 1 mo.'). The narrow one could be similar to the short one for some locales. */ - style?: Intl.RelativeTimeFormatStyle; + /** The locales to use (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument) */ + locale?: MaybeArray; } /** @@ -68,10 +67,8 @@ export type IntlFormatDistanceUnit = 'year' | 'quarter' | 'month' | 'week' | 'da * | 1 year | last year | next year | * | 2+ years | X years ago | in X years | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param date - The date - * @param baseDate - The date to compare with. + * @param laterDate - The date + * @param earlierDate - The date to compare with. * @param options - An object with options. * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) * The narrow one could be similar to the short one for some locales. @@ -137,81 +134,85 @@ export type IntlFormatDistanceUnit = 'year' | 'quarter' | 'month' | 'week' | 'da * ) * //=> 'in 2 yr' */ -export function intlFormatDistance( - date: DateType | number | string, - baseDate: DateType | number | string, +export function intlFormatDistance( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: IntlFormatDistanceOptions, ): string { let value: number = 0; let unit: Intl.RelativeTimeFormatUnit; - const dateLeft = toDate(date); - const dateRight = toDate(baseDate); + + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); if (!options?.unit) { // Get the unit based on diffInSeconds calculations if no unit is specified - const diffInSeconds = differenceInSeconds(dateLeft, dateRight); // The smallest unit + const diffInSeconds = differenceInSeconds(laterDate_, earlierDate_); // The smallest unit if (Math.abs(diffInSeconds) < secondsInMinute) { - value = differenceInSeconds(dateLeft, dateRight); + value = differenceInSeconds(laterDate_, earlierDate_); unit = 'second'; } else if (Math.abs(diffInSeconds) < secondsInHour) { - value = differenceInMinutes(dateLeft, dateRight); + value = differenceInMinutes(laterDate_, earlierDate_); unit = 'minute'; - } else if (Math.abs(diffInSeconds) < secondsInDay && Math.abs(differenceInCalendarDays(dateLeft, dateRight)) < 1) { - value = differenceInHours(dateLeft, dateRight); + } else if ( + Math.abs(diffInSeconds) < secondsInDay && + Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)) < 1 + ) { + value = differenceInHours(laterDate_, earlierDate_); unit = 'hour'; } else if ( Math.abs(diffInSeconds) < secondsInWeek && - (value = differenceInCalendarDays(dateLeft, dateRight)) && + (value = differenceInCalendarDays(laterDate_, earlierDate_)) && Math.abs(value) < 7 ) { unit = 'day'; } else if (Math.abs(diffInSeconds) < secondsInMonth) { - value = differenceInCalendarWeeks(dateLeft, dateRight); + value = differenceInCalendarWeeks(laterDate_, earlierDate_); unit = 'week'; } else if (Math.abs(diffInSeconds) < secondsInQuarter) { - value = differenceInCalendarMonths(dateLeft, dateRight); + value = differenceInCalendarMonths(laterDate_, earlierDate_); unit = 'month'; } else if (Math.abs(diffInSeconds) < secondsInYear) { - if (differenceInCalendarQuarters(dateLeft, dateRight) < 4) { + if (differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) { // To filter out cases that are less than a year but match 4 quarters - value = differenceInCalendarQuarters(dateLeft, dateRight); + value = differenceInCalendarQuarters(laterDate_, earlierDate_); unit = 'quarter'; } else { - value = differenceInCalendarYears(dateLeft, dateRight); + value = differenceInCalendarYears(laterDate_, earlierDate_); unit = 'year'; } } else { - value = differenceInCalendarYears(dateLeft, dateRight); + value = differenceInCalendarYears(laterDate_, earlierDate_); unit = 'year'; } } else { // Get the value if unit is specified unit = options?.unit; if (unit === 'second') { - value = differenceInSeconds(dateLeft, dateRight); + value = differenceInSeconds(laterDate_, earlierDate_); } else if (unit === 'minute') { - value = differenceInMinutes(dateLeft, dateRight); + value = differenceInMinutes(laterDate_, earlierDate_); } else if (unit === 'hour') { - value = differenceInHours(dateLeft, dateRight); + value = differenceInHours(laterDate_, earlierDate_); } else if (unit === 'day') { - value = differenceInCalendarDays(dateLeft, dateRight); + value = differenceInCalendarDays(laterDate_, earlierDate_); } else if (unit === 'week') { - value = differenceInCalendarWeeks(dateLeft, dateRight); + value = differenceInCalendarWeeks(laterDate_, earlierDate_); } else if (unit === 'month') { - value = differenceInCalendarMonths(dateLeft, dateRight); + value = differenceInCalendarMonths(laterDate_, earlierDate_); } else if (unit === 'quarter') { - value = differenceInCalendarQuarters(dateLeft, dateRight); + value = differenceInCalendarQuarters(laterDate_, earlierDate_); } else if (unit === 'year') { - value = differenceInCalendarYears(dateLeft, dateRight); + value = differenceInCalendarYears(laterDate_, earlierDate_); } } const rtf = new Intl.RelativeTimeFormat(options?.locale, { - ...(options?.localeMatcher === undefined ? {} : { localeMatcher: options?.localeMatcher }), - numeric: options?.numeric || 'auto', - ...(options?.style === undefined ? {} : { style: options?.style }), + numeric: 'auto', + ...options, }); return rtf.format(value, unit); } + +/* eslint-enable */ diff --git a/src/date-fns/isAfter/index.ts b/src/date-fns/isAfter/index.ts index 3c69c91..dbd386c 100644 --- a/src/date-fns/isAfter/index.ts +++ b/src/date-fns/isAfter/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isAfter @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Is the first date after the second one? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date that should be after the other one to return true * @param dateToCompare - The date to compare with * @@ -20,11 +23,8 @@ import { toDate } from '../toDate/index'; * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) * //=> true */ -export function isAfter( - date: DateType | number | string, - dateToCompare: DateType | number | string, -): boolean { - const _date = toDate(date); - const _dateToCompare = toDate(dateToCompare); - return _date.getTime() > _dateToCompare.getTime(); +export function isAfter(date: DateArg & {}, dateToCompare: DateArg & {}): boolean { + return +toDate(date) > +toDate(dateToCompare); } + +/* eslint-enable */ diff --git a/src/date-fns/isBefore/index.ts b/src/date-fns/isBefore/index.ts index dbbe416..95d6c83 100644 --- a/src/date-fns/isBefore/index.ts +++ b/src/date-fns/isBefore/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isBefore @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Is the first date before the second one? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date that should be before the other one to return true * @param dateToCompare - The date to compare with * @@ -20,11 +23,8 @@ import { toDate } from '../toDate/index'; * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) * //=> false */ -export function isBefore( - date: DateType | number | string, - dateToCompare: DateType | number | string, -): boolean { - const _date = toDate(date); - const _dateToCompare = toDate(dateToCompare); - return +_date < +_dateToCompare; +export function isBefore(date: DateArg & {}, dateToCompare: DateArg & {}): boolean { + return +toDate(date) < +toDate(dateToCompare); } + +/* eslint-enable */ diff --git a/src/date-fns/isDate/index.ts b/src/date-fns/isDate/index.ts index 3c9f3b0..69c9ba0 100644 --- a/src/date-fns/isDate/index.ts +++ b/src/date-fns/isDate/index.ts @@ -1,3 +1,7 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** * @name isDate * @category Common Helpers @@ -35,3 +39,5 @@ export function isDate(value: unknown): value is Date { value instanceof Date || (typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]') ); } + +/* eslint-enable */ diff --git a/src/date-fns/isEqual/index.ts b/src/date-fns/isEqual/index.ts index a279196..7b1e9a3 100644 --- a/src/date-fns/isEqual/index.ts +++ b/src/date-fns/isEqual/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isEqual @@ -8,8 +13,6 @@ import { toDate } from '../toDate/index'; * @description * Are the given dates equal? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateLeft - The first date to compare * @param dateRight - The second date to compare * @@ -23,11 +26,8 @@ import { toDate } from '../toDate/index'; * ) * //=> false */ -export function isEqual( - leftDate: DateType | number | string, - rightDate: DateType | number | string, -): boolean { - const _dateLeft = toDate(leftDate); - const _dateRight = toDate(rightDate); - return +_dateLeft === +_dateRight; +export function isEqual(leftDate: DateArg & {}, rightDate: DateArg & {}): boolean { + return +toDate(leftDate) === +toDate(rightDate); } + +/* eslint-enable */ diff --git a/src/date-fns/isExists/index.ts b/src/date-fns/isExists/index.ts index bf51f19..60efdf5 100644 --- a/src/date-fns/isExists/index.ts +++ b/src/date-fns/isExists/index.ts @@ -1,3 +1,7 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + /** * @name isExists * @category Common Helpers @@ -26,3 +30,5 @@ export function isExists(year: number, month: number, day: number): boolean { const date = new Date(year, month, day); return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day; } + +/* eslint-enable */ diff --git a/src/date-fns/isFirstDayOfMonth/index.ts b/src/date-fns/isFirstDayOfMonth/index.ts index 3a37316..90a2b65 100644 --- a/src/date-fns/isFirstDayOfMonth/index.ts +++ b/src/date-fns/isFirstDayOfMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isFirstDayOfMonth} function options. + */ +export interface IsFirstDayOfMonthOptions extends ContextOptions {} /** * @name isFirstDayOfMonth @@ -8,10 +18,9 @@ import { toDate } from '../toDate/index'; * @description * Is the given date the first day of a month? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check - + * @param options - An object with options + * * @returns The date is the first day of a month * * @example @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isFirstDayOfMonth(new Date(2014, 8, 1)) * //=> true */ -export function isFirstDayOfMonth(date: DateType | number | string): boolean { - return toDate(date).getDate() === 1; +export function isFirstDayOfMonth(date: DateArg & {}, options?: IsFirstDayOfMonthOptions | undefined): boolean { + return toDate(date, options?.in).getDate() === 1; } + +/* eslint-enable */ diff --git a/src/date-fns/isFriday/index.ts b/src/date-fns/isFriday/index.ts index f7405f5..57a4170 100644 --- a/src/date-fns/isFriday/index.ts +++ b/src/date-fns/isFriday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isFriday} function options. + */ +export interface IsFridayOptions extends ContextOptions {} /** * @name isFriday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Friday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Friday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isFriday(new Date(2014, 8, 26)) * //=> true */ -export function isFriday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 5; +export function isFriday(date: DateArg & {}, options?: IsFridayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 5; } + +/* eslint-enable */ diff --git a/src/date-fns/isFuture/index.ts b/src/date-fns/isFuture/index.ts index c1dabbf..b576b81 100644 --- a/src/date-fns/isFuture/index.ts +++ b/src/date-fns/isFuture/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isFuture @@ -9,8 +14,6 @@ import { toDate } from '../toDate/index'; * @description * Is the given date in the future? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * * @returns The date is in the future @@ -20,6 +23,8 @@ import { toDate } from '../toDate/index'; * const result = isFuture(new Date(2014, 11, 31)) * //=> true */ -export function isFuture(date: DateType | number | string): boolean { +export function isFuture(date: DateArg & {}): boolean { return +toDate(date) > Date.now(); } + +/* eslint-enable */ diff --git a/src/date-fns/isLastDayOfMonth/index.ts b/src/date-fns/isLastDayOfMonth/index.ts index 3814e54..01d12f3 100644 --- a/src/date-fns/isLastDayOfMonth/index.ts +++ b/src/date-fns/isLastDayOfMonth/index.ts @@ -1,6 +1,13 @@ -import { endOfDay } from '../endOfDay/index'; -import { endOfMonth } from '../endOfMonth/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { endOfDay } from '../endOfDay/index.ts'; +import { endOfMonth } from '../endOfMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +export interface IsLastDayOfMonthOptions extends ContextOptions {} /** * @name isLastDayOfMonth @@ -10,10 +17,9 @@ import { toDate } from '../toDate/index'; * @description * Is the given date the last day of a month? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check - + * @param options - An object with options + * * @returns The date is the last day of a month * * @example @@ -21,7 +27,9 @@ import { toDate } from '../toDate/index'; * const result = isLastDayOfMonth(new Date(2014, 1, 28)) * //=> true */ -export function isLastDayOfMonth(date: DateType | number | string): boolean { - const _date = toDate(date); - return +endOfDay(_date) === +endOfMonth(_date); +export function isLastDayOfMonth(date: DateArg & {}, options?: IsLastDayOfMonthOptions | undefined): boolean { + const _date = toDate(date, options?.in); + return +endOfDay(_date, options) === +endOfMonth(_date, options); } + +/* eslint-enable */ diff --git a/src/date-fns/isLeapYear/index.ts b/src/date-fns/isLeapYear/index.ts index 25a6cf9..dc47a47 100644 --- a/src/date-fns/isLeapYear/index.ts +++ b/src/date-fns/isLeapYear/index.ts @@ -1,4 +1,11 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +export interface IsLeapYearOptions extends ContextOptions {} /** * @name isLeapYear @@ -8,9 +15,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date in the leap year? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - The options object * * @returns The date is in the leap year * @@ -19,8 +25,10 @@ import { toDate } from '../toDate/index'; * const result = isLeapYear(new Date(2012, 8, 1)) * //=> true */ -export function isLeapYear(date: DateType | number | string): boolean { - const _date = toDate(date); +export function isLeapYear(date: DateArg & {}, options?: IsLeapYearOptions | undefined): boolean { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); } + +/* eslint-enable */ diff --git a/src/date-fns/isMatch/index.ts b/src/date-fns/isMatch/index.ts index 0cd4b94..d820d86 100644 --- a/src/date-fns/isMatch/index.ts +++ b/src/date-fns/isMatch/index.ts @@ -1,6 +1,10 @@ -import { isValid } from '../isValid/index'; -import { parse } from '../parse/index'; -import type { AdditionalTokensOptions, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { isValid } from '../isValid/index.ts'; +import { parse } from '../parse/index.ts'; +import type { AdditionalTokensOptions, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link isMatch} function options. @@ -197,7 +201,7 @@ export interface IsMatchOptions * * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` * - * `isMatch` will try to match both formatting and stand-alone units interchangably. + * `isMatch` will try to match both formatting and stand-alone units interchangeably. * * 2. Any sequence of the identical letters is a pattern, unless it is escaped by * the single quote characters (see below). @@ -246,7 +250,7 @@ export interface IsMatchOptions * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. + * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md * * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based @@ -267,8 +271,6 @@ export interface IsMatchOptions * * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateStr - The date string to verify * @param format - The string of tokens * @param options - An object with options. @@ -300,3 +302,5 @@ export interface IsMatchOptions export function isMatch(dateStr: string, formatStr: string, options?: IsMatchOptions): boolean { return isValid(parse(dateStr, formatStr, new Date(), options)); } + +/* eslint-enable */ diff --git a/src/date-fns/isMonday/index.ts b/src/date-fns/isMonday/index.ts index 412b23e..5d1a2d1 100644 --- a/src/date-fns/isMonday/index.ts +++ b/src/date-fns/isMonday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isMonday} function options. + */ +export interface IsMondayOptions extends ContextOptions {} /** * @name isMonday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Monday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Monday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isMonday(new Date(2014, 8, 22)) * //=> true */ -export function isMonday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 1; +export function isMonday(date: DateArg & {}, options?: IsMondayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 1; } + +/* eslint-enable */ diff --git a/src/date-fns/isPast/index.ts b/src/date-fns/isPast/index.ts index 8b15c0e..e54a896 100644 --- a/src/date-fns/isPast/index.ts +++ b/src/date-fns/isPast/index.ts @@ -1,4 +1,9 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isPast @@ -9,8 +14,6 @@ import { toDate } from '../toDate/index'; * @description * Is the given date in the past? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * * @returns The date is in the past @@ -20,6 +23,8 @@ import { toDate } from '../toDate/index'; * const result = isPast(new Date(2014, 6, 2)) * //=> true */ -export function isPast(date: DateType | number | string): boolean { +export function isPast(date: DateArg & {}): boolean { return +toDate(date) < Date.now(); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameDay/index.ts b/src/date-fns/isSameDay/index.ts index dc29b62..9501c22 100644 --- a/src/date-fns/isSameDay/index.ts +++ b/src/date-fns/isSameDay/index.ts @@ -1,4 +1,15 @@ -import { startOfDay } from '../startOfDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { startOfDay } from '../startOfDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameDay} function options. + */ +export interface IsSameDayOptions extends ContextOptions {} /** * @name isSameDay @@ -8,11 +19,10 @@ import { startOfDay } from '../startOfDay/index'; * @description * Are the given dates in the same day (and year and month)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * @returns The dates are in the same day (and year and month) * * @example @@ -30,12 +40,13 @@ import { startOfDay } from '../startOfDay/index'; * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4)) * //=> false */ -export function isSameDay( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameDay( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameDayOptions | undefined, ): boolean { - const dateLeftStartOfDay = startOfDay(dateLeft); - const dateRightStartOfDay = startOfDay(dateRight); - - return +dateLeftStartOfDay === +dateRightStartOfDay; + const [dateLeft_, dateRight_] = normalizeDates(options?.in, laterDate, earlierDate); + return +startOfDay(dateLeft_) === +startOfDay(dateRight_); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameHour/index.ts b/src/date-fns/isSameHour/index.ts index 4dac905..00b9db9 100644 --- a/src/date-fns/isSameHour/index.ts +++ b/src/date-fns/isSameHour/index.ts @@ -1,4 +1,15 @@ -import { startOfHour } from '../startOfHour/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { startOfHour } from '../startOfHour/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameHour} function options. + */ +export interface IsSameHourOptions extends ContextOptions {} /** * @name isSameHour @@ -8,10 +19,9 @@ import { startOfHour } from '../startOfHour/index'; * @description * Are the given dates in the same hour (and same day)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param dateLeft - The first date to check * @param dateRight - The second date to check + * @param options - An object with options * * @returns The dates are in the same hour (and same day) * @@ -25,12 +35,13 @@ import { startOfHour } from '../startOfHour/index'; * const result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0)) * //=> false */ -export function isSameHour( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameHour( + dateLeft: DateArg & {}, + dateRight: DateArg & {}, + options?: IsSameHourOptions | undefined, ): boolean { - const dateLeftStartOfHour = startOfHour(dateLeft); - const dateRightStartOfHour = startOfHour(dateRight); - - return +dateLeftStartOfHour === +dateRightStartOfHour; + const [dateLeft_, dateRight_] = normalizeDates(options?.in, dateLeft, dateRight); + return +startOfHour(dateLeft_) === +startOfHour(dateRight_); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameISOWeek/index.ts b/src/date-fns/isSameISOWeek/index.ts index fe72458..9ef8537 100644 --- a/src/date-fns/isSameISOWeek/index.ts +++ b/src/date-fns/isSameISOWeek/index.ts @@ -1,4 +1,14 @@ -import { isSameWeek } from '../isSameWeek/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { isSameWeek } from '../isSameWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameISOWeek} function options. + */ +export interface IsSameISOWeekOptions extends ContextOptions {} /** * @name isSameISOWeek @@ -10,10 +20,9 @@ import { isSameWeek } from '../isSameWeek/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * * @returns The dates are in the same ISO week (and year) * @@ -27,9 +36,12 @@ import { isSameWeek } from '../isSameWeek/index'; * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1)) * //=> false */ -export function isSameISOWeek( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameISOWeek( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameISOWeekOptions | undefined, ): boolean { - return isSameWeek(dateLeft, dateRight, { weekStartsOn: 1 }); + return isSameWeek(laterDate, earlierDate, { ...options, weekStartsOn: 1 }); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameISOWeekYear/index.ts b/src/date-fns/isSameISOWeekYear/index.ts index 45bb436..f172cd3 100644 --- a/src/date-fns/isSameISOWeekYear/index.ts +++ b/src/date-fns/isSameISOWeekYear/index.ts @@ -1,4 +1,15 @@ -import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfISOWeekYear } from '../startOfISOWeekYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; + +/** + * The {@link isSameISOWeekYear} function options. + */ +export interface IsSameISOWeekYearOptions extends ContextOptions {} /** * @name isSameISOWeekYear @@ -10,10 +21,9 @@ import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * * @returns The dates are in the same ISO week-numbering year * @@ -22,12 +32,13 @@ import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; * const result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2)) * //=> true */ -export function isSameISOWeekYear( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameISOWeekYear( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameISOWeekYearOptions | undefined, ): boolean { - const dateLeftStartOfYear = startOfISOWeekYear(dateLeft); - const dateRightStartOfYear = startOfISOWeekYear(dateRight); - - return +dateLeftStartOfYear === +dateRightStartOfYear; + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return +startOfISOWeekYear(laterDate_) === +startOfISOWeekYear(earlierDate_); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameMinute/index.ts b/src/date-fns/isSameMinute/index.ts index 3b4918a..503e366 100644 --- a/src/date-fns/isSameMinute/index.ts +++ b/src/date-fns/isSameMinute/index.ts @@ -1,4 +1,9 @@ -import { startOfMinute } from '../startOfMinute/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfMinute } from '../startOfMinute/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isSameMinute @@ -8,10 +13,8 @@ import { startOfMinute } from '../startOfMinute/index'; * @description * Are the given dates in the same minute (and hour and day)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check * * @returns The dates are in the same minute (and hour and day) * @@ -31,12 +34,8 @@ import { startOfMinute } from '../startOfMinute/index'; * ) * //=> false */ -export function isSameMinute( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, -): boolean { - const dateLeftStartOfMinute = startOfMinute(dateLeft); - const dateRightStartOfMinute = startOfMinute(dateRight); - - return +dateLeftStartOfMinute === +dateRightStartOfMinute; +export function isSameMinute(laterDate: DateArg & {}, earlierDate: DateArg & {}): boolean { + return +startOfMinute(laterDate) === +startOfMinute(earlierDate); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameMonth/index.ts b/src/date-fns/isSameMonth/index.ts index dc34de9..a4eba2a 100644 --- a/src/date-fns/isSameMonth/index.ts +++ b/src/date-fns/isSameMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameMonth} function options. + */ +export interface IsSameMonthOptions extends ContextOptions {} /** * @name isSameMonth @@ -8,10 +18,9 @@ import { toDate } from '../toDate/index'; * @description * Are the given dates in the same month (and year)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * * @returns The dates are in the same month (and year) * @@ -25,11 +34,13 @@ import { toDate } from '../toDate/index'; * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25)) * //=> false */ -export function isSameMonth( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameMonth( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameMonthOptions | undefined, ): boolean { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); - return _dateLeft.getFullYear() === _dateRight.getFullYear() && _dateLeft.getMonth() === _dateRight.getMonth(); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth(); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameQuarter/index.ts b/src/date-fns/isSameQuarter/index.ts index 96ee162..4dae9e2 100644 --- a/src/date-fns/isSameQuarter/index.ts +++ b/src/date-fns/isSameQuarter/index.ts @@ -1,4 +1,15 @@ -import { startOfQuarter } from '../startOfQuarter/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { startOfQuarter } from '../startOfQuarter/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameQuarter} function options. + */ +export interface IsSameQuarterOptions extends ContextOptions {} /** * @name isSameQuarter @@ -8,11 +19,10 @@ import { startOfQuarter } from '../startOfQuarter/index'; * @description * Are the given dates in the same quarter (and year)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check - * @returns The dates are in the same quarter (and year) * * @example @@ -25,12 +35,13 @@ import { startOfQuarter } from '../startOfQuarter/index'; * const result = isSameQuarter(new Date(2014, 0, 1), new Date(2015, 0, 1)) * //=> false */ -export function isSameQuarter( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameQuarter( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameQuarterOptions | undefined, ): boolean { - const dateLeftStartOfQuarter = startOfQuarter(dateLeft); - const dateRightStartOfQuarter = startOfQuarter(dateRight); - - return +dateLeftStartOfQuarter === +dateRightStartOfQuarter; + const [dateLeft_, dateRight_] = normalizeDates(options?.in, laterDate, earlierDate); + return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameSecond/index.ts b/src/date-fns/isSameSecond/index.ts index aa51e90..453f810 100644 --- a/src/date-fns/isSameSecond/index.ts +++ b/src/date-fns/isSameSecond/index.ts @@ -1,4 +1,9 @@ -import { startOfSecond } from '../startOfSecond/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfSecond } from '../startOfSecond/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isSameSecond @@ -8,10 +13,8 @@ import { startOfSecond } from '../startOfSecond/index'; * @description * Are the given dates in the same second (and hour and day)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check * * @returns The dates are in the same second (and hour and day) * @@ -39,12 +42,8 @@ import { startOfSecond } from '../startOfSecond/index'; * ) * //=> false */ -export function isSameSecond( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, -): boolean { - const dateLeftStartOfSecond = startOfSecond(dateLeft); - const dateRightStartOfSecond = startOfSecond(dateRight); - - return +dateLeftStartOfSecond === +dateRightStartOfSecond; +export function isSameSecond(laterDate: DateArg & {}, earlierDate: DateArg & {}): boolean { + return +startOfSecond(laterDate) === +startOfSecond(earlierDate); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameWeek/index.ts b/src/date-fns/isSameWeek/index.ts index bbc274b..19249d5 100644 --- a/src/date-fns/isSameWeek/index.ts +++ b/src/date-fns/isSameWeek/index.ts @@ -1,10 +1,16 @@ -import { startOfWeek } from '../startOfWeek/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import type { LocalizedOptions, WeekOptions } from '../types.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; /** * The {@link isSameWeek} function options. */ -export interface IsSameWeekOptions extends WeekOptions, LocalizedOptions<'options'> {} +export interface IsSameWeekOptions extends WeekOptions, LocalizedOptions<'options'>, ContextOptions {} /** * @name isSameWeek @@ -14,10 +20,8 @@ export interface IsSameWeekOptions extends WeekOptions, LocalizedOptions<'option * @description * Are the given dates in the same week (and month and year)? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check * @param options - An object with options * * @returns The dates are in the same week (and month and year) @@ -40,13 +44,13 @@ export interface IsSameWeekOptions extends WeekOptions, LocalizedOptions<'option * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1)) * //=> false */ -export function isSameWeek( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameWeek( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, options?: IsSameWeekOptions, ): boolean { - const dateLeftStartOfWeek = startOfWeek(dateLeft, options); - const dateRightStartOfWeek = startOfWeek(dateRight, options); - - return +dateLeftStartOfWeek === +dateRightStartOfWeek; + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options); } + +/* eslint-enable */ diff --git a/src/date-fns/isSameYear/index.ts b/src/date-fns/isSameYear/index.ts index 4ab76c0..eb1cc3b 100644 --- a/src/date-fns/isSameYear/index.ts +++ b/src/date-fns/isSameYear/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { normalizeDates } from '../_lib/normalizeDates/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSameYear} function options. + */ +export interface IsSameYearOptions extends ContextOptions {} /** * @name isSameYear @@ -8,10 +18,9 @@ import { toDate } from '../toDate/index'; * @description * Are the given dates in the same year? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * - * @param dateLeft - The first date to check - * @param dateRight - The second date to check + * @param laterDate - The first date to check + * @param earlierDate - The second date to check + * @param options - An object with options * * @returns The dates are in the same year * @@ -20,11 +29,13 @@ import { toDate } from '../toDate/index'; * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25)) * //=> true */ -export function isSameYear( - dateLeft: DateType | number | string, - dateRight: DateType | number | string, +export function isSameYear( + laterDate: DateArg & {}, + earlierDate: DateArg & {}, + options?: IsSameYearOptions | undefined, ): boolean { - const _dateLeft = toDate(dateLeft); - const _dateRight = toDate(dateRight); - return _dateLeft.getFullYear() === _dateRight.getFullYear(); + const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate); + return laterDate_.getFullYear() === earlierDate_.getFullYear(); } + +/* eslint-enable */ diff --git a/src/date-fns/isSaturday/index.ts b/src/date-fns/isSaturday/index.ts index 12f7fa7..bc5c19d 100644 --- a/src/date-fns/isSaturday/index.ts +++ b/src/date-fns/isSaturday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSaturday} function options. + */ +export interface IsSaturdayOptions extends ContextOptions {} /** * @name isSaturday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Saturday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Saturday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isSaturday(new Date(2014, 8, 27)) * //=> true */ -export function isSaturday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 6; +export function isSaturday(date: DateArg & {}, options?: IsSaturdayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 6; } + +/* eslint-enable */ diff --git a/src/date-fns/isSunday/index.ts b/src/date-fns/isSunday/index.ts index c970862..03ae022 100644 --- a/src/date-fns/isSunday/index.ts +++ b/src/date-fns/isSunday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isSunday} function options. + */ +export interface IsSundayOptions extends ContextOptions {} /** * @name isSunday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Sunday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - The options object * * @returns The date is Sunday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isSunday(new Date(2014, 8, 21)) * //=> true */ -export function isSunday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 0; +export function isSunday(date: DateArg & {}, options?: IsSundayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 0; } + +/* eslint-enable */ diff --git a/src/date-fns/isThisHour/index.ts b/src/date-fns/isThisHour/index.ts index 3f56a2e..450cba6 100644 --- a/src/date-fns/isThisHour/index.ts +++ b/src/date-fns/isThisHour/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameHour } from '../isSameHour/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import { isSameHour } from '../isSameHour/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThisHour} function options. + */ +export interface IsThisHourOptions extends ContextOptions {} /** * @name isThisHour @@ -10,9 +21,8 @@ import { isSameHour } from '../isSameHour/index'; * @description * Is the given date in the same hour as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is in this hour * @@ -22,6 +32,8 @@ import { isSameHour } from '../isSameHour/index'; * const result = isThisHour(new Date(2014, 8, 25, 18)) * //=> true */ -export function isThisHour(date: DateType | number | string): boolean { - return isSameHour(date, constructNow(date)); +export function isThisHour(date: DateArg & {}, options?: IsThisHourOptions): boolean { + return isSameHour(toDate(date, options?.in), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisISOWeek/index.ts b/src/date-fns/isThisISOWeek/index.ts index 0a7427e..3bbdbc3 100644 --- a/src/date-fns/isThisISOWeek/index.ts +++ b/src/date-fns/isThisISOWeek/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameISOWeek } from '../isSameISOWeek/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameISOWeek } from '../isSameISOWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThisISOWeek} function options. + */ +export interface IsThisISOWeekOptions extends ContextOptions {} /** * @name isThisISOWeek @@ -12,9 +23,8 @@ import { isSameISOWeek } from '../isSameISOWeek/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is in this ISO week * @@ -23,7 +33,8 @@ import { isSameISOWeek } from '../isSameISOWeek/index'; * const result = isThisISOWeek(new Date(2014, 8, 22)) * //=> true */ - -export function isThisISOWeek(date: DateType | number | string): boolean { - return isSameISOWeek(date, constructNow(date)); +export function isThisISOWeek(date: DateArg & {}, options?: IsThisISOWeekOptions | undefined): boolean { + return isSameISOWeek(constructFrom(options?.in || date, date), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisMinute/index.ts b/src/date-fns/isThisMinute/index.ts index fec9448..35fb8bb 100644 --- a/src/date-fns/isThisMinute/index.ts +++ b/src/date-fns/isThisMinute/index.ts @@ -1,5 +1,10 @@ -import { constructNow } from '../constructNow/index'; -import { isSameMinute } from '../isSameMinute/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import { isSameMinute } from '../isSameMinute/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isThisMinute @@ -10,8 +15,6 @@ import { isSameMinute } from '../isSameMinute/index'; * @description * Is the given date in the same minute as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * * @returns The date is in this minute @@ -23,6 +26,8 @@ import { isSameMinute } from '../isSameMinute/index'; * //=> true */ -export function isThisMinute(date: DateType | number | string): boolean { +export function isThisMinute(date: DateArg & {}): boolean { return isSameMinute(date, constructNow(date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisMonth/index.ts b/src/date-fns/isThisMonth/index.ts index 10150c5..cb3de21 100644 --- a/src/date-fns/isThisMonth/index.ts +++ b/src/date-fns/isThisMonth/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameMonth } from '../isSameMonth/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameMonth } from '../isSameMonth/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThisMonth} function options. + */ +export interface IsThisMonthOptions extends ContextOptions {} /** * @name isThisMonth @@ -10,9 +21,8 @@ import { isSameMonth } from '../isSameMonth/index'; * @description * Is the given date in the same month as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is in this month * @@ -21,7 +31,8 @@ import { isSameMonth } from '../isSameMonth/index'; * const result = isThisMonth(new Date(2014, 8, 15)) * //=> true */ - -export function isThisMonth(date: DateType | number | string): boolean { - return isSameMonth(date, constructNow(date)); +export function isThisMonth(date: DateArg & {}, options?: IsThisMonthOptions | undefined): boolean { + return isSameMonth(constructFrom(options?.in || date, date), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisQuarter/index.ts b/src/date-fns/isThisQuarter/index.ts index 6fec7bc..e35469b 100644 --- a/src/date-fns/isThisQuarter/index.ts +++ b/src/date-fns/isThisQuarter/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameQuarter } from '../isSameQuarter/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameQuarter } from '../isSameQuarter/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThisQuarter} function options. + */ +export interface IsThisQuarterOptions extends ContextOptions {} /** * @name isThisQuarter @@ -10,9 +21,8 @@ import { isSameQuarter } from '../isSameQuarter/index'; * @description * Is the given date in the same quarter as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is in this quarter * @@ -21,6 +31,8 @@ import { isSameQuarter } from '../isSameQuarter/index'; * const result = isThisQuarter(new Date(2014, 6, 2)) * //=> true */ -export function isThisQuarter(date: DateType | number | string): boolean { - return isSameQuarter(date, constructNow(date)); +export function isThisQuarter(date: DateArg & {}, options?: IsThisQuarterOptions): boolean { + return isSameQuarter(constructFrom(options?.in || date, date), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisSecond/index.ts b/src/date-fns/isThisSecond/index.ts index 6073dd5..cdd0750 100644 --- a/src/date-fns/isThisSecond/index.ts +++ b/src/date-fns/isThisSecond/index.ts @@ -1,5 +1,10 @@ -import { constructNow } from '../constructNow/index'; -import { isSameSecond } from '../isSameSecond/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import { isSameSecond } from '../isSameSecond/index.ts'; +import type { DateArg } from '../types.ts'; /** * @name isThisSecond @@ -10,8 +15,6 @@ import { isSameSecond } from '../isSameSecond/index'; * @description * Is the given date in the same second as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * * @returns The date is in this second @@ -22,6 +25,8 @@ import { isSameSecond } from '../isSameSecond/index'; * const result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) * //=> true */ -export function isThisSecond(date: DateType | number | string): boolean { +export function isThisSecond(date: DateArg & {}): boolean { return isSameSecond(date, constructNow(date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisWeek/index.ts b/src/date-fns/isThisWeek/index.ts index 7215b95..a0dae1e 100644 --- a/src/date-fns/isThisWeek/index.ts +++ b/src/date-fns/isThisWeek/index.ts @@ -1,11 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameWeek } from '../isSameWeek/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameWeek } from '../isSameWeek/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link isThisWeek} function options. */ -export interface IsThisWeekOptions extends WeekOptions, LocalizedOptions<'options'> {} +export interface IsThisWeekOptions extends WeekOptions, LocalizedOptions<'options'>, ContextOptions {} /** * @name isThisWeek @@ -16,8 +21,6 @@ export interface IsThisWeekOptions extends WeekOptions, LocalizedOptions<'option * @description * Is the given date in the same week as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * @param options - The object with options * @@ -34,9 +37,8 @@ export interface IsThisWeekOptions extends WeekOptions, LocalizedOptions<'option * const result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 }) * //=> false */ -export function isThisWeek( - date: DateType | number | string, - options?: IsThisWeekOptions, -): boolean { - return isSameWeek(date, constructNow(date), options); +export function isThisWeek(date: DateArg & {}, options?: IsThisWeekOptions): boolean { + return isSameWeek(constructFrom(options?.in || date, date), constructNow(options?.in || date), options); } + +/* eslint-enable */ diff --git a/src/date-fns/isThisYear/index.ts b/src/date-fns/isThisYear/index.ts index 251ad8f..37ec45b 100644 --- a/src/date-fns/isThisYear/index.ts +++ b/src/date-fns/isThisYear/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameYear } from '../isSameYear/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameYear } from '../isSameYear/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThisYear} function options. + */ +export interface IsThisYearOptions extends ContextOptions {} /** * @name isThisYear @@ -10,9 +21,8 @@ import { isSameYear } from '../isSameYear/index'; * @description * Is the given date in the same year as the current date? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is in this year * @@ -21,6 +31,8 @@ import { isSameYear } from '../isSameYear/index'; * const result = isThisYear(new Date(2014, 6, 2)) * //=> true */ -export function isThisYear(date: DateType | number | string): boolean { - return isSameYear(date, constructNow(date)); +export function isThisYear(date: DateArg & {}, options?: IsThisYearOptions | undefined): boolean { + return isSameYear(constructFrom(options?.in || date, date), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isThursday/index.ts b/src/date-fns/isThursday/index.ts index 469e931..8f52372 100644 --- a/src/date-fns/isThursday/index.ts +++ b/src/date-fns/isThursday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isThursday} function options. + */ +export interface IsThursdayOptions extends ContextOptions {} /** * @name isThursday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Thursday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Thursday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isThursday(new Date(2014, 8, 25)) * //=> true */ -export function isThursday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 4; +export function isThursday(date: DateArg & {}, options?: IsThursdayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 4; } + +/* eslint-enable */ diff --git a/src/date-fns/isToday/index.ts b/src/date-fns/isToday/index.ts index 232bcda..87f61bd 100644 --- a/src/date-fns/isToday/index.ts +++ b/src/date-fns/isToday/index.ts @@ -1,5 +1,16 @@ -import { constructNow } from '../constructNow/index'; -import { isSameDay } from '../isSameDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameDay } from '../isSameDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isToday} function options. + */ +export interface IsTodayOptions extends ContextOptions {} /** * @name isToday @@ -10,9 +21,8 @@ import { isSameDay } from '../isSameDay/index'; * @description * Is the given date today? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is today * @@ -21,6 +31,8 @@ import { isSameDay } from '../isSameDay/index'; * const result = isToday(new Date(2014, 9, 6, 14, 0)) * //=> true */ -export function isToday(date: DateType | number | string): boolean { - return isSameDay(date, constructNow(date)); +export function isToday(date: DateArg & {}, options?: IsTodayOptions | undefined): boolean { + return isSameDay(constructFrom(options?.in || date, date), constructNow(options?.in || date)); } + +/* eslint-enable */ diff --git a/src/date-fns/isTomorrow/index.ts b/src/date-fns/isTomorrow/index.ts index d429019..f2b0ad6 100644 --- a/src/date-fns/isTomorrow/index.ts +++ b/src/date-fns/isTomorrow/index.ts @@ -1,6 +1,16 @@ -import { addDays } from '../addDays/index'; -import { constructNow } from '../constructNow/index'; -import { isSameDay } from '../isSameDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameDay } from '../isSameDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isTomorrow} function options. + */ +export interface IsTomorrowOptions extends ContextOptions {} /** * @name isTomorrow @@ -11,9 +21,8 @@ import { isSameDay } from '../isSameDay/index'; * @description * Is the given date tomorrow? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is tomorrow * @@ -22,6 +31,8 @@ import { isSameDay } from '../isSameDay/index'; * const result = isTomorrow(new Date(2014, 9, 7, 14, 0)) * //=> true */ -export function isTomorrow(date: DateType | number | string): boolean { - return isSameDay(date, addDays(constructNow(date), 1)); +export function isTomorrow(date: DateArg & {}, options?: IsTomorrowOptions | undefined): boolean { + return isSameDay(date, addDays(constructNow(options?.in || date), 1), options); } + +/* eslint-enable */ diff --git a/src/date-fns/isTuesday/index.ts b/src/date-fns/isTuesday/index.ts index 01fbd3d..e1c3eb9 100644 --- a/src/date-fns/isTuesday/index.ts +++ b/src/date-fns/isTuesday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isTuesday} function options. + */ +export interface IsTuesdayOptions extends ContextOptions {} /** * @name isTuesday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Tuesday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Tuesday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isTuesday(new Date(2014, 8, 23)) * //=> true */ -export function isTuesday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 2; +export function isTuesday(date: DateArg & {}, options?: IsTuesdayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 2; } + +/* eslint-enable */ diff --git a/src/date-fns/isValid/index.ts b/src/date-fns/isValid/index.ts index d6d5fe3..a66cb35 100644 --- a/src/date-fns/isValid/index.ts +++ b/src/date-fns/isValid/index.ts @@ -1,5 +1,9 @@ -import { isDate } from '../isDate/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { isDate } from '../isDate/index.ts'; +import { toDate } from '../toDate/index.ts'; /** * @name isValid @@ -13,8 +17,6 @@ import { toDate } from '../toDate/index'; * * Time value of Date: http://es5.github.io/#x15.9.1.1 * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * * @returns The date is valid @@ -25,7 +27,7 @@ import { toDate } from '../toDate/index'; * //=> true * * @example - * // For the value, convertable into a date: + * // For the value, convertible into a date: * const result = isValid(1393804800000) * //=> true * @@ -35,9 +37,7 @@ import { toDate } from '../toDate/index'; * //=> false */ export function isValid(date: unknown): boolean { - if (!isDate(date) && typeof date !== 'number') { - return false; - } - const _date = toDate(date); - return !isNaN(Number(_date)); + return !((!isDate(date) && typeof date !== 'number') || isNaN(+toDate(date))); } + +/* eslint-enable */ diff --git a/src/date-fns/isWednesday/index.ts b/src/date-fns/isWednesday/index.ts index 3e26dd5..91fcbe3 100644 --- a/src/date-fns/isWednesday/index.ts +++ b/src/date-fns/isWednesday/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isWednesday} function options. + */ +export interface IsWednesdayOptions extends ContextOptions {} /** * @name isWednesday @@ -8,9 +18,8 @@ import { toDate } from '../toDate/index'; * @description * Is the given date Wednesday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is Wednesday * @@ -19,6 +28,8 @@ import { toDate } from '../toDate/index'; * const result = isWednesday(new Date(2014, 8, 24)) * //=> true */ -export function isWednesday(date: DateType | number | string): boolean { - return toDate(date).getDay() === 3; +export function isWednesday(date: DateArg & {}, options?: IsWednesdayOptions | undefined): boolean { + return toDate(date, options?.in).getDay() === 3; } + +/* eslint-enable */ diff --git a/src/date-fns/isWeekend/index.ts b/src/date-fns/isWeekend/index.ts index d69825e..bc6bf6b 100644 --- a/src/date-fns/isWeekend/index.ts +++ b/src/date-fns/isWeekend/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isWeekend} function options. + */ +export interface IsWeekendOptions extends ContextOptions {} /** * @name isWeekend @@ -6,11 +16,10 @@ import { toDate } from '../toDate/index'; * @summary Does the given date fall on a weekend? * * @description - * Does the given date fall on a weekend? - * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`). * * @param date - The date to check + * @param options - An object with options * * @returns The date falls on a weekend * @@ -19,7 +28,9 @@ import { toDate } from '../toDate/index'; * const result = isWeekend(new Date(2014, 9, 5)) * //=> true */ -export function isWeekend(date: DateType | number | string): boolean { - const day = toDate(date).getDay(); +export function isWeekend(date: DateArg & {}, options?: IsWeekendOptions | undefined): boolean { + const day = toDate(date, options?.in).getDay(); return day === 0 || day === 6; } + +/* eslint-enable */ diff --git a/src/date-fns/isWithinInterval/index.ts b/src/date-fns/isWithinInterval/index.ts index fbcab94..b8ff72e 100644 --- a/src/date-fns/isWithinInterval/index.ts +++ b/src/date-fns/isWithinInterval/index.ts @@ -1,5 +1,14 @@ -import { toDate } from '../toDate/index'; -import type { Interval } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, Interval } from '../types.ts'; + +/** + * The {@link isWithinInterval} function options. + */ +export interface IsWithinIntervalOptions extends ContextOptions {} /** * @name isWithinInterval @@ -9,10 +18,9 @@ import type { Interval } from '../types'; * @description * Is the given date within the interval? (Including start and end.) * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check * @param interval - The interval to check + * @param options - An object with options * * @returns The date is within the interval * @@ -22,7 +30,7 @@ import type { Interval } from '../types'; * start: new Date(2014, 0, 1), * end: new Date(2014, 0, 7) * }) - * //=> true + * // => true * * @example * // For the date outside of the interval: @@ -30,24 +38,29 @@ import type { Interval } from '../types'; * start: new Date(2014, 0, 1), * end: new Date(2014, 0, 7) * }) - * //=> false + * // => false * * @example - * // For date equal to interval start: + * // For date equal to the interval start: * isWithinInterval(date, { start, end: date }) * // => true * * @example - * // For date equal to interval end: + * // For date equal to the interval end: * isWithinInterval(date, { start: date, end }) * // => true */ -export function isWithinInterval( - date: DateType | number | string, - interval: Interval, +export function isWithinInterval( + date: DateArg & {}, + interval: Interval, + options?: IsWithinIntervalOptions | undefined, ): boolean { - const time = +toDate(date); - const [startTime, endTime] = [+toDate(interval.start), +toDate(interval.end)].sort((a, b) => a - b); + const time = +toDate(date, options?.in); + const [startTime, endTime] = [+toDate(interval.start, options?.in), +toDate(interval.end, options?.in)].sort( + (a, b) => a - b, + ); - return time >= startTime! && time <= endTime!; + return time >= startTime && time <= endTime; } + +/* eslint-enable */ diff --git a/src/date-fns/isYesterday/index.ts b/src/date-fns/isYesterday/index.ts index 8d38018..26dd463 100644 --- a/src/date-fns/isYesterday/index.ts +++ b/src/date-fns/isYesterday/index.ts @@ -1,6 +1,17 @@ -import { constructNow } from '../constructNow/index'; -import { isSameDay } from '../isSameDay/index'; -import { subDays } from '../subDays/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import { isSameDay } from '../isSameDay/index.ts'; +import { subDays } from '../subDays/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link isYesterday} function options. + */ +export interface IsYesterdayOptions extends ContextOptions {} /** * @name isYesterday @@ -11,9 +22,8 @@ import { subDays } from '../subDays/index'; * @description * Is the given date yesterday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The date to check + * @param options - An object with options * * @returns The date is yesterday * @@ -22,6 +32,8 @@ import { subDays } from '../subDays/index'; * const result = isYesterday(new Date(2014, 9, 5, 14, 0)) * //=> true */ -export function isYesterday(date: DateType | number | string): boolean { - return isSameDay(date, subDays(constructNow(date), 1)); +export function isYesterday(date: DateArg & {}, options?: IsYesterdayOptions | undefined): boolean { + return isSameDay(constructFrom(options?.in || date, date), subDays(constructNow(options?.in || date), 1)); } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfDecade/index.ts b/src/date-fns/lastDayOfDecade/index.ts index 97dd635..b89b94c 100644 --- a/src/date-fns/lastDayOfDecade/index.ts +++ b/src/date-fns/lastDayOfDecade/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfDecade} function options. + */ +export interface LastDayOfDecadeOptions extends ContextOptions {} /** * @name lastDayOfDecade @@ -8,9 +18,11 @@ import { toDate } from '../toDate/index'; * @description * Return the last day of a decade for the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type; inferred from arguments or specified by context. * * @param date - The original date + * @param options - The options * * @returns The last day of a decade * @@ -19,14 +31,16 @@ import { toDate } from '../toDate/index'; * const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) * //=> Wed Dec 31 2019 00:00:00 */ -export function lastDayOfDecade(date: DateType | number | string): DateType { - // TODO: Switch to more technical definition in of decades that start with 1 - // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking - // change, so it can only be done in 4.0. - const _date = toDate(date); +export function lastDayOfDecade( + date: DateArg, + options?: LastDayOfDecadeOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const decade = 9 + Math.floor(year / 10) * 10; _date.setFullYear(decade + 1, 0, 0); _date.setHours(0, 0, 0, 0); - return _date; + return toDate(_date, options?.in); } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfISOWeek/index.ts b/src/date-fns/lastDayOfISOWeek/index.ts index 6519ff0..1bedf5b 100644 --- a/src/date-fns/lastDayOfISOWeek/index.ts +++ b/src/date-fns/lastDayOfISOWeek/index.ts @@ -1,4 +1,14 @@ -import { lastDayOfWeek } from '../lastDayOfWeek/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { lastDayOfWeek } from '../lastDayOfWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfISOWeek} function options. + */ +export interface LastDayOfISOWeekOptions extends ContextOptions {} /** * @name lastDayOfISOWeek @@ -11,9 +21,11 @@ import { lastDayOfWeek } from '../lastDayOfWeek/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The Date type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [UTCDate](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The last day of an ISO week * @@ -22,6 +34,11 @@ import { lastDayOfWeek } from '../lastDayOfWeek/index'; * const result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Sep 07 2014 00:00:00 */ -export function lastDayOfISOWeek(date: DateType | number | string): DateType { - return lastDayOfWeek(date, { weekStartsOn: 1 }); +export function lastDayOfISOWeek( + date: DateArg, + options?: LastDayOfISOWeekOptions | undefined, +): ResultDate { + return lastDayOfWeek(date, { ...options, weekStartsOn: 1 }); } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfISOWeekYear/index.ts b/src/date-fns/lastDayOfISOWeekYear/index.ts index b4691be..9f996c1 100644 --- a/src/date-fns/lastDayOfISOWeekYear/index.ts +++ b/src/date-fns/lastDayOfISOWeekYear/index.ts @@ -1,6 +1,16 @@ -import { getISOWeekYear } from '../getISOWeekYear/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { getISOWeekYear } from '../getISOWeekYear/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfISOWeekYear} function options. + */ +export interface LastDayOfISOWeekYearOptions extends ContextOptions {} /** * @name lastDayOfISOWeekYear @@ -15,8 +25,10 @@ import { constructFrom } from '../constructFrom/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The end of an ISO week-numbering year * @@ -25,12 +37,18 @@ import { constructFrom } from '../constructFrom/index'; * const result = lastDayOfISOWeekYear(new Date(2005, 6, 2)) * //=> Sun Jan 01 2006 00:00:00 */ -export function lastDayOfISOWeekYear(date: DateType | number | string): DateType { - const year = getISOWeekYear(date); - const fourthOfJanuary = constructFrom(date, 0); +export function lastDayOfISOWeekYear( + date: DateArg, + options?: LastDayOfISOWeekYearOptions | undefined, +): ResultDate { + const year = getISOWeekYear(date, options); + const fourthOfJanuary = constructFrom(options?.in || date, 0); fourthOfJanuary.setFullYear(year + 1, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); - const _date = startOfISOWeek(fourthOfJanuary); - _date.setDate(_date.getDate() - 1); - return _date; + + const date_ = startOfISOWeek(fourthOfJanuary, options); + date_.setDate(date_.getDate() - 1); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfMonth/index.ts b/src/date-fns/lastDayOfMonth/index.ts index 11df24e..f46a59e 100644 --- a/src/date-fns/lastDayOfMonth/index.ts +++ b/src/date-fns/lastDayOfMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfMonth} function options. + */ +export interface LastDayOfMonthOptions extends ContextOptions {} /** * @name lastDayOfMonth @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The last day of a month * @@ -20,10 +32,15 @@ import { toDate } from '../toDate/index'; * const result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 00:00:00 */ -export function lastDayOfMonth(date: DateType | number | string): DateType { - const _date = toDate(date); +export function lastDayOfMonth( + date: DateArg, + options?: LastDayOfMonthOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const month = _date.getMonth(); _date.setFullYear(_date.getFullYear(), month + 1, 0); _date.setHours(0, 0, 0, 0); - return _date; + return toDate(_date, options?.in) as ResultDate; } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfQuarter/index.ts b/src/date-fns/lastDayOfQuarter/index.ts index 23b12e5..2e5917e 100644 --- a/src/date-fns/lastDayOfQuarter/index.ts +++ b/src/date-fns/lastDayOfQuarter/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfQuarter} function options. + */ +export interface LastDayOfQuarterOptions extends ContextOptions {} /** * @name lastDayOfQuarter @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The last day of a quarter * @@ -20,11 +32,16 @@ import { toDate } from '../toDate/index'; * const result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 00:00:00 */ -export function lastDayOfQuarter(date: DateType | number | string): DateType { - const _date = toDate(date); - const currentMonth = _date.getMonth(); +export function lastDayOfQuarter( + date: DateArg, + options?: LastDayOfQuarterOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + const currentMonth = date_.getMonth(); const month = currentMonth - (currentMonth % 3) + 3; - _date.setMonth(month, 0); - _date.setHours(0, 0, 0, 0); - return _date; + date_.setMonth(month, 0); + date_.setHours(0, 0, 0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfWeek/index.ts b/src/date-fns/lastDayOfWeek/index.ts index f73a14c..ca4dec3 100644 --- a/src/date-fns/lastDayOfWeek/index.ts +++ b/src/date-fns/lastDayOfWeek/index.ts @@ -1,11 +1,18 @@ -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link lastDayOfWeek} function options. */ -export interface LastDayOfWeekOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface LastDayOfWeekOptions + extends LocalizedOptions<'options'>, + WeekOptions, + ContextOptions {} /** * @name lastDayOfWeek @@ -14,29 +21,20 @@ export interface LastDayOfWeekOptions extends LocalizedOptions<'options'>, WeekO * * @description * Return the last day of a week for the given date. - * The result will be in the local timezone. + * The result will be in the local timezone unless a context is specified. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date * @param options - An object with options * * @returns The last day of a week - * - * @example - * // The last day of a week for 2 September 2014 11:55:00: - * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sat Sep 06 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00: - * const result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) - * //=> Sun Sep 07 2014 00:00:00 */ -export function lastDayOfWeek( - date: DateType | number | string, - options?: LastDayOfWeekOptions, -): DateType { +export function lastDayOfWeek( + date: DateArg, + options?: LastDayOfWeekOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? @@ -45,11 +43,14 @@ export function lastDayOfWeek( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const _date = toDate(date); + const _date = toDate(date, options?.in); const day = _date.getDay(); const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); _date.setHours(0, 0, 0, 0); _date.setDate(_date.getDate() + diff); + return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/lastDayOfYear/index.ts b/src/date-fns/lastDayOfYear/index.ts index 1b5f08d..547e12f 100644 --- a/src/date-fns/lastDayOfYear/index.ts +++ b/src/date-fns/lastDayOfYear/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link lastDayOfYear} function options. + */ +export interface LastDayOfYearOptions extends ContextOptions {} /** * @name lastDayOfYear @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The last day of a year * @@ -20,10 +32,15 @@ import { toDate } from '../toDate/index'; * const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Dec 31 2014 00:00:00 */ -export function lastDayOfYear(date: DateType | number | string): DateType { - const _date = toDate(date); - const year = _date.getFullYear(); - _date.setFullYear(year + 1, 0, 0); - _date.setHours(0, 0, 0, 0); - return _date; +export function lastDayOfYear( + date: DateArg, + options?: LastDayOfYearOptions, +): ResultDate { + const date_ = toDate(date, options?.in); + const year = date_.getFullYear(); + date_.setFullYear(year + 1, 0, 0); + date_.setHours(0, 0, 0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/lightFormat/index.ts b/src/date-fns/lightFormat/index.ts index cf81e0a..8baaa65 100644 --- a/src/date-fns/lightFormat/index.ts +++ b/src/date-fns/lightFormat/index.ts @@ -1,6 +1,11 @@ -import { isValid } from '../isValid/index'; -import { toDate } from '../toDate/index'; -import { lightFormatters } from '../_lib/format/lightFormatters/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { lightFormatters } from '../_lib/format/lightFormatters/index.ts'; +import { isValid } from '../isValid/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { DateArg } from '../types.ts'; // Rexports of internal for libraries to use. // See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 @@ -71,8 +76,6 @@ type Token = keyof typeof lightFormatters; * | | SSS | 000, 001, ..., 999 | * | | SSSS | ... | * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param date - The original date * @param format - The string of tokens * @@ -85,10 +88,10 @@ type Token = keyof typeof lightFormatters; * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd') * //=> '2014-02-11' */ -export function lightFormat(date: DateType | number | string, formatStr: string): string { - const _date = toDate(date); +export function lightFormat(date: DateArg & {}, formatStr: string): string { + const date_ = toDate(date); - if (!isValid(_date)) { + if (!isValid(date_)) { throw new RangeError('Invalid time value'); } @@ -111,10 +114,10 @@ export function lightFormat(date: DateType | number | str const formatter = lightFormatters[firstCharacter as Token]; if (formatter) { - return formatter(_date, substring); + return formatter(date_, substring); } - if (firstCharacter!.match(unescapedLatinCharacterRegExp)) { + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); } @@ -127,10 +130,8 @@ export function lightFormat(date: DateType | number | str function cleanEscapedString(input: string) { const matches = input.match(escapedStringRegExp); - - if (!matches) { - return input; - } - - return matches[1]!.replace(doubleQuoteRegExp, "'"); + if (!matches) return input; + return matches[1].replace(doubleQuoteRegExp, "'"); } + +/* eslint-enable */ diff --git a/src/date-fns/locale/_lib/buildFormatLongFn/index.ts b/src/date-fns/locale/_lib/buildFormatLongFn/index.ts index 673cd5e..f9a6936 100644 --- a/src/date-fns/locale/_lib/buildFormatLongFn/index.ts +++ b/src/date-fns/locale/_lib/buildFormatLongFn/index.ts @@ -1,4 +1,8 @@ -import type { FormatLongFn, FormatLongWidth } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FormatLongFn, FormatLongWidth } from '../../types.ts'; export interface BuildFormatLongFnArgs { formats: Partial<{ [format in FormatLongWidth]: string }> & { @@ -17,3 +21,5 @@ export function buildFormatLongFn( return format; }; } + +/* eslint-enable */ diff --git a/src/date-fns/locale/_lib/buildLocalizeFn/index.ts b/src/date-fns/locale/_lib/buildLocalizeFn/index.ts index 3a47576..84a3b00 100644 --- a/src/date-fns/locale/_lib/buildLocalizeFn/index.ts +++ b/src/date-fns/locale/_lib/buildLocalizeFn/index.ts @@ -1,7 +1,9 @@ -/* eslint-disable no-unused-vars */ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck -import type { Day, Era, Month, Quarter } from '../../../types'; -import type { LocaleDayPeriod, LocaleUnitValue, LocaleWidth, LocalizeFn } from '../../types'; +import type { Day, Era, Month, Quarter } from '../../../types.ts'; +import type { LocaleDayPeriod, LocaleUnitValue, LocaleWidth, LocalizeFn } from '../../types.ts'; export type BuildLocalizeFnArgs< Value extends LocaleUnitValue, @@ -111,3 +113,5 @@ export function buildLocalizeFn< return valuesArray[index]; }; } + +/* eslint-enable */ diff --git a/src/date-fns/locale/_lib/buildMatchFn/index.ts b/src/date-fns/locale/_lib/buildMatchFn/index.ts index 2fa5dd6..87eb806 100644 --- a/src/date-fns/locale/_lib/buildMatchFn/index.ts +++ b/src/date-fns/locale/_lib/buildMatchFn/index.ts @@ -1,5 +1,9 @@ -import type { Quarter, Era, Day, Month } from '../../../types'; -import type { LocaleUnitValue, LocaleWidth, LocaleDayPeriod, MatchFn, MatchValueCallback } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Quarter, Era, Day, Month } from '../../../types.ts'; +import type { LocaleUnitValue, LocaleWidth, LocaleDayPeriod, MatchFn, MatchValueCallback } from '../../types.ts'; export interface BuildMatchFnArgs< Result extends LocaleUnitValue, @@ -58,7 +62,7 @@ export function buildMatchFn< const key = ( Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type + : // [TODO] -- I challenge you to fix the type findKey(parsePatterns, (pattern: any) => pattern.test(matchedString)) ) as Value extends LocaleDayPeriod ? string : number; @@ -66,7 +70,7 @@ export function buildMatchFn< value = (args.valueCallback ? args.valueCallback(key) : key) as Value; value = options.valueCallback - ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type + ? // [TODO] -- I challenge you to fix the type options.valueCallback(value as any) : value; @@ -81,7 +85,7 @@ function findKey( predicate: (value: Value) => boolean, ): keyof Obj | undefined { for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key]!)) { + if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) { return key; } } @@ -90,9 +94,11 @@ function findKey( function findIndex(array: Item[], predicate: (item: Item) => boolean): number | undefined { for (let key = 0; key < array.length; key++) { - if (predicate(array[key]!)) { + if (predicate(array[key])) { return key; } } return undefined; } + +/* eslint-enable */ diff --git a/src/date-fns/locale/_lib/buildMatchPatternFn/index.ts b/src/date-fns/locale/_lib/buildMatchPatternFn/index.ts index 9722692..5ecf756 100644 --- a/src/date-fns/locale/_lib/buildMatchPatternFn/index.ts +++ b/src/date-fns/locale/_lib/buildMatchPatternFn/index.ts @@ -1,4 +1,8 @@ -import type { MatchFn, MatchValueCallback } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { MatchFn, MatchValueCallback } from '../../types.ts'; export interface BuildMatchPatternFnArgs { matchPattern: RegExp; @@ -15,7 +19,7 @@ export function buildMatchPatternFn(args: BuildMatchPatternFnArgs(args: BuildMatchPatternFnArgs { return result; }; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/_lib/formatLong/index.ts b/src/date-fns/locale/en-US/_lib/formatLong/index.ts index b078ffe..ac61d24 100644 --- a/src/date-fns/locale/en-US/_lib/formatLong/index.ts +++ b/src/date-fns/locale/en-US/_lib/formatLong/index.ts @@ -1,5 +1,9 @@ -import { buildFormatLongFn } from '../../../_lib/buildFormatLongFn/index'; -import type { FormatLong } from '../../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { buildFormatLongFn } from '../../../_lib/buildFormatLongFn/index.ts'; +import type { FormatLong } from '../../../types.ts'; const dateFormats = { full: 'EEEE, MMMM do, y', @@ -38,3 +42,5 @@ export const formatLong: FormatLong = { defaultWidth: 'full', }), }; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/_lib/formatRelative/index.ts b/src/date-fns/locale/en-US/_lib/formatRelative/index.ts index 3276be2..35b200c 100644 --- a/src/date-fns/locale/en-US/_lib/formatRelative/index.ts +++ b/src/date-fns/locale/en-US/_lib/formatRelative/index.ts @@ -1,4 +1,8 @@ -import type { FormatRelativeFn } from '../../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { FormatRelativeFn } from '../../../types.ts'; const formatRelativeLocale = { lastWeek: "'last' eeee 'at' p", @@ -10,3 +14,5 @@ const formatRelativeLocale = { }; export const formatRelative: FormatRelativeFn = (token, _date, _baseDate, _options) => formatRelativeLocale[token]; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/_lib/localize/index.ts b/src/date-fns/locale/en-US/_lib/localize/index.ts index a2aa27c..44319c4 100644 --- a/src/date-fns/locale/en-US/_lib/localize/index.ts +++ b/src/date-fns/locale/en-US/_lib/localize/index.ts @@ -1,5 +1,9 @@ -import type { Localize, LocalizeFn } from '../../../types'; -import { buildLocalizeFn } from '../../../_lib/buildLocalizeFn/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Localize, LocalizeFn } from '../../../types.ts'; +import { buildLocalizeFn } from '../../../_lib/buildLocalizeFn/index.ts'; const eraValues = { narrow: ['B', 'A'] as const, @@ -164,3 +168,5 @@ export const localize: Localize = { defaultFormattingWidth: 'wide', }), }; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/_lib/match/index.ts b/src/date-fns/locale/en-US/_lib/match/index.ts index 4449806..858ee6a 100644 --- a/src/date-fns/locale/en-US/_lib/match/index.ts +++ b/src/date-fns/locale/en-US/_lib/match/index.ts @@ -1,7 +1,11 @@ -import type { Quarter } from '../../../../types'; -import type { Match } from '../../../types'; -import { buildMatchFn } from '../../../_lib/buildMatchFn/index'; -import { buildMatchPatternFn } from '../../../_lib/buildMatchPatternFn/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Quarter } from '../../../../types.ts'; +import type { Match } from '../../../types.ts'; +import { buildMatchFn } from '../../../_lib/buildMatchFn/index.ts'; +import { buildMatchPatternFn } from '../../../_lib/buildMatchPatternFn/index.ts'; const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; const parseOrdinalNumberPattern = /\d+/i; @@ -105,3 +109,5 @@ export const match: Match = { defaultParseWidth: 'any', }), }; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/index.ts b/src/date-fns/locale/en-US/index.ts index 9b1b5ea..23834cb 100644 --- a/src/date-fns/locale/en-US/index.ts +++ b/src/date-fns/locale/en-US/index.ts @@ -1,9 +1,13 @@ -import { formatDistance } from './_lib/formatDistance/index'; -import { formatLong } from './_lib/formatLong/index'; -import { formatRelative } from './_lib/formatRelative/index'; -import { localize } from './_lib/localize/index'; -import { match } from './_lib/match/index'; -import type { Locale } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { formatDistance } from './_lib/formatDistance/index.ts'; +import { formatLong } from './_lib/formatLong/index.ts'; +import { formatRelative } from './_lib/formatRelative/index.ts'; +import { localize } from './_lib/localize/index.ts'; +import { match } from './_lib/match/index.ts'; +import type { Locale } from '../types.ts'; /** * @category Locales @@ -25,3 +29,5 @@ export const enUS: Locale = { firstWeekContainsDate: 1, }, }; + +/* eslint-enable */ diff --git a/src/date-fns/locale/en-US/snapshot.md b/src/date-fns/locale/en-US/snapshot.md index 9aeb1da..08fae8c 100644 --- a/src/date-fns/locale/en-US/snapshot.md +++ b/src/date-fns/locale/en-US/snapshot.md @@ -1,3 +1,7 @@ +/_ eslint-disable eslint-comments/no-unlimited-disable _/ +/_ eslint-disable _/ +// @ts-nocheck + # English (en-US) locale ## `format` and `parse` @@ -532,3 +536,5 @@ If now is January 1st, 2000, 00:00. | {"seconds":0} | 0 seconds | | {"seconds":1} | 1 second | | {"seconds":2} | 2 seconds | + +/_ eslint-enable _/ diff --git a/src/date-fns/locale/index.ts b/src/date-fns/locale/index.ts index 3b7f9ee..2d87bed 100644 --- a/src/date-fns/locale/index.ts +++ b/src/date-fns/locale/index.ts @@ -1,4 +1,10 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + // This file is generated automatically by `scripts/build/indices.ts`. Please, don't change it. -export * from './en-US/index'; -export type * from './types'; +export * from './en-US/index.ts'; +export type * from './types.ts'; + +/* eslint-enable */ diff --git a/src/date-fns/locale/types.ts b/src/date-fns/locale/types.ts index 294cd00..d00ab36 100644 --- a/src/date-fns/locale/types.ts +++ b/src/date-fns/locale/types.ts @@ -1,6 +1,17 @@ -/* eslint-disable no-unused-vars */ - -import type { Day, Era, FirstWeekContainsDateOptions, LocalizedOptions, Month, Quarter, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { + DateArg, + Day, + Era, + FirstWeekContainsDateOptions, + LocalizedOptions, + Month, + Quarter, + WeekOptions, +} from '../types.ts'; /** * The locale object with all functions and data needed to parse and format @@ -139,8 +150,8 @@ export interface FormatRelativeFnOptions extends WeekOptions, LocalizedOptions<' * @param options - The object with options */ export type FormatRelativeTokenFn = ( - date: DateType | number | string, - baseDate: DateType | number | string, + date: DateArg, + baseDate: DateArg, options?: FormatRelativeTokenFnOptions, ) => string; @@ -344,7 +355,7 @@ export type LocaleUnitValue = Era | Quarter | Month | Day | LocaleDayPeriod; /** * The format width. Defines how short or long the formatted string might be. - * The actaul result length depends on the locale. + * The actual result length depends on the locale. */ export type LocaleWidth = 'narrow' | 'short' | 'abbreviated' | 'wide' | 'any'; @@ -367,3 +378,5 @@ export type LocaleUnit = | 'month' | 'quarter' | 'year'; + +/* eslint-enable */ diff --git a/src/date-fns/max/index.ts b/src/date-fns/max/index.ts index 7d5429e..69c3542 100644 --- a/src/date-fns/max/index.ts +++ b/src/date-fns/max/index.ts @@ -1,4 +1,15 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextFn, ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link max} function options. + */ +export interface MaxOptions extends ContextOptions {} /** * @name max @@ -9,6 +20,7 @@ import { toDate } from '../toDate/index'; * Return the latest of the given dates. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param dates - The dates to compare * @@ -24,15 +36,22 @@ import { toDate } from '../toDate/index'; * ]) * //=> Sun Jul 02 1995 00:00:00 */ -export function max(dates: Array): DateType | Date { - let result: Date | undefined; - dates.forEach(function (dirtyDate) { - const currentDate = toDate(dirtyDate); +export function max( + dates: DateArg[], + options?: MaxOptions | undefined, +): ResultDate { + let result: ResultDate | undefined; + let context = options?.in; + + dates.forEach((date) => { + // Use the first date object as the context function + if (!context && typeof date === 'object') context = constructFrom.bind(null, date) as ContextFn; - if (result === undefined || result < currentDate || isNaN(Number(currentDate))) { - result = currentDate; - } + const date_ = toDate(date, context); + if (!result || result < date_ || isNaN(+date_)) result = date_; }); - return result || new Date(NaN); + return constructFrom(context, result || NaN); } + +/* eslint-enable */ diff --git a/src/date-fns/milliseconds/index.ts b/src/date-fns/milliseconds/index.ts index 6041640..c5e0d20 100644 --- a/src/date-fns/milliseconds/index.ts +++ b/src/date-fns/milliseconds/index.ts @@ -1,5 +1,9 @@ -import { daysInYear } from '../constants/index'; -import type { Duration } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { daysInYear } from '../constants/index.ts'; +import type { Duration } from '../types.ts'; /** * @name milliseconds @@ -12,7 +16,7 @@ import type { Duration } from '../types'; * * One years equals 365.2425 days according to the formula: * - * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400. + * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400. * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days * * One month is a year divided by 12. @@ -46,3 +50,5 @@ export function milliseconds({ years, months, weeks, days, hours, minutes, secon return Math.trunc(totalSeconds * 1000); } + +/* eslint-enable */ diff --git a/src/date-fns/millisecondsToHours/index.ts b/src/date-fns/millisecondsToHours/index.ts index cba8678..ac02ba6 100644 --- a/src/date-fns/millisecondsToHours/index.ts +++ b/src/date-fns/millisecondsToHours/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInHour } from '../constants/index.ts'; /** * @name millisecondsToHours @@ -26,3 +30,5 @@ export function millisecondsToHours(milliseconds: number): number { const hours = milliseconds / millisecondsInHour; return Math.trunc(hours); } + +/* eslint-enable */ diff --git a/src/date-fns/millisecondsToMinutes/index.ts b/src/date-fns/millisecondsToMinutes/index.ts index 8cfe705..f08d06d 100644 --- a/src/date-fns/millisecondsToMinutes/index.ts +++ b/src/date-fns/millisecondsToMinutes/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInMinute } from '../constants/index.ts'; /** * @name millisecondsToMinutes @@ -26,3 +30,5 @@ export function millisecondsToMinutes(milliseconds: number): number { const minutes = milliseconds / millisecondsInMinute; return Math.trunc(minutes); } + +/* eslint-enable */ diff --git a/src/date-fns/millisecondsToSeconds/index.ts b/src/date-fns/millisecondsToSeconds/index.ts index 8ef32d8..7e46e10 100644 --- a/src/date-fns/millisecondsToSeconds/index.ts +++ b/src/date-fns/millisecondsToSeconds/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInSecond } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInSecond } from '../constants/index.ts'; /** * @name millisecondsToSeconds @@ -13,7 +17,7 @@ import { millisecondsInSecond } from '../constants/index'; * @returns The number of milliseconds converted in seconds * * @example - * // Convert 1000 miliseconds to seconds: + * // Convert 1000 milliseconds to seconds: * const result = millisecondsToSeconds(1000) * //=> 1 * @@ -26,3 +30,5 @@ export function millisecondsToSeconds(milliseconds: number): number { const seconds = milliseconds / millisecondsInSecond; return Math.trunc(seconds); } + +/* eslint-enable */ diff --git a/src/date-fns/min/index.ts b/src/date-fns/min/index.ts index 9ad426f..9c7bd70 100644 --- a/src/date-fns/min/index.ts +++ b/src/date-fns/min/index.ts @@ -1,4 +1,15 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextFn, ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link min} function options. + */ +export interface MinOptions extends ContextOptions {} /** * @name min @@ -9,6 +20,7 @@ import { toDate } from '../toDate/index'; * Returns the earliest of the given dates. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param dates - The dates to compare * @@ -24,15 +36,22 @@ import { toDate } from '../toDate/index'; * ]) * //=> Wed Feb 11 1987 00:00:00 */ -export function min(dates: Array): DateType | Date { - let result: Date | undefined; +export function min( + dates: Array>, + options?: MinOptions | undefined, +): ResultDate { + let result: ResultDate | undefined; + let context = options?.in; + + dates.forEach((date) => { + // Use the first date object as the context function + if (!context && typeof date === 'object') context = constructFrom.bind(null, date) as ContextFn; - dates.forEach((dirtyDate) => { - const date = toDate(dirtyDate); - if (!result || result > date || isNaN(+date)) { - result = date; - } + const date_ = toDate(date, context); + if (!result || result > date_ || isNaN(+date_)) result = date_; }); - return result || new Date(NaN); + return constructFrom(context, result || NaN); } + +/* eslint-enable */ diff --git a/src/date-fns/minutesToHours/index.ts b/src/date-fns/minutesToHours/index.ts index e8cda9b..0dc6723 100644 --- a/src/date-fns/minutesToHours/index.ts +++ b/src/date-fns/minutesToHours/index.ts @@ -1,4 +1,8 @@ -import { minutesInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { minutesInHour } from '../constants/index.ts'; /** * @name minutesToHours @@ -26,3 +30,5 @@ export function minutesToHours(minutes: number): number { const hours = minutes / minutesInHour; return Math.trunc(hours); } + +/* eslint-enable */ diff --git a/src/date-fns/minutesToMilliseconds/index.ts b/src/date-fns/minutesToMilliseconds/index.ts index 006436b..6a794eb 100644 --- a/src/date-fns/minutesToMilliseconds/index.ts +++ b/src/date-fns/minutesToMilliseconds/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInMinute } from '../constants/index.ts'; /** * @name minutesToMilliseconds @@ -20,3 +24,5 @@ import { millisecondsInMinute } from '../constants/index'; export function minutesToMilliseconds(minutes: number): number { return Math.trunc(minutes * millisecondsInMinute); } + +/* eslint-enable */ diff --git a/src/date-fns/minutesToSeconds/index.ts b/src/date-fns/minutesToSeconds/index.ts index c2f4a44..d728fee 100644 --- a/src/date-fns/minutesToSeconds/index.ts +++ b/src/date-fns/minutesToSeconds/index.ts @@ -1,4 +1,8 @@ -import { secondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { secondsInMinute } from '../constants/index.ts'; /** * @name minutesToSeconds @@ -20,3 +24,5 @@ import { secondsInMinute } from '../constants/index'; export function minutesToSeconds(minutes: number): number { return Math.trunc(minutes * secondsInMinute); } + +/* eslint-enable */ diff --git a/src/date-fns/monthsToQuarters/index.ts b/src/date-fns/monthsToQuarters/index.ts index 3d55520..88d3616 100644 --- a/src/date-fns/monthsToQuarters/index.ts +++ b/src/date-fns/monthsToQuarters/index.ts @@ -1,4 +1,8 @@ -import { monthsInQuarter } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { monthsInQuarter } from '../constants/index.ts'; /** * @name monthsToQuarters @@ -26,3 +30,5 @@ export function monthsToQuarters(months: number): number { const quarters = months / monthsInQuarter; return Math.trunc(quarters); } + +/* eslint-enable */ diff --git a/src/date-fns/monthsToYears/index.ts b/src/date-fns/monthsToYears/index.ts index 9f673ca..4f12877 100644 --- a/src/date-fns/monthsToYears/index.ts +++ b/src/date-fns/monthsToYears/index.ts @@ -1,4 +1,8 @@ -import { monthsInYear } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { monthsInYear } from '../constants/index.ts'; /** * @name monthsToYears @@ -25,3 +29,5 @@ export function monthsToYears(months: number): number { const years = months / monthsInYear; return Math.trunc(years); } + +/* eslint-enable */ diff --git a/src/date-fns/nextDay/index.ts b/src/date-fns/nextDay/index.ts index 85836b7..ddfcf2a 100644 --- a/src/date-fns/nextDay/index.ts +++ b/src/date-fns/nextDay/index.ts @@ -1,21 +1,29 @@ -import { addDays } from '../addDays/index'; -import { getDay } from '../getDay/index'; -import type { Day } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import { getDay } from '../getDay/index.ts'; +import type { ContextOptions, DateArg, Day } from '../types.ts'; + +/** + * The {@link nextDay} function options. + */ +export interface NextDayOptions extends ContextOptions {} /** * @name nextDay * @category Weekday Helpers - * @summary When is the next day of the week? - * - * @description - * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday. + * @summary When is the next day of the week? 0-6 the day of the week, 0 represents Sunday. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to check - * @param day - day of the week + * @param day - Day of the week + * @param options - An object with options * - * @returns The date is the next day of week + * @returns The date is the next day of the week * * @example * // When is the next Monday after Mar, 20, 2020? @@ -27,9 +35,15 @@ import type { Day } from '../types'; * const result = nextDay(new Date(2020, 2, 21), 2) * //=> Tue Mar 24 2020 00:00:00 */ -export function nextDay(date: DateType | number | string, day: Day): DateType { - let delta = day - getDay(date); +export function nextDay( + date: DateArg, + day: Day, + options?: NextDayOptions | undefined, +): ResultDate { + let delta = day - getDay(date, options); if (delta <= 0) delta += 7; - return addDays(date, delta); + return addDays(date, delta, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextFriday/index.ts b/src/date-fns/nextFriday/index.ts index b7f79cd..cf02c31 100644 --- a/src/date-fns/nextFriday/index.ts +++ b/src/date-fns/nextFriday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextFriday} function options. + */ +export interface NextFridayOptions extends ContextOptions {} /** * @name nextFriday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Friday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Friday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextFriday(new Date(2020, 2, 22)) * //=> Fri Mar 27 2020 00:00:00 */ -export function nextFriday(date: DateType | number | string): DateType { - return nextDay(date, 5); +export function nextFriday( + date: DateArg, + options?: NextFridayOptions, +): ResultDate { + return nextDay(date, 5, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextMonday/index.ts b/src/date-fns/nextMonday/index.ts index 779fc5f..657fdbb 100644 --- a/src/date-fns/nextMonday/index.ts +++ b/src/date-fns/nextMonday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextMonday} function options. + */ +export interface NextMondayOptions extends ContextOptions {} /** * @name nextMonday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Monday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, returned from the context function if passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Monday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextMonday(new Date(2020, 2, 22)) * //=> Mon Mar 23 2020 00:00:00 */ -export function nextMonday(date: DateType | number | string): DateType { - return nextDay(date, 1); +export function nextMonday( + date: DateArg, + options?: NextMondayOptions | undefined, +): ResultDate { + return nextDay(date, 1, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextSaturday/index.ts b/src/date-fns/nextSaturday/index.ts index 5c71195..5f4a438 100644 --- a/src/date-fns/nextSaturday/index.ts +++ b/src/date-fns/nextSaturday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextSaturday} function options. + */ +export interface NextSaturdayOptions extends ContextOptions {} /** * @name nextSaturday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Saturday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Saturday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextSaturday(new Date(2020, 2, 22)) * //=> Sat Mar 28 2020 00:00:00 */ -export function nextSaturday(date: DateType | number | string): DateType { - return nextDay(date, 6); +export function nextSaturday( + date: DateArg, + options?: NextSaturdayOptions, +): ResultDate { + return nextDay(date, 6, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextSunday/index.ts b/src/date-fns/nextSunday/index.ts index 6d0be10..f166042 100644 --- a/src/date-fns/nextSunday/index.ts +++ b/src/date-fns/nextSunday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextSunday} function options. + */ +export interface NextSundayOptions extends ContextOptions {} /** * @name nextSunday @@ -9,16 +19,23 @@ import { nextDay } from '../nextDay/index'; * When is the next Sunday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned if a context is provided. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Sunday * * @example - * // When is the next Sunday after Mar, 22, 2020? + * // When is the next Sunday after March 22, 2020? * const result = nextSunday(new Date(2020, 2, 22)) * //=> Sun Mar 29 2020 00:00:00 */ -export function nextSunday(date: DateType | number | string): DateType { - return nextDay(date, 0); +export function nextSunday( + date: DateArg, + options?: NextSundayOptions | undefined, +): ResultDate { + return nextDay(date, 0, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextThursday/index.ts b/src/date-fns/nextThursday/index.ts index 34d43c0..da34741 100644 --- a/src/date-fns/nextThursday/index.ts +++ b/src/date-fns/nextThursday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextThursday} function options. + */ +export interface NextThursdayOptions extends ContextOptions {} /** * @name nextThursday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Thursday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Thursday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextThursday(new Date(2020, 2, 22)) * //=> Thur Mar 26 2020 00:00:00 */ -export function nextThursday(date: DateType | number | string): DateType { - return nextDay(date, 4); +export function nextThursday( + date: DateArg, + options?: NextThursdayOptions | undefined, +): ResultDate { + return nextDay(date, 4, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextTuesday/index.ts b/src/date-fns/nextTuesday/index.ts index e56d2f4..6e83b41 100644 --- a/src/date-fns/nextTuesday/index.ts +++ b/src/date-fns/nextTuesday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextTuesday} function options. + */ +export interface NextTuesdayOptions extends ContextOptions {} /** * @name nextTuesday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Tuesday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Tuesday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextTuesday(new Date(2020, 2, 22)) * //=> Tue Mar 24 2020 00:00:00 */ -export function nextTuesday(date: DateType | number | string): DateType { - return nextDay(date, 2); +export function nextTuesday( + date: DateArg, + options?: NextTuesdayOptions, +): ResultDate { + return nextDay(date, 2, options); } + +/* eslint-enable */ diff --git a/src/date-fns/nextWednesday/index.ts b/src/date-fns/nextWednesday/index.ts index 9d2eb8c..75242e2 100644 --- a/src/date-fns/nextWednesday/index.ts +++ b/src/date-fns/nextWednesday/index.ts @@ -1,4 +1,14 @@ -import { nextDay } from '../nextDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { nextDay } from '../nextDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link nextWednesday} function options. + */ +export interface NextWednesdayOptions extends ContextOptions {} /** * @name nextWednesday @@ -9,8 +19,10 @@ import { nextDay } from '../nextDay/index'; * When is the next Wednesday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The next Wednesday * @@ -19,6 +31,11 @@ import { nextDay } from '../nextDay/index'; * const result = nextWednesday(new Date(2020, 2, 22)) * //=> Wed Mar 25 2020 00:00:00 */ -export function nextWednesday(date: DateType | number | string): DateType { - return nextDay(date, 3); +export function nextWednesday( + date: DateArg, + options?: NextWednesdayOptions | undefined, +): ResultDate { + return nextDay(date, 3, options); } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/Parser.ts b/src/date-fns/parse/_lib/Parser.ts index e653eb2..e85cfa6 100644 --- a/src/date-fns/parse/_lib/Parser.ts +++ b/src/date-fns/parse/_lib/Parser.ts @@ -1,6 +1,10 @@ -import type { Match } from '../../locale/types'; -import { ValueSetter } from './Setter'; -import type { ParseFlags, ParseResult, ParserOptions } from './types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../locale/types.ts'; +import { ValueSetter } from './Setter.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from './types.ts'; export abstract class Parser { public abstract incompatibleTokens: string[] | '*'; @@ -37,3 +41,5 @@ export abstract class Parser { options: ParserOptions, ): DateType | [DateType, ParseFlags]; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/Setter.ts b/src/date-fns/parse/_lib/Setter.ts index 3d41609..8c6d78c 100644 --- a/src/date-fns/parse/_lib/Setter.ts +++ b/src/date-fns/parse/_lib/Setter.ts @@ -1,6 +1,11 @@ -import { transpose } from '../../transpose/index'; -import { constructFrom } from '../../constructFrom/index'; -import type { ParseFlags, ParserOptions } from './types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../constructFrom/index.ts'; +import { transpose } from '../../transpose/index.ts'; +import type { ContextFn, DateArg } from '../../types.ts'; +import type { ParseFlags, ParserOptions } from './types.ts'; const TIMEZONE_UNIT_PRIORITY = 10; @@ -13,34 +18,49 @@ export abstract class Setter { } public abstract set( - utcDate: DateType, + date: DateType, flags: ParseFlags, options: ParserOptions, ): DateType | [DateType, ParseFlags]; } export class ValueSetter extends Setter { - constructor( - private value: Value, + private value: Value; + + private validateValue: (date: DateType, value: Value, options: ParserOptions) => boolean; + + private setValue: ( + date: DateType, + flags: ParseFlags, + value: Value, + options: ParserOptions, + ) => DateType | [DateType, ParseFlags]; - private validateValue: (utcDate: DateType, value: Value, options: ParserOptions) => boolean, + public priority: number; - private setValue: ( - utcDate: DateType, + constructor( + value: Value, + validateValue: (date: DateType, value: Value, options: ParserOptions) => boolean, + setValue: ( + date: DateType, flags: ParseFlags, value: Value, options: ParserOptions, ) => DateType | [DateType, ParseFlags], - public priority: number, + priority: number, subPriority?: number, ) { super(); + this.value = value; + this.validateValue = validateValue; + this.setValue = setValue; + this.priority = priority; if (subPriority) { this.subPriority = subPriority; } } - override validate(date: DateType, options: ParserOptions): boolean { + validate(date: DateType, options: ParserOptions): boolean { return this.validateValue(date, this.value, options); } @@ -53,11 +73,20 @@ export class ValueSetter extends Setter { } } -export class DateToSystemTimezoneSetter extends Setter { - priority = TIMEZONE_UNIT_PRIORITY; - override subPriority = -1; +export class DateTimezoneSetter extends Setter { + priority: number = TIMEZONE_UNIT_PRIORITY; + subPriority = -1; + context: ContextFn; + + constructor(context: ContextFn | undefined, reference: DateArg & {}) { + super(); + this.context = context || ((date) => constructFrom(reference, date)); + } + set(date: DateType, flags: ParseFlags): DateType { if (flags.timestampIsSet) return date; - return constructFrom(date, transpose(date, Date)); + return constructFrom(date, transpose(date, this.context)); } } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/constants.ts b/src/date-fns/parse/_lib/constants.ts index 4fbfb67..10c6e07 100644 --- a/src/date-fns/parse/_lib/constants.ts +++ b/src/date-fns/parse/_lib/constants.ts @@ -1,4 +1,28 @@ -export const numericPatterns = { +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +export const numericPatterns: { + month: RegExp; // 0 to 12 + date: RegExp; // 0 to 31 + dayOfYear: RegExp; // 0 to 366 + week: RegExp; // 0 to 53 + hour23h: RegExp; // 0 to 23 + hour24h: RegExp; // 0 to 24 + hour11h: RegExp; // 0 to 11 + hour12h: RegExp; // 0 to 12 + minute: RegExp; // 0 to 59 + second: RegExp; // 0 to 59 + singleDigit: RegExp; // 0 to 9 + twoDigits: RegExp; // 0 to 99 + threeDigits: RegExp; // 0 to 999 + fourDigits: RegExp; // 0 to 9999 + anyDigitsSigned: RegExp; + singleDigitSigned: RegExp; // 0 to 9, -0 to -9 + twoDigitsSigned: RegExp; // 0 to 99, -0 to -99 + threeDigitsSigned: RegExp; // 0 to 999, -0 to -999 + fourDigitsSigned: RegExp; +} = { month: /^(1[0-2]|0?\d)/, // 0 to 12 date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 @@ -22,10 +46,18 @@ export const numericPatterns = { fourDigitsSigned: /^-?\d{1,4}/, // 0 to 9999, -0 to -9999 }; -export const timezonePatterns = { +export const timezonePatterns: { + basicOptionalMinutes: RegExp; + basic: RegExp; + basicOptionalSeconds: RegExp; + extended: RegExp; + extendedOptionalSeconds: RegExp; +} = { basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, basic: /^([+-])(\d{2})(\d{2})|Z/, basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, extended: /^([+-])(\d{2}):(\d{2})|Z/, extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/, }; + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/AMPMMidnightParser.ts b/src/date-fns/parse/_lib/parsers/AMPMMidnightParser.ts index aadffc9..d118be6 100644 --- a/src/date-fns/parse/_lib/parsers/AMPMMidnightParser.ts +++ b/src/date-fns/parse/_lib/parsers/AMPMMidnightParser.ts @@ -1,7 +1,10 @@ -import type { LocaleDayPeriod, Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { dayPeriodEnumToHours } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ + +import type { LocaleDayPeriod, Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { dayPeriodEnumToHours } from '../utils.ts'; export class AMPMMidnightParser extends Parser { priority = 80; @@ -50,5 +53,7 @@ export class AMPMMidnightParser extends Parser { return date; } - incompatibleTokens = ['a', 'B', 'H', 'k', 't', 'T']; + incompatibleTokens: string[] = ['a', 'B', 'H', 'k', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/AMPMParser.ts b/src/date-fns/parse/_lib/parsers/AMPMParser.ts index 8046543..72002a3 100644 --- a/src/date-fns/parse/_lib/parsers/AMPMParser.ts +++ b/src/date-fns/parse/_lib/parsers/AMPMParser.ts @@ -1,7 +1,11 @@ -import type { LocaleDayPeriod, Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { dayPeriodEnumToHours } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { LocaleDayPeriod, Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { dayPeriodEnumToHours } from '../utils.ts'; export class AMPMParser extends Parser { priority = 80; @@ -50,5 +54,7 @@ export class AMPMParser extends Parser { return date; } - incompatibleTokens = ['b', 'B', 'H', 'k', 't', 'T']; + incompatibleTokens: string[] = ['b', 'B', 'H', 'k', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/DateParser.ts b/src/date-fns/parse/_lib/parsers/DateParser.ts index 863eba7..814ab6e 100644 --- a/src/date-fns/parse/_lib/parsers/DateParser.ts +++ b/src/date-fns/parse/_lib/parsers/DateParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { isLeapYearIndex, parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { isLeapYearIndex, parseNDigits, parseNumericPattern } from '../utils.ts'; const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; const DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; @@ -10,7 +14,7 @@ const DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] // Day of the month export class DateParser extends Parser { priority = 90; - override subPriority = 1; + subPriority = 1; parse(dateString: string, token: string, match: Match): ParseResult { switch (token) { @@ -23,14 +27,14 @@ export class DateParser extends Parser { } } - override validate(date: DateType, value: number): boolean { + validate(date: DateType, value: number): boolean { const year = date.getFullYear(); const isLeapYear = isLeapYearIndex(year); const month = date.getMonth(); if (isLeapYear) { - return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]!; + return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; } else { - return value >= 1 && value <= DAYS_IN_MONTH[month]!; + return value >= 1 && value <= DAYS_IN_MONTH[month]; } } @@ -40,5 +44,7 @@ export class DateParser extends Parser { return date; } - incompatibleTokens = ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/DayOfYearParser.ts b/src/date-fns/parse/_lib/parsers/DayOfYearParser.ts index 82b915a..d82e9b8 100644 --- a/src/date-fns/parse/_lib/parsers/DayOfYearParser.ts +++ b/src/date-fns/parse/_lib/parsers/DayOfYearParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { isLeapYearIndex, parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { isLeapYearIndex, parseNDigits, parseNumericPattern } from '../utils.ts'; export class DayOfYearParser extends Parser { priority = 90; @@ -21,7 +25,7 @@ export class DayOfYearParser extends Parser { } } - override validate(date: DateType, value: number): boolean { + validate(date: DateType, value: number): boolean { const year = date.getFullYear(); const isLeapYear = isLeapYearIndex(year); if (isLeapYear) { @@ -37,5 +41,7 @@ export class DayOfYearParser extends Parser { return date; } - incompatibleTokens = ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/DayParser.ts b/src/date-fns/parse/_lib/parsers/DayParser.ts index 3449aef..ddc649a 100644 --- a/src/date-fns/parse/_lib/parsers/DayParser.ts +++ b/src/date-fns/parse/_lib/parsers/DayParser.ts @@ -1,7 +1,11 @@ -import type { Match } from '../../../locale/types'; -import { setDay } from '../../../setDay/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult, ParserOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setDay } from '../../../setDay/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from '../types.ts'; // Day of week export class DayParser extends Parser { @@ -48,7 +52,7 @@ export class DayParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 6; } @@ -58,5 +62,7 @@ export class DayParser extends Parser { return date; } - incompatibleTokens = ['D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['D', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/DayPeriodParser.ts b/src/date-fns/parse/_lib/parsers/DayPeriodParser.ts index 700552c..dd5a7f0 100644 --- a/src/date-fns/parse/_lib/parsers/DayPeriodParser.ts +++ b/src/date-fns/parse/_lib/parsers/DayPeriodParser.ts @@ -1,7 +1,11 @@ -import type { LocaleDayPeriod, Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { dayPeriodEnumToHours } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { LocaleDayPeriod, Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { dayPeriodEnumToHours } from '../utils.ts'; // in the morning, in the afternoon, in the evening, at night export class DayPeriodParser extends Parser { @@ -51,5 +55,7 @@ export class DayPeriodParser extends Parser { return date; } - incompatibleTokens = ['a', 'b', 't', 'T']; + incompatibleTokens: string[] = ['a', 'b', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/EraParser.ts b/src/date-fns/parse/_lib/parsers/EraParser.ts index 40e2c90..b0ed6dd 100644 --- a/src/date-fns/parse/_lib/parsers/EraParser.ts +++ b/src/date-fns/parse/_lib/parsers/EraParser.ts @@ -1,7 +1,11 @@ -import type { Match } from '../../../locale/types'; -import type { Era } from '../../../types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import type { Era } from '../../../types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; export class EraParser extends Parser { priority = 140; @@ -34,5 +38,7 @@ export class EraParser extends Parser { return date; } - incompatibleTokens = ['R', 'u', 't', 'T']; + incompatibleTokens: string[] = ['R', 'u', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ExtendedYearParser.ts b/src/date-fns/parse/_lib/parsers/ExtendedYearParser.ts index 88d00d3..93283f2 100644 --- a/src/date-fns/parse/_lib/parsers/ExtendedYearParser.ts +++ b/src/date-fns/parse/_lib/parsers/ExtendedYearParser.ts @@ -1,6 +1,10 @@ -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigitsSigned } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigitsSigned } from '../utils.ts'; export class ExtendedYearParser extends Parser { priority = 130; @@ -19,5 +23,7 @@ export class ExtendedYearParser extends Parser { return date; } - incompatibleTokens = ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/FractionOfSecondParser.ts b/src/date-fns/parse/_lib/parsers/FractionOfSecondParser.ts index fdb92d3..7d5b7ec 100644 --- a/src/date-fns/parse/_lib/parsers/FractionOfSecondParser.ts +++ b/src/date-fns/parse/_lib/parsers/FractionOfSecondParser.ts @@ -1,6 +1,10 @@ -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { mapValue, parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { mapValue, parseNDigits } from '../utils.ts'; export class FractionOfSecondParser extends Parser { priority = 30; @@ -15,5 +19,7 @@ export class FractionOfSecondParser extends Parser { return date; } - incompatibleTokens = ['t', 'T']; + incompatibleTokens: string[] = ['t', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/Hour0To11Parser.ts b/src/date-fns/parse/_lib/parsers/Hour0To11Parser.ts index 6b1578b..43f1874 100644 --- a/src/date-fns/parse/_lib/parsers/Hour0To11Parser.ts +++ b/src/date-fns/parse/_lib/parsers/Hour0To11Parser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class Hour0To11Parser extends Parser { priority = 70; @@ -18,7 +22,7 @@ export class Hour0To11Parser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 11; } @@ -32,5 +36,7 @@ export class Hour0To11Parser extends Parser { return date; } - incompatibleTokens = ['h', 'H', 'k', 't', 'T']; + incompatibleTokens: string[] = ['h', 'H', 'k', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/Hour0to23Parser.ts b/src/date-fns/parse/_lib/parsers/Hour0to23Parser.ts index 1c40c34..ffa7c44 100644 --- a/src/date-fns/parse/_lib/parsers/Hour0to23Parser.ts +++ b/src/date-fns/parse/_lib/parsers/Hour0to23Parser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class Hour0to23Parser extends Parser { priority = 70; @@ -18,7 +22,7 @@ export class Hour0to23Parser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 23; } @@ -27,5 +31,7 @@ export class Hour0to23Parser extends Parser { return date; } - incompatibleTokens = ['a', 'b', 'h', 'K', 'k', 't', 'T']; + incompatibleTokens: string[] = ['a', 'b', 'h', 'K', 'k', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/Hour1To24Parser.ts b/src/date-fns/parse/_lib/parsers/Hour1To24Parser.ts index 851de66..2c9d8a0 100644 --- a/src/date-fns/parse/_lib/parsers/Hour1To24Parser.ts +++ b/src/date-fns/parse/_lib/parsers/Hour1To24Parser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class Hour1To24Parser extends Parser { priority = 70; @@ -18,7 +22,7 @@ export class Hour1To24Parser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 24; } @@ -28,5 +32,7 @@ export class Hour1To24Parser extends Parser { return date; } - incompatibleTokens = ['a', 'b', 'h', 'H', 'K', 't', 'T']; + incompatibleTokens: string[] = ['a', 'b', 'h', 'H', 'K', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/Hour1to12Parser.ts b/src/date-fns/parse/_lib/parsers/Hour1to12Parser.ts index b2fc6ce..d0a7201 100644 --- a/src/date-fns/parse/_lib/parsers/Hour1to12Parser.ts +++ b/src/date-fns/parse/_lib/parsers/Hour1to12Parser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class Hour1to12Parser extends Parser { priority = 70; @@ -18,7 +22,7 @@ export class Hour1to12Parser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 12; } @@ -34,5 +38,7 @@ export class Hour1to12Parser extends Parser { return date; } - incompatibleTokens = ['H', 'K', 'k', 't', 'T']; + incompatibleTokens: string[] = ['H', 'K', 'k', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ISODayParser.ts b/src/date-fns/parse/_lib/parsers/ISODayParser.ts index fd4c33c..98f376a 100644 --- a/src/date-fns/parse/_lib/parsers/ISODayParser.ts +++ b/src/date-fns/parse/_lib/parsers/ISODayParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { setISODay } from '../../../setISODay/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { mapValue, parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setISODay } from '../../../setISODay/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { mapValue, parseNDigits } from '../utils.ts'; // ISO day of week export class ISODayParser extends Parser { @@ -88,7 +92,7 @@ export class ISODayParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 7; } @@ -98,5 +102,7 @@ export class ISODayParser extends Parser { return date; } - incompatibleTokens = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ISOTimezoneParser.ts b/src/date-fns/parse/_lib/parsers/ISOTimezoneParser.ts index 934a234..68f2b05 100644 --- a/src/date-fns/parse/_lib/parsers/ISOTimezoneParser.ts +++ b/src/date-fns/parse/_lib/parsers/ISOTimezoneParser.ts @@ -1,9 +1,13 @@ -import { constructFrom } from '../../../constructFrom/index'; -import { getTimezoneOffsetInMilliseconds } from '../../../_lib/getTimezoneOffsetInMilliseconds/index'; -import { timezonePatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseTimezonePattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../../constructFrom/index.ts'; +import { getTimezoneOffsetInMilliseconds } from '../../../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { timezonePatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseTimezonePattern } from '../utils.ts'; // Timezone (ISO-8601) export class ISOTimezoneParser extends Parser { @@ -30,5 +34,7 @@ export class ISOTimezoneParser extends Parser { return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value); } - incompatibleTokens = ['t', 'T', 'X']; + incompatibleTokens: string[] = ['t', 'T', 'X']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.ts b/src/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.ts index bb8b076..b34eec1 100644 --- a/src/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.ts +++ b/src/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.ts @@ -1,9 +1,13 @@ -import { constructFrom } from '../../../constructFrom/index'; -import { getTimezoneOffsetInMilliseconds } from '../../../_lib/getTimezoneOffsetInMilliseconds/index'; -import { timezonePatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseTimezonePattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../../constructFrom/index.ts'; +import { getTimezoneOffsetInMilliseconds } from '../../../_lib/getTimezoneOffsetInMilliseconds/index.ts'; +import { timezonePatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseTimezonePattern } from '../utils.ts'; // Timezone (ISO-8601. +00:00 is `'Z'`) export class ISOTimezoneWithZParser extends Parser { @@ -30,5 +34,7 @@ export class ISOTimezoneWithZParser extends Parser { return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value); } - incompatibleTokens = ['t', 'T', 'x']; + incompatibleTokens: string[] = ['t', 'T', 'x']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ISOWeekParser.ts b/src/date-fns/parse/_lib/parsers/ISOWeekParser.ts index 067b1ae..cc9d829 100644 --- a/src/date-fns/parse/_lib/parsers/ISOWeekParser.ts +++ b/src/date-fns/parse/_lib/parsers/ISOWeekParser.ts @@ -1,10 +1,14 @@ -import type { Match } from '../../../locale/types'; -import { setISOWeek } from '../../../setISOWeek/index'; -import { startOfISOWeek } from '../../../startOfISOWeek/index'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setISOWeek } from '../../../setISOWeek/index.ts'; +import { startOfISOWeek } from '../../../startOfISOWeek/index.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; // ISO week of year export class ISOWeekParser extends Parser { @@ -21,7 +25,7 @@ export class ISOWeekParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 53; } @@ -29,5 +33,7 @@ export class ISOWeekParser extends Parser { return startOfISOWeek(setISOWeek(date, value)); } - incompatibleTokens = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/ISOWeekYearParser.ts b/src/date-fns/parse/_lib/parsers/ISOWeekYearParser.ts index 85e355a..fbcf046 100644 --- a/src/date-fns/parse/_lib/parsers/ISOWeekYearParser.ts +++ b/src/date-fns/parse/_lib/parsers/ISOWeekYearParser.ts @@ -1,8 +1,12 @@ -import { startOfISOWeek } from '../../../startOfISOWeek/index'; -import { constructFrom } from '../../../constructFrom/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigitsSigned } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfISOWeek } from '../../../startOfISOWeek/index.ts'; +import { constructFrom } from '../../../constructFrom/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigitsSigned } from '../utils.ts'; // ISO week-numbering year export class ISOWeekYearParser extends Parser { @@ -23,5 +27,7 @@ export class ISOWeekYearParser extends Parser { return startOfISOWeek(firstWeekOfYear); } - incompatibleTokens = ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/LocalDayParser.ts b/src/date-fns/parse/_lib/parsers/LocalDayParser.ts index 6a751fb..abda838 100644 --- a/src/date-fns/parse/_lib/parsers/LocalDayParser.ts +++ b/src/date-fns/parse/_lib/parsers/LocalDayParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { setDay } from '../../../setDay/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult, ParserOptions } from '../types'; -import { mapValue, parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setDay } from '../../../setDay/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from '../types.ts'; +import { mapValue, parseNDigits } from '../utils.ts'; // Local day of week export class LocalDayParser extends Parser { @@ -64,7 +68,7 @@ export class LocalDayParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 6; } @@ -74,5 +78,7 @@ export class LocalDayParser extends Parser { return date; } - incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']; + incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/LocalWeekParser.ts b/src/date-fns/parse/_lib/parsers/LocalWeekParser.ts index 9f577ce..efe3f8f 100644 --- a/src/date-fns/parse/_lib/parsers/LocalWeekParser.ts +++ b/src/date-fns/parse/_lib/parsers/LocalWeekParser.ts @@ -1,10 +1,14 @@ -import type { Match } from '../../../locale/types'; -import { setWeek } from '../../../setWeek/index'; -import { startOfWeek } from '../../../startOfWeek/index'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult, ParserOptions } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setWeek } from '../../../setWeek/index.ts'; +import { startOfWeek } from '../../../startOfWeek/index.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; // Local week of year export class LocalWeekParser extends Parser { @@ -21,7 +25,7 @@ export class LocalWeekParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 53; } @@ -29,5 +33,7 @@ export class LocalWeekParser extends Parser { return startOfWeek(setWeek(date, value, options), options); } - incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']; + incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/LocalWeekYearParser.ts b/src/date-fns/parse/_lib/parsers/LocalWeekYearParser.ts index 147be0d..3910552 100644 --- a/src/date-fns/parse/_lib/parsers/LocalWeekYearParser.ts +++ b/src/date-fns/parse/_lib/parsers/LocalWeekYearParser.ts @@ -1,10 +1,14 @@ -import { getWeekYear } from '../../../getWeekYear/index'; -import type { Match } from '../../../locale/types'; -import { startOfWeek } from '../../../startOfWeek/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult, ParserOptions } from '../types'; -import { mapValue, normalizeTwoDigitYear, parseNDigits } from '../utils'; -import type { YearParserValue } from './YearParser'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getWeekYear } from '../../../getWeekYear/index.ts'; +import type { Match } from '../../../locale/types.ts'; +import { startOfWeek } from '../../../startOfWeek/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from '../types.ts'; +import { mapValue, normalizeTwoDigitYear, parseNDigits } from '../utils.ts'; +import type { YearParserValue } from './YearParser.ts'; // Local week-numbering year export class LocalWeekYearParser extends Parser { @@ -31,7 +35,7 @@ export class LocalWeekYearParser extends Parser { } } - override validate(_date: DateType, value: YearParserValue): boolean { + validate(_date: DateType, value: YearParserValue): boolean { return value.isTwoDigitYear || value.year > 0; } @@ -56,5 +60,7 @@ export class LocalWeekYearParser extends Parser { return startOfWeek(date, options); } - incompatibleTokens = ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']; + incompatibleTokens: string[] = ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/MinuteParser.ts b/src/date-fns/parse/_lib/parsers/MinuteParser.ts index 654f88a..3ebb362 100644 --- a/src/date-fns/parse/_lib/parsers/MinuteParser.ts +++ b/src/date-fns/parse/_lib/parsers/MinuteParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class MinuteParser extends Parser { priority = 60; @@ -18,7 +22,7 @@ export class MinuteParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 59; } @@ -27,5 +31,7 @@ export class MinuteParser extends Parser { return date; } - incompatibleTokens = ['t', 'T']; + incompatibleTokens: string[] = ['t', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/MonthParser.ts b/src/date-fns/parse/_lib/parsers/MonthParser.ts index 362d1c7..0c39ff0 100644 --- a/src/date-fns/parse/_lib/parsers/MonthParser.ts +++ b/src/date-fns/parse/_lib/parsers/MonthParser.ts @@ -1,11 +1,15 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { mapValue, parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { mapValue, parseNDigits, parseNumericPattern } from '../utils.ts'; export class MonthParser extends Parser { - incompatibleTokens = ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; priority = 110; parse(dateString: string, token: string, match: Match): ParseResult { @@ -54,7 +58,7 @@ export class MonthParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 11; } @@ -64,3 +68,5 @@ export class MonthParser extends Parser { return date; } } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/QuarterParser.ts b/src/date-fns/parse/_lib/parsers/QuarterParser.ts index 351f517..b817344 100644 --- a/src/date-fns/parse/_lib/parsers/QuarterParser.ts +++ b/src/date-fns/parse/_lib/parsers/QuarterParser.ts @@ -1,7 +1,11 @@ -import type { Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits } from '../utils.ts'; export class QuarterParser extends Parser { priority = 120; @@ -53,7 +57,7 @@ export class QuarterParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 4; } @@ -63,5 +67,7 @@ export class QuarterParser extends Parser { return date; } - incompatibleTokens = ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/SecondParser.ts b/src/date-fns/parse/_lib/parsers/SecondParser.ts index 8f48430..6a682de 100644 --- a/src/date-fns/parse/_lib/parsers/SecondParser.ts +++ b/src/date-fns/parse/_lib/parsers/SecondParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits, parseNumericPattern } from '../utils.ts'; export class SecondParser extends Parser { priority = 50; @@ -18,7 +22,7 @@ export class SecondParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 59; } @@ -27,5 +31,7 @@ export class SecondParser extends Parser { return date; } - incompatibleTokens = ['t', 'T']; + incompatibleTokens: string[] = ['t', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.ts b/src/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.ts index ec9fa30..c616d13 100644 --- a/src/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.ts +++ b/src/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { setDay } from '../../../setDay/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult, ParserOptions } from '../types'; -import { mapValue, parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { setDay } from '../../../setDay/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult, ParserOptions } from '../types.ts'; +import { mapValue, parseNDigits } from '../utils.ts'; // Stand-alone local day of week export class StandAloneLocalDayParser extends Parser { @@ -65,7 +69,7 @@ export class StandAloneLocalDayParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 6; } @@ -75,5 +79,7 @@ export class StandAloneLocalDayParser extends Parser { return date; } - incompatibleTokens = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']; + incompatibleTokens: string[] = ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/StandAloneMonthParser.ts b/src/date-fns/parse/_lib/parsers/StandAloneMonthParser.ts index a474e33..ad0857e 100644 --- a/src/date-fns/parse/_lib/parsers/StandAloneMonthParser.ts +++ b/src/date-fns/parse/_lib/parsers/StandAloneMonthParser.ts @@ -1,8 +1,12 @@ -import type { Match } from '../../../locale/types'; -import { numericPatterns } from '../constants'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { mapValue, parseNDigits, parseNumericPattern } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { numericPatterns } from '../constants.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { mapValue, parseNDigits, parseNumericPattern } from '../utils.ts'; export class StandAloneMonthParser extends Parser { priority = 110; @@ -53,7 +57,7 @@ export class StandAloneMonthParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 0 && value <= 11; } @@ -63,5 +67,7 @@ export class StandAloneMonthParser extends Parser { return date; } - incompatibleTokens = ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/StandAloneQuarterParser.ts b/src/date-fns/parse/_lib/parsers/StandAloneQuarterParser.ts index 40bf979..022b453 100644 --- a/src/date-fns/parse/_lib/parsers/StandAloneQuarterParser.ts +++ b/src/date-fns/parse/_lib/parsers/StandAloneQuarterParser.ts @@ -1,7 +1,11 @@ -import type { Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseNDigits } from '../utils.ts'; export class StandAloneQuarterParser extends Parser { priority = 120; @@ -53,7 +57,7 @@ export class StandAloneQuarterParser extends Parser { } } - override validate(_date: DateType, value: number): boolean { + validate(_date: DateType, value: number): boolean { return value >= 1 && value <= 4; } @@ -63,5 +67,7 @@ export class StandAloneQuarterParser extends Parser { return date; } - incompatibleTokens = ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.ts b/src/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.ts index 6dc6c85..ca7b715 100644 --- a/src/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.ts +++ b/src/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.ts @@ -1,7 +1,11 @@ -import { constructFrom } from '../../../constructFrom/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseAnyDigitsSigned } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../../constructFrom/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseAnyDigitsSigned } from '../utils.ts'; export class TimestampMillisecondsParser extends Parser { priority = 20; @@ -16,3 +20,5 @@ export class TimestampMillisecondsParser extends Parser { incompatibleTokens = '*' as const; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/TimestampSecondsParser.ts b/src/date-fns/parse/_lib/parsers/TimestampSecondsParser.ts index 8efe9cd..937047b 100644 --- a/src/date-fns/parse/_lib/parsers/TimestampSecondsParser.ts +++ b/src/date-fns/parse/_lib/parsers/TimestampSecondsParser.ts @@ -1,7 +1,11 @@ -import { constructFrom } from '../../../constructFrom/index'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { parseAnyDigitsSigned } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../../../constructFrom/index.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { parseAnyDigitsSigned } from '../utils.ts'; export class TimestampSecondsParser extends Parser { priority = 40; @@ -16,3 +20,5 @@ export class TimestampSecondsParser extends Parser { incompatibleTokens = '*' as const; } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/YearParser.ts b/src/date-fns/parse/_lib/parsers/YearParser.ts index 79482ff..0adc351 100644 --- a/src/date-fns/parse/_lib/parsers/YearParser.ts +++ b/src/date-fns/parse/_lib/parsers/YearParser.ts @@ -1,7 +1,11 @@ -import type { Match } from '../../../locale/types'; -import { Parser } from '../Parser'; -import type { ParseFlags, ParseResult } from '../types'; -import { mapValue, normalizeTwoDigitYear, parseNDigits } from '../utils'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Match } from '../../../locale/types.ts'; +import { Parser } from '../Parser.ts'; +import type { ParseFlags, ParseResult } from '../types.ts'; +import { mapValue, normalizeTwoDigitYear, parseNDigits } from '../utils.ts'; export interface YearParserValue { year: number; @@ -18,7 +22,7 @@ export interface YearParserValue { // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | export class YearParser extends Parser { priority = 130; - incompatibleTokens = ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']; + incompatibleTokens: string[] = ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']; parse(dateString: string, token: string, match: Match): ParseResult { const valueCallback = (year: number) => ({ @@ -41,7 +45,7 @@ export class YearParser extends Parser { } } - override validate(_date: DateType, value: YearParserValue): boolean { + validate(_date: DateType, value: YearParserValue): boolean { return value.isTwoDigitYear || value.year > 0; } @@ -61,3 +65,5 @@ export class YearParser extends Parser { return date; } } + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/parsers/index.ts b/src/date-fns/parse/_lib/parsers/index.ts index 574cbd4..b8a3a42 100644 --- a/src/date-fns/parse/_lib/parsers/index.ts +++ b/src/date-fns/parse/_lib/parsers/index.ts @@ -1,35 +1,39 @@ -import type { Parser } from '../Parser'; -import { EraParser } from './EraParser'; -import { YearParser } from './YearParser'; -import { LocalWeekYearParser } from './LocalWeekYearParser'; -import { ISOWeekYearParser } from './ISOWeekYearParser'; -import { ExtendedYearParser } from './ExtendedYearParser'; -import { QuarterParser } from './QuarterParser'; -import { StandAloneQuarterParser } from './StandAloneQuarterParser'; -import { MonthParser } from './MonthParser'; -import { StandAloneMonthParser } from './StandAloneMonthParser'; -import { LocalWeekParser } from './LocalWeekParser'; -import { ISOWeekParser } from './ISOWeekParser'; -import { DateParser } from './DateParser'; -import { DayOfYearParser } from './DayOfYearParser'; -import { DayParser } from './DayParser'; -import { LocalDayParser } from './LocalDayParser'; -import { StandAloneLocalDayParser } from './StandAloneLocalDayParser'; -import { ISODayParser } from './ISODayParser'; -import { AMPMParser } from './AMPMParser'; -import { AMPMMidnightParser } from './AMPMMidnightParser'; -import { DayPeriodParser } from './DayPeriodParser'; -import { Hour1to12Parser } from './Hour1to12Parser'; -import { Hour0to23Parser } from './Hour0to23Parser'; -import { Hour0To11Parser } from './Hour0To11Parser'; -import { Hour1To24Parser } from './Hour1To24Parser'; -import { MinuteParser } from './MinuteParser'; -import { SecondParser } from './SecondParser'; -import { FractionOfSecondParser } from './FractionOfSecondParser'; -import { ISOTimezoneWithZParser } from './ISOTimezoneWithZParser'; -import { ISOTimezoneParser } from './ISOTimezoneParser'; -import { TimestampSecondsParser } from './TimestampSecondsParser'; -import { TimestampMillisecondsParser } from './TimestampMillisecondsParser'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { Parser } from '../Parser.ts'; +import { EraParser } from './EraParser.ts'; +import { YearParser } from './YearParser.ts'; +import { LocalWeekYearParser } from './LocalWeekYearParser.ts'; +import { ISOWeekYearParser } from './ISOWeekYearParser.ts'; +import { ExtendedYearParser } from './ExtendedYearParser.ts'; +import { QuarterParser } from './QuarterParser.ts'; +import { StandAloneQuarterParser } from './StandAloneQuarterParser.ts'; +import { MonthParser } from './MonthParser.ts'; +import { StandAloneMonthParser } from './StandAloneMonthParser.ts'; +import { LocalWeekParser } from './LocalWeekParser.ts'; +import { ISOWeekParser } from './ISOWeekParser.ts'; +import { DateParser } from './DateParser.ts'; +import { DayOfYearParser } from './DayOfYearParser.ts'; +import { DayParser } from './DayParser.ts'; +import { LocalDayParser } from './LocalDayParser.ts'; +import { StandAloneLocalDayParser } from './StandAloneLocalDayParser.ts'; +import { ISODayParser } from './ISODayParser.ts'; +import { AMPMParser } from './AMPMParser.ts'; +import { AMPMMidnightParser } from './AMPMMidnightParser.ts'; +import { DayPeriodParser } from './DayPeriodParser.ts'; +import { Hour1to12Parser } from './Hour1to12Parser.ts'; +import { Hour0to23Parser } from './Hour0to23Parser.ts'; +import { Hour0To11Parser } from './Hour0To11Parser.ts'; +import { Hour1To24Parser } from './Hour1To24Parser.ts'; +import { MinuteParser } from './MinuteParser.ts'; +import { SecondParser } from './SecondParser.ts'; +import { FractionOfSecondParser } from './FractionOfSecondParser.ts'; +import { ISOTimezoneWithZParser } from './ISOTimezoneWithZParser.ts'; +import { ISOTimezoneParser } from './ISOTimezoneParser.ts'; +import { TimestampSecondsParser } from './TimestampSecondsParser.ts'; +import { TimestampMillisecondsParser } from './TimestampMillisecondsParser.ts'; /* * | | Unit | | Unit | @@ -74,7 +78,6 @@ import { TimestampMillisecondsParser } from './TimestampMillisecondsParser'; * `Y` is supposed to be used in conjunction with `w` and `e` * for week-numbering date specific to the locale. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -- It's ok, we want any here export const parsers: Record> = { G: new EraParser(), y: new YearParser(), @@ -108,3 +111,5 @@ export const parsers: Record> = { t: new TimestampSecondsParser(), T: new TimestampMillisecondsParser(), }; + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/types.ts b/src/date-fns/parse/_lib/types.ts index 3c123fc..23d1e1d 100644 --- a/src/date-fns/parse/_lib/types.ts +++ b/src/date-fns/parse/_lib/types.ts @@ -1,4 +1,8 @@ -import type { LocalizedOptions, FirstWeekContainsDateOptions, WeekOptions } from '../../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { LocalizedOptions, FirstWeekContainsDateOptions, WeekOptions } from '../../types.ts'; export interface ParseFlags { timestampIsSet?: boolean; @@ -8,3 +12,5 @@ export interface ParseFlags { export type ParserOptions = Required & FirstWeekContainsDateOptions & WeekOptions>; export type ParseResult = { value: TValue; rest: string } | null; + +/* eslint-enable */ diff --git a/src/date-fns/parse/_lib/utils.ts b/src/date-fns/parse/_lib/utils.ts index 3f17e7a..8f07c8e 100644 --- a/src/date-fns/parse/_lib/utils.ts +++ b/src/date-fns/parse/_lib/utils.ts @@ -1,7 +1,11 @@ -import type { LocaleDayPeriod } from '../../locale/types'; -import { millisecondsInHour, millisecondsInMinute, millisecondsInSecond } from '../../constants/index'; -import type { ParseResult } from './types'; -import { numericPatterns } from './constants'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { LocaleDayPeriod } from '../../locale/types.ts'; +import { millisecondsInHour, millisecondsInMinute, millisecondsInSecond } from '../../constants/index.ts'; +import type { ParseResult } from './types.ts'; +import { numericPatterns } from './constants.ts'; export function mapValue( parseFnResult: ParseResult, @@ -132,3 +136,5 @@ export function normalizeTwoDigitYear(twoDigitYear: number, currentYear: number) export function isLeapYearIndex(year: number): boolean { return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0); } + +/* eslint-enable */ diff --git a/src/date-fns/parse/index.ts b/src/date-fns/parse/index.ts index 623b542..3bc0451 100644 --- a/src/date-fns/parse/index.ts +++ b/src/date-fns/parse/index.ts @@ -1,18 +1,29 @@ -import { constructFrom } from '../constructFrom/index'; -import { getDefaultOptions } from '../getDefaultOptions/index'; -import { defaultLocale } from '../_lib/defaultLocale/index'; -import { toDate } from '../toDate/index'; -import type { AdditionalTokensOptions, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; -import { longFormatters } from '../_lib/format/longFormatters/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { defaultLocale } from '../_lib/defaultLocale/index.ts'; +import { longFormatters } from '../_lib/format/longFormatters/index.ts'; import { isProtectedDayOfYearToken, isProtectedWeekYearToken, warnOrThrowProtectedError, -} from '../_lib/protectedTokens/index'; -import { parsers } from './_lib/parsers/index'; -import type { Setter } from './_lib/Setter'; -import { DateToSystemTimezoneSetter } from './_lib/Setter'; -import type { ParseFlags, ParserOptions } from './_lib/types'; +} from '../_lib/protectedTokens/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { getDefaultOptions } from '../getDefaultOptions/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { + AdditionalTokensOptions, + ContextOptions, + DateArg, + FirstWeekContainsDateOptions, + LocalizedOptions, + WeekOptions, +} from '../types.ts'; +import type { Setter } from './_lib/Setter.ts'; +import { DateTimezoneSetter } from './_lib/Setter.ts'; +import { parsers } from './_lib/parsers/index.ts'; +import type { ParseFlags, ParserOptions } from './_lib/types.ts'; // Rexports of internal for libraries to use. // See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874 @@ -21,11 +32,12 @@ export { longFormatters, parsers }; /** * The {@link parse} function options. */ -export interface ParseOptions +export interface ParseOptions extends LocalizedOptions<'options' | 'match' | 'formatLong'>, FirstWeekContainsDateOptions, WeekOptions, - AdditionalTokensOptions {} + AdditionalTokensOptions, + ContextOptions {} // This RegExp consists of three parts separated by `|`: // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token @@ -235,7 +247,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/; * * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` * - * `parse` will try to match both formatting and stand-alone units interchangably. + * `parse` will try to match both formatting and stand-alone units interchangeably. * * 2. Any sequence of the identical letters is a pattern, unless it is escaped by * the single quote characters (see below). @@ -284,7 +296,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/; * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years. * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md * - * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month. + * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month. * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md * * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based @@ -317,6 +329,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/; * Time value of Date: http://es5.github.io/#x15.9.1.1 * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param dateStr - The string to parse * @param formatStr - The string of tokens @@ -347,12 +360,13 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/; * }) * //=> Sun Feb 28 2010 00:00:00 */ -export function parse( +export function parse( dateStr: string, formatStr: string, - referenceDate: DateType | number | string, - options?: ParseOptions, -): DateType { + referenceDate: DateArg, + options?: ParseOptions, +): ResultDate { + const invalidDate = () => constructFrom(options?.in || referenceDate, NaN); const defaultOptions = getDefaultOptions(); const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale; @@ -370,13 +384,7 @@ export function parse( defaultOptions.locale?.options?.weekStartsOn ?? 0; - if (formatStr === '') { - if (dateStr === '') { - return toDate(referenceDate); - } else { - return constructFrom(referenceDate, NaN); - } - } + if (!formatStr) return dateStr ? invalidDate() : toDate(referenceDate, options?.in); const subFnOptions: ParserOptions = { firstWeekContainsDate, @@ -384,15 +392,16 @@ export function parse( locale, }; - // If timezone isn't specified, it will be set to the system timezone - const setters: Setter[] = [new DateToSystemTimezoneSetter()]; + // If timezone isn't specified, it will try to use the context or + // the reference date and fallback to the system time zone. + const setters: Setter[] = [new DateTimezoneSetter(options?.in, referenceDate)]; const tokens = formatStr .match(longFormattingTokensRegExp)! .map((substring) => { - const firstCharacter = substring[0]!; + const firstCharacter = substring[0]; if (firstCharacter in longFormatters) { - const longFormatter = longFormatters[firstCharacter]!; + const longFormatter = longFormatters[firstCharacter]; return longFormatter(substring, locale.formatLong); } return substring; @@ -411,7 +420,7 @@ export function parse( } const firstCharacter = token[0]; - const parser = parsers[firstCharacter!]; + const parser = parsers[firstCharacter]; if (parser) { const { incompatibleTokens } = parser; if (Array.isArray(incompatibleTokens)) { @@ -427,19 +436,19 @@ export function parse( throw new RangeError(`The format string mustn't contain \`${token}\` and any other token at the same time`); } - usedTokens.push({ token: firstCharacter!, fullToken: token }); + usedTokens.push({ token: firstCharacter, fullToken: token }); const parseResult = parser.run(dateStr, token, locale.match, subFnOptions); if (!parseResult) { - return constructFrom(referenceDate, NaN); + return invalidDate(); } setters.push(parseResult.setter); dateStr = parseResult.rest; } else { - if (firstCharacter!.match(unescapedLatinCharacterRegExp)) { + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`'); } @@ -454,14 +463,14 @@ export function parse( if (dateStr.indexOf(token) === 0) { dateStr = dateStr.slice(token.length); } else { - return constructFrom(referenceDate, NaN); + return invalidDate(); } } } // Check if the remaining input contains something other than whitespace if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) { - return constructFrom(referenceDate, NaN); + return invalidDate(); } const uniquePrioritySetters = setters @@ -473,19 +482,17 @@ export function parse( ) .map((setterArray) => setterArray[0]); - let date = toDate(referenceDate); + let date = toDate(referenceDate, options?.in); - if (isNaN(date.getTime())) { - return constructFrom(referenceDate, NaN); - } + if (isNaN(+date)) return invalidDate(); const flags: ParseFlags = {}; for (const setter of uniquePrioritySetters) { - if (!setter!.validate(date, subFnOptions)) { - return constructFrom(referenceDate, NaN); + if (!setter.validate(date, subFnOptions)) { + return invalidDate(); } - const result = setter!.set(date, flags, subFnOptions); + const result = setter.set(date, flags, subFnOptions); // Result is tuple (date, flags) if (Array.isArray(result)) { date = result[0]; @@ -496,9 +503,11 @@ export function parse( } } - return constructFrom(referenceDate, date); + return date; } function cleanEscapedString(input: string) { - return input.match(escapedStringRegExp)![1]!.replace(doubleQuoteRegExp, "'"); + return input.match(escapedStringRegExp)![1].replace(doubleQuoteRegExp, "'"); } + +/* eslint-enable */ diff --git a/src/date-fns/parseISO/index.ts b/src/date-fns/parseISO/index.ts index 57c3b6f..8efb334 100644 --- a/src/date-fns/parseISO/index.ts +++ b/src/date-fns/parseISO/index.ts @@ -1,9 +1,16 @@ -import { millisecondsInHour, millisecondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInHour, millisecondsInMinute } from '../constants/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions } from '../types.ts'; /** * The {@link parseISO} function options. */ -export interface ParseISOOptions { +export interface ParseISOOptions extends ContextOptions { /** The additional number of digits in the extended year format */ additionalDigits?: 0 | 1 | 2; } @@ -23,6 +30,7 @@ export interface ParseISOOptions { * the values are invalid, it returns Invalid Date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param argument - The value to convert * @param options - An object with options @@ -40,7 +48,12 @@ export interface ParseISOOptions { * const result = parseISO('+02014101', { additionalDigits: 1 }) * //=> Fri Apr 11 2014 00:00:00 */ -export function parseISO(argument: string, options?: ParseISOOptions): Date { +export function parseISO( + argument: string, + options?: ParseISOOptions, +): ResultDate { + const invalidDate = () => constructFrom(options?.in, NaN); + const additionalDigits = options?.additionalDigits ?? 2; const dateStrings = splitDateString(argument); @@ -50,45 +63,34 @@ export function parseISO(argument: string, options?: ParseISOOptions): Date { date = parseDate(parseYearResult.restDateString, parseYearResult.year); } - if (!date || isNaN(date.getTime())) { - return new Date(NaN); - } + if (!date || isNaN(+date)) return invalidDate(); - const timestamp = date.getTime(); + const timestamp = +date; let time = 0; let offset; if (dateStrings.time) { time = parseTime(dateStrings.time); - if (isNaN(time)) { - return new Date(NaN); - } + if (isNaN(time)) return invalidDate(); } if (dateStrings.timezone) { offset = parseTimezone(dateStrings.timezone); - if (isNaN(offset)) { - return new Date(NaN); - } + if (isNaN(offset)) return invalidDate(); } else { - const dirtyDate = new Date(timestamp + time); - // JS parsed string assuming it's in UTC timezone - // but we need it to be parsed in our timezone - // so we use utc values to build date in our timezone. - // Year values from 0 to 99 map to the years 1900 to 1999 - // so set year explicitly with setFullYear. - const result = new Date(0); - result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate()); + const tmpDate = new Date(timestamp + time); + const result = toDate(0, options?.in); + result.setFullYear(tmpDate.getUTCFullYear(), tmpDate.getUTCMonth(), tmpDate.getUTCDate()); result.setHours( - dirtyDate.getUTCHours(), - dirtyDate.getUTCMinutes(), - dirtyDate.getUTCSeconds(), - dirtyDate.getUTCMilliseconds(), + tmpDate.getUTCHours(), + tmpDate.getUTCMinutes(), + tmpDate.getUTCSeconds(), + tmpDate.getUTCMilliseconds(), ); return result; } - return new Date(timestamp + time + offset); + return toDate(timestamp + time + offset, options?.in); } interface DateString { @@ -123,13 +125,13 @@ function splitDateString(dateString: string): DateString { return dateStrings; } - if (/:/.test(array[0]!)) { + if (/:/.test(array[0])) { timeString = array[0]; } else { - dateStrings.date = array[0]!; + dateStrings.date = array[0]; timeString = array[1]; if (patterns.timeZoneDelimiter.test(dateStrings.date)) { - dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]!; + dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; timeString = dateString.substr(dateStrings.date.length, dateString.length); } } @@ -137,8 +139,8 @@ function splitDateString(dateString: string): DateString { if (timeString) { const token = patterns.timezone.exec(timeString); if (token) { - dateStrings.time = timeString.replace(token[1]!, ''); - dateStrings.timezone = token[1]!; + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timezone = token[1]; } else { dateStrings.time = timeString; } @@ -162,7 +164,7 @@ function parseYear(dateString: string, additionalDigits: number): ParsedYear { // either year or century is null, not both return { year: century === null ? (year as number) : century * 100, - restDateString: dateString.slice((captures[1] || captures[2]!).length), + restDateString: dateString.slice((captures[1] || captures[2]).length), }; } @@ -175,11 +177,11 @@ function parseDate(dateString: string, year: number): Date { if (!captures) return new Date(NaN); const isWeekDate = !!captures[4]; - const dayOfYear = parseDateUnit(captures[1]!); - const month = parseDateUnit(captures[2]!) - 1; - const day = parseDateUnit(captures[3]!); - const week = parseDateUnit(captures[4]!); - const dayOfWeek = parseDateUnit(captures[5]!) - 1; + const dayOfYear = parseDateUnit(captures[1]); + const month = parseDateUnit(captures[2]) - 1; + const day = parseDateUnit(captures[3]); + const week = parseDateUnit(captures[4]); + const dayOfWeek = parseDateUnit(captures[5]) - 1; if (isWeekDate) { if (!validateWeekDate(year, week, dayOfWeek)) { @@ -204,9 +206,9 @@ function parseTime(timeString: string): number { const captures = timeString.match(timeRegex); if (!captures) return NaN; // Invalid ISO-formatted time - const hours = parseTimeUnit(captures[1]!); - const minutes = parseTimeUnit(captures[2]!); - const seconds = parseTimeUnit(captures[3]!); + const hours = parseTimeUnit(captures[1]); + const minutes = parseTimeUnit(captures[2]); + const seconds = parseTimeUnit(captures[3]); if (!validateTime(hours, minutes, seconds)) { return NaN; @@ -226,7 +228,7 @@ function parseTimezone(timezoneString: string): number { if (!captures) return 0; const sign = captures[1] === '+' ? -1 : 1; - const hours = parseInt(captures[2]!); + const hours = parseInt(captures[2]); const minutes = (captures[3] && parseInt(captures[3])) || 0; if (!validateTimezone(hours, minutes)) { @@ -277,3 +279,5 @@ function validateTime(hours: number, minutes: number, seconds: number): boolean function validateTimezone(_hours: number, minutes: number): boolean { return minutes >= 0 && minutes <= 59; } + +/* eslint-enable */ diff --git a/src/date-fns/parseJSON/index.ts b/src/date-fns/parseJSON/index.ts index c4aa8fe..0cbb8c9 100644 --- a/src/date-fns/parseJSON/index.ts +++ b/src/date-fns/parseJSON/index.ts @@ -1,9 +1,16 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link parseJSON} function options. + */ +export interface ParseJSONOptions extends ContextOptions {} + /** - * @name parseJSON - * @category Common Helpers - * @summary Parse a JSON date string - * - * @description * Converts a complete ISO date string in UTC time, the typical format for transmitting * a date in JSON, to a JavaScript `Date` instance. * @@ -28,27 +35,35 @@ * * Any other input type or invalid date strings will return an `Invalid Date`. * + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. + * * @param dateStr - A fully formed ISO8601 date string to convert + * @param options - An object with options * * @returns The parsed date in the local time zone */ -export function parseJSON(dateStr: string): Date { +export function parseJSON( + dateStr: string, + options?: ParseJSONOptions | undefined, +): ResultDate { const parts = dateStr.match( /(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/, ); - if (parts) { - // Group 8 matches the sign - return new Date( - Date.UTC( - +parts[1]!, - +parts[2]! - 1, - +parts[3]!, - +parts[4]! - (+parts[9]! || 0) * (parts[8] == '-' ? -1 : 1), - +parts[5]! - (+parts[10]! || 0) * (parts[8] == '-' ? -1 : 1), - +parts[6]!, - +((parts[7] || '0') + '00').substring(0, 3), - ), - ); - } - return new Date(NaN); + + if (!parts) return toDate(NaN, options?.in); + + return toDate( + Date.UTC( + +parts[1], + +parts[2] - 1, + +parts[3], + +parts[4] - (+parts[9] || 0) * (parts[8] == '-' ? -1 : 1), + +parts[5] - (+parts[10] || 0) * (parts[8] == '-' ? -1 : 1), + +parts[6], + +((parts[7] || '0') + '00').substring(0, 3), + ), + options?.in, + ); } + +/* eslint-enable */ diff --git a/src/date-fns/previousDay/index.ts b/src/date-fns/previousDay/index.ts old mode 100755 new mode 100644 index 8e18017..ab56bfa --- a/src/date-fns/previousDay/index.ts +++ b/src/date-fns/previousDay/index.ts @@ -1,6 +1,15 @@ -import { getDay } from '../getDay/index'; -import { subDays } from '../subDays/index'; -import type { Day } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDay } from '../getDay/index.ts'; +import { subDays } from '../subDays/index.ts'; +import type { ContextOptions, DateArg, Day } from '../types.ts'; + +/** + * The {@link previousDay} function options. + */ +export interface PreviousDayOptions extends ContextOptions {} /** * @name previousDay @@ -11,9 +20,11 @@ import type { Day } from '../types'; * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to check * @param day - The day of the week + * @param options - An object with options * * @returns The date is the previous day of week * @@ -27,9 +38,15 @@ import type { Day } from '../types'; * const result = previousDay(new Date(2020, 2, 21), 2) * //=> Tue Mar 17 2020 00:00:00 */ -export function previousDay(date: DateType | number | string, day: Day): DateType { - let delta = getDay(date) - day; +export function previousDay( + date: DateArg, + day: Day, + options?: PreviousDayOptions | undefined, +): ResultDate { + let delta = getDay(date, options) - day; if (delta <= 0) delta += 7; - return subDays(date, delta); + return subDays(date, delta, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousFriday/index.ts b/src/date-fns/previousFriday/index.ts old mode 100755 new mode 100644 index 04cf33e..2e0b798 --- a/src/date-fns/previousFriday/index.ts +++ b/src/date-fns/previousFriday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousFriday} function options. + */ +export interface PreviousFridayOptions extends ContextOptions {} /** * @name previousFriday @@ -8,9 +18,11 @@ import { previousDay } from '../previousDay/index'; * @description * When is the previous Friday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [UTCDate](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - The options * * @returns The previous Friday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousFriday(new Date(2021, 5, 19)) * //=> Fri June 18 2021 00:00:00 */ -export function previousFriday(date: DateType | number | string): DateType { - return previousDay(date, 5); +export function previousFriday( + date: DateArg, + options?: PreviousFridayOptions | undefined, +): ResultDate { + return previousDay(date, 5, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousMonday/index.ts b/src/date-fns/previousMonday/index.ts old mode 100755 new mode 100644 index 77d8c45..0941f3c --- a/src/date-fns/previousMonday/index.ts +++ b/src/date-fns/previousMonday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousMonday} function options. + */ +export interface PreviousMondayOptions extends ContextOptions {} /** * @name previousMonday @@ -9,8 +19,10 @@ import { previousDay } from '../previousDay/index'; * When is the previous Monday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The previous Monday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousMonday(new Date(2021, 5, 18)) * //=> Mon June 14 2021 00:00:00 */ -export function previousMonday(date: DateType | number | string): DateType { - return previousDay(date, 1); +export function previousMonday( + date: DateArg, + options?: PreviousMondayOptions | undefined, +): ResultDate { + return previousDay(date, 1, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousSaturday/index.ts b/src/date-fns/previousSaturday/index.ts old mode 100755 new mode 100644 index dfef744..b398bf2 --- a/src/date-fns/previousSaturday/index.ts +++ b/src/date-fns/previousSaturday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousSaturday} function options. + */ +export interface PreviousSaturdayOptions extends ContextOptions {} /** * @name previousSaturday @@ -9,8 +19,10 @@ import { previousDay } from '../previousDay/index'; * When is the previous Saturday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - The options * * @returns The previous Saturday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousSaturday(new Date(2021, 5, 20)) * //=> Sat June 19 2021 00:00:00 */ -export function previousSaturday(date: DateType | number | string): DateType { - return previousDay(date, 6); +export function previousSaturday( + date: DateArg, + options?: PreviousSaturdayOptions | undefined, +): ResultDate { + return previousDay(date, 6, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousSunday/index.ts b/src/date-fns/previousSunday/index.ts old mode 100755 new mode 100644 index 56967e5..8f6e6a9 --- a/src/date-fns/previousSunday/index.ts +++ b/src/date-fns/previousSunday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousSunday} function options. + */ +export interface PreviousSundayOptions extends ContextOptions {} /** * @name previousSunday @@ -9,8 +19,10 @@ import { previousDay } from '../previousDay/index'; * When is the previous Sunday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - The options * * @returns The previous Sunday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousSunday(new Date(2021, 5, 21)) * //=> Sun June 20 2021 00:00:00 */ -export function previousSunday(date: DateType | number | string): DateType { - return previousDay(date, 0); +export function previousSunday( + date: DateArg, + options?: PreviousSundayOptions | undefined, +): ResultDate { + return previousDay(date, 0, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousThursday/index.ts b/src/date-fns/previousThursday/index.ts old mode 100755 new mode 100644 index fd516b5..a4095e3 --- a/src/date-fns/previousThursday/index.ts +++ b/src/date-fns/previousThursday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousThursday} function options. + */ +export interface PreviousThursdayOptions extends ContextOptions {} /** * @name previousThursday @@ -9,8 +19,10 @@ import { previousDay } from '../previousDay/index'; * When is the previous Thursday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The previous Thursday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousThursday(new Date(2021, 5, 18)) * //=> Thu June 17 2021 00:00:00 */ -export function previousThursday(date: DateType | number | string): DateType { - return previousDay(date, 4); +export function previousThursday( + date: DateArg, + options?: PreviousThursdayOptions | undefined, +): ResultDate { + return previousDay(date, 4, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousTuesday/index.ts b/src/date-fns/previousTuesday/index.ts old mode 100755 new mode 100644 index 2da37f4..09116dc --- a/src/date-fns/previousTuesday/index.ts +++ b/src/date-fns/previousTuesday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousTuesday} function options. + */ +export interface PreviousTuesdayOptions extends ContextOptions {} /** * @name previousTuesday @@ -9,8 +19,10 @@ import { previousDay } from '../previousDay/index'; * When is the previous Tuesday? * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The previous Tuesday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousTuesday(new Date(2021, 5, 18)) * //=> Tue June 15 2021 00:00:00 */ -export function previousTuesday(date: DateType | number | string): DateType { - return previousDay(date, 2); +export function previousTuesday( + date: DateArg, + options?: PreviousTuesdayOptions | undefined, +): ResultDate { + return previousDay(date, 2, options); } + +/* eslint-enable */ diff --git a/src/date-fns/previousWednesday/index.ts b/src/date-fns/previousWednesday/index.ts old mode 100755 new mode 100644 index 7c04805..d5431c6 --- a/src/date-fns/previousWednesday/index.ts +++ b/src/date-fns/previousWednesday/index.ts @@ -1,4 +1,14 @@ -import { previousDay } from '../previousDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { previousDay } from '../previousDay/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link previousWednesday} function options. + */ +export interface PreviousWednesdayOptions extends ContextOptions {} /** * @name previousWednesday @@ -8,9 +18,11 @@ import { previousDay } from '../previousDay/index'; * @description * When is the previous Wednesday? * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The Date type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [UTCDate](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to start counting from + * @param options - An object with options * * @returns The previous Wednesday * @@ -19,6 +31,11 @@ import { previousDay } from '../previousDay/index'; * const result = previousWednesday(new Date(2021, 5, 18)) * //=> Wed June 16 2021 00:00:00 */ -export function previousWednesday(date: DateType | number | string): DateType { - return previousDay(date, 3); +export function previousWednesday( + date: DateArg, + options?: PreviousWednesdayOptions | undefined, +): ResultDate { + return previousDay(date, 3, options); } + +/* eslint-enable */ diff --git a/src/date-fns/quartersToMonths/index.ts b/src/date-fns/quartersToMonths/index.ts index 491bb7a..a4d2b44 100644 --- a/src/date-fns/quartersToMonths/index.ts +++ b/src/date-fns/quartersToMonths/index.ts @@ -1,4 +1,8 @@ -import { monthsInQuarter } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { monthsInQuarter } from '../constants/index.ts'; /** * @name quartersToMonths @@ -8,8 +12,6 @@ import { monthsInQuarter } from '../constants/index'; * @description * Convert a number of quarters to a full number of months. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param quarters - The number of quarters to be converted * * @returns The number of quarters converted in months @@ -22,3 +24,5 @@ import { monthsInQuarter } from '../constants/index'; export function quartersToMonths(quarters: number): number { return Math.trunc(quarters * monthsInQuarter); } + +/* eslint-enable */ diff --git a/src/date-fns/quartersToYears/index.ts b/src/date-fns/quartersToYears/index.ts index 0109a27..106d7ca 100644 --- a/src/date-fns/quartersToYears/index.ts +++ b/src/date-fns/quartersToYears/index.ts @@ -1,4 +1,8 @@ -import { quartersInYear } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { quartersInYear } from '../constants/index.ts'; /** * @name quartersToYears @@ -8,8 +12,6 @@ import { quartersInYear } from '../constants/index'; * @description * Convert a number of quarters to a full number of years. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). - * * @param quarters - The number of quarters to be converted * * @returns The number of quarters converted in years @@ -28,3 +30,5 @@ export function quartersToYears(quarters: number): number { const years = quarters / quartersInYear; return Math.trunc(years); } + +/* eslint-enable */ diff --git a/src/date-fns/roundToNearestHours/index.ts b/src/date-fns/roundToNearestHours/index.ts index 9cd729a..943eca0 100644 --- a/src/date-fns/roundToNearestHours/index.ts +++ b/src/date-fns/roundToNearestHours/index.ts @@ -1,12 +1,19 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { constructFrom } from '../constructFrom/index'; -import { toDate } from '../toDate/index'; -import type { NearestHours, NearestToUnitOptions, RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, NearestHours, NearestToUnitOptions, RoundingOptions } from '../types.ts'; /** * The {@link roundToNearestHours} function options. */ -export interface RoundToNearestHoursOptions extends NearestToUnitOptions, RoundingOptions {} +export interface RoundToNearestHoursOptions + extends NearestToUnitOptions, + RoundingOptions, + ContextOptions {} /** * @name roundToNearestHours @@ -18,6 +25,7 @@ export interface RoundToNearestHoursOptions extends NearestToUnitOptions Thu Jul 10 2014 12:00:00 - + * * @example * // Round 10 July 2014 12:34:56 to nearest half hour: * const result = roundToNearestHours(new Date(2014, 6, 10, 12, 34, 56), { nearestTo: 8 }) * //=> Thu Jul 10 2014 16:00:00 - -* @example + * + * @example * // Floor (rounds down) 10 July 2014 12:34:56 to nearest hour: * const result = roundToNearestHours(new Date(2014, 6, 10, 1, 23, 45), { roundingMethod: 'ceil' }) * //=> Thu Jul 10 2014 02:00:00 @@ -49,28 +57,27 @@ export interface RoundToNearestHoursOptions extends NearestToUnitOptions Thu Jul 10 2014 08:00:00 */ -export function roundToNearestHours( - date: DateType | number | string, - options?: RoundToNearestHoursOptions, -): Date { +export function roundToNearestHours( + date: DateArg, + options?: RoundToNearestHoursOptions, +): ResultDate { const nearestTo = options?.nearestTo ?? 1; - if (nearestTo < 1 || nearestTo > 12) return constructFrom(date, NaN); + if (nearestTo < 1 || nearestTo > 12) return constructFrom(options?.in || date, NaN); - const _date = toDate(date); - const fractionalMinutes = _date.getMinutes() / 60; - const fractionalSeconds = _date.getSeconds() / 60 / 60; - const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60 / 60; - const hours = _date.getHours() + fractionalMinutes + fractionalSeconds + fractionalMilliseconds; + const date_ = toDate(date, options?.in); + const fractionalMinutes = date_.getMinutes() / 60; + const fractionalSeconds = date_.getSeconds() / 60 / 60; + const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60 / 60; + const hours = date_.getHours() + fractionalMinutes + fractionalSeconds + fractionalMilliseconds; - // Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc' const method = options?.roundingMethod ?? 'round'; const roundingMethod = getRoundingMethod(method); - // nearestTo option does not care daylight savings time const roundedHours = roundingMethod(hours / nearestTo) * nearestTo; - const result = constructFrom(date, _date); - result.setHours(roundedHours, 0, 0, 0); - return result; + date_.setHours(roundedHours, 0, 0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/roundToNearestMinutes/index.ts b/src/date-fns/roundToNearestMinutes/index.ts index d1218e2..4ed88c8 100644 --- a/src/date-fns/roundToNearestMinutes/index.ts +++ b/src/date-fns/roundToNearestMinutes/index.ts @@ -1,12 +1,19 @@ -import { getRoundingMethod } from '../_lib/getRoundingMethod/index'; -import { constructFrom } from '../constructFrom/index'; -import { toDate } from '../toDate/index'; -import type { NearestMinutes, NearestToUnitOptions, RoundingOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getRoundingMethod } from '../_lib/getRoundingMethod/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, NearestMinutes, NearestToUnitOptions, RoundingOptions } from '../types.ts'; /** * The {@link roundToNearestMinutes} function options. */ -export interface RoundToNearestMinutesOptions extends NearestToUnitOptions, RoundingOptions {} +export interface RoundToNearestMinutesOptions + extends NearestToUnitOptions, + RoundingOptions, + ContextOptions {} /** * @name roundToNearestMinutes @@ -18,6 +25,7 @@ export interface RoundToNearestMinutesOptions extends NearestToUnitOptions Thu Jul 10 2014 12:30:00 */ -export function roundToNearestMinutes( - date: DateType | number | string, - options?: RoundToNearestMinutesOptions, -): DateType { +export function roundToNearestMinutes( + date: DateArg, + options?: RoundToNearestMinutesOptions, +): ResultDate { const nearestTo = options?.nearestTo ?? 1; if (nearestTo < 1 || nearestTo > 30) return constructFrom(date, NaN); - const _date = toDate(date); - const fractionalSeconds = _date.getSeconds() / 60; - const fractionalMilliseconds = _date.getMilliseconds() / 1000 / 60; - const minutes = _date.getMinutes() + fractionalSeconds + fractionalMilliseconds; + const date_ = toDate(date, options?.in); + const fractionalSeconds = date_.getSeconds() / 60; + const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60; + const minutes = date_.getMinutes() + fractionalSeconds + fractionalMilliseconds; - // Unlike the `differenceIn*` functions, the default rounding behavior is `round` and not 'trunc' const method = options?.roundingMethod ?? 'round'; const roundingMethod = getRoundingMethod(method); const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo; - const result = constructFrom(date, _date); - result.setMinutes(roundedMinutes, 0, 0); - return result; + date_.setMinutes(roundedMinutes, 0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/secondsToHours/index.ts b/src/date-fns/secondsToHours/index.ts index fbffc46..5e0c0b1 100644 --- a/src/date-fns/secondsToHours/index.ts +++ b/src/date-fns/secondsToHours/index.ts @@ -1,4 +1,8 @@ -import { secondsInHour } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { secondsInHour } from '../constants/index.ts'; /** * @name secondsToHours @@ -26,3 +30,5 @@ export function secondsToHours(seconds: number): number { const hours = seconds / secondsInHour; return Math.trunc(hours); } + +/* eslint-enable */ diff --git a/src/date-fns/secondsToMilliseconds/index.ts b/src/date-fns/secondsToMilliseconds/index.ts index 20106a8..4ec8705 100644 --- a/src/date-fns/secondsToMilliseconds/index.ts +++ b/src/date-fns/secondsToMilliseconds/index.ts @@ -1,4 +1,8 @@ -import { millisecondsInSecond } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { millisecondsInSecond } from '../constants/index.ts'; /** * @name secondsToMilliseconds @@ -20,3 +24,5 @@ import { millisecondsInSecond } from '../constants/index'; export function secondsToMilliseconds(seconds: number): number { return seconds * millisecondsInSecond; } + +/* eslint-enable */ diff --git a/src/date-fns/secondsToMinutes/index.ts b/src/date-fns/secondsToMinutes/index.ts index 615280f..ea6a218 100644 --- a/src/date-fns/secondsToMinutes/index.ts +++ b/src/date-fns/secondsToMinutes/index.ts @@ -1,4 +1,8 @@ -import { secondsInMinute } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { secondsInMinute } from '../constants/index.ts'; /** * @name secondsToMinutes @@ -26,3 +30,5 @@ export function secondsToMinutes(seconds: number): number { const minutes = seconds / secondsInMinute; return Math.trunc(minutes); } + +/* eslint-enable */ diff --git a/src/date-fns/set/index.ts b/src/date-fns/set/index.ts index f3b16de..c0d6569 100644 --- a/src/date-fns/set/index.ts +++ b/src/date-fns/set/index.ts @@ -1,7 +1,16 @@ -import { constructFrom } from '../constructFrom/index'; -import { setMonth } from '../setMonth/index'; -import { toDate } from '../toDate/index'; -import type { DateValues } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { setMonth } from '../setMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, DateValues } from '../types.ts'; + +/** + * The {@link set} function options. + */ +export interface SetOptions extends ContextOptions {} /** * @name set @@ -19,9 +28,11 @@ import type { DateValues } from '../types'; * other `setX` functions that date-fns provides if you are concerned about the bundle size. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param values - The date values to be set + * @param options - The options * * @returns The new date with options set * @@ -35,42 +46,25 @@ import type { DateValues } from '../types'; * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 }) * //=> Mon Sep 01 2014 12:23:45 */ - -export function set(date: DateType | number | string, values: DateValues): DateType { - let _date = toDate(date); +export function set( + date: DateArg, + values: DateValues, + options?: SetOptions, +): ResultDate { + let _date = toDate(date, options?.in); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - if (isNaN(+_date)) { - return constructFrom(date, NaN); - } - - if (values.year != null) { - _date.setFullYear(values.year); - } + if (isNaN(+_date)) return constructFrom(options?.in || date, NaN); - if (values.month != null) { - _date = setMonth(_date, values.month); - } - - if (values.date != null) { - _date.setDate(values.date); - } - - if (values.hours != null) { - _date.setHours(values.hours); - } - - if (values.minutes != null) { - _date.setMinutes(values.minutes); - } - - if (values.seconds != null) { - _date.setSeconds(values.seconds); - } - - if (values.milliseconds != null) { - _date.setMilliseconds(values.milliseconds); - } + if (values.year != null) _date.setFullYear(values.year); + if (values.month != null) _date = setMonth(_date, values.month); + if (values.date != null) _date.setDate(values.date); + if (values.hours != null) _date.setHours(values.hours); + if (values.minutes != null) _date.setMinutes(values.minutes); + if (values.seconds != null) _date.setSeconds(values.seconds); + if (values.milliseconds != null) _date.setMilliseconds(values.milliseconds); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setDate/index.ts b/src/date-fns/setDate/index.ts index 98c4891..c27fa1f 100644 --- a/src/date-fns/setDate/index.ts +++ b/src/date-fns/setDate/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setDate} function options. + */ +export interface SetDateOptions extends ContextOptions {} /** * @name setDate @@ -8,10 +18,12 @@ import { toDate } from '../toDate/index'; * @description * Set the day of the month to the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param dayOfMonth - The day of the month of the new date + * @param options - The options * * @returns The new date with the day of the month set * @@ -20,8 +32,14 @@ import { toDate } from '../toDate/index'; * const result = setDate(new Date(2014, 8, 1), 30) * //=> Tue Sep 30 2014 00:00:00 */ -export function setDate(date: DateType | number | string, dayOfMonth: number): DateType { - const _date = toDate(date); +export function setDate( + date: DateArg, + dayOfMonth: number, + options?: SetDateOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setDate(dayOfMonth); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setDay/index.ts b/src/date-fns/setDay/index.ts index b32a179..651d0a2 100644 --- a/src/date-fns/setDay/index.ts +++ b/src/date-fns/setDay/index.ts @@ -1,12 +1,19 @@ -import { addDays } from '../addDays/index'; -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { addDays } from '../addDays/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link setDay} function options. */ -export interface SetDayOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface SetDayOptions + extends LocalizedOptions<'options'>, + WeekOptions, + ContextOptions {} /** * @name setDay @@ -17,6 +24,7 @@ export interface SetDayOptions extends LocalizedOptions<'options'>, WeekOptions * Set the day of the week to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param day - The day of the week of the new date @@ -34,11 +42,11 @@ export interface SetDayOptions extends LocalizedOptions<'options'>, WeekOptions * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 00:00:00 */ -export function setDay( - date: DateType | number | string, +export function setDay( + date: DateArg, day: number, - options?: SetDayOptions, -): DateType { + options?: SetDayOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? @@ -47,8 +55,8 @@ export function setDay( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const _date = toDate(date); - const currentDay = _date.getDay(); + const date_ = toDate(date, options?.in); + const currentDay = date_.getDay(); const remainder = day % 7; const dayIndex = (remainder + 7) % 7; @@ -56,5 +64,7 @@ export function setDay( const delta = 7 - weekStartsOn; const diff = day < 0 || day > 6 ? day - ((currentDay + delta) % 7) : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7); - return addDays(_date, diff); + return addDays(date_, diff, options); } + +/* eslint-enable */ diff --git a/src/date-fns/setDayOfYear/index.ts b/src/date-fns/setDayOfYear/index.ts index 91d27f5..6e08047 100644 --- a/src/date-fns/setDayOfYear/index.ts +++ b/src/date-fns/setDayOfYear/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setDayOfYear} function options. + */ +export interface SetDayOfYearOptions extends ContextOptions {} /** * @name setDayOfYear @@ -9,9 +19,11 @@ import { toDate } from '../toDate/index'; * Set the day of the year to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param dayOfYear - The day of the year of the new date + * @param options - An object with options * * @returns The new date with the day of the year set * @@ -20,9 +32,15 @@ import { toDate } from '../toDate/index'; * const result = setDayOfYear(new Date(2014, 6, 2), 2) * //=> Thu Jan 02 2014 00:00:00 */ -export function setDayOfYear(date: DateType | number | string, dayOfYear: number): DateType { - const _date = toDate(date); - _date.setMonth(0); - _date.setDate(dayOfYear); - return _date; +export function setDayOfYear( + date: DateArg, + dayOfYear: number, + options?: SetDayOfYearOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + date_.setMonth(0); + date_.setDate(dayOfYear); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/setDefaultOptions/index.ts b/src/date-fns/setDefaultOptions/index.ts index 0909b1a..a841e85 100644 --- a/src/date-fns/setDefaultOptions/index.ts +++ b/src/date-fns/setDefaultOptions/index.ts @@ -1,5 +1,9 @@ -import type { DefaultOptions } from '../_lib/defaultOptions/index'; -import { getDefaultOptions, setDefaultOptions as setInternalDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import type { DefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { getDefaultOptions, setDefaultOptions as setInternalDefaultOptions } from '../_lib/defaultOptions/index.ts'; /** * @name setDefaultOptions @@ -52,7 +56,7 @@ export function setDefaultOptions(options: DefaultOptions): void { for (const property in defaultOptions) { if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type + // [TODO] I challenge you to fix the type (result as any)[property] = defaultOptions[property as keyof DefaultOptions]; } } @@ -60,10 +64,10 @@ export function setDefaultOptions(options: DefaultOptions): void { for (const property in options) { if (Object.prototype.hasOwnProperty.call(options, property)) { if (options[property as keyof DefaultOptions] === undefined) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type + // [TODO] I challenge you to fix the type delete (result as any)[property]; } else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type + // [TODO] I challenge you to fix the type (result as any)[property] = options[property as keyof DefaultOptions]; } } @@ -71,3 +75,5 @@ export function setDefaultOptions(options: DefaultOptions): void { setInternalDefaultOptions(result); } + +/* eslint-enable */ diff --git a/src/date-fns/setHours/index.ts b/src/date-fns/setHours/index.ts index f82614a..9201beb 100644 --- a/src/date-fns/setHours/index.ts +++ b/src/date-fns/setHours/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setHours} function options. + */ +export interface SetHoursOptions extends ContextOptions {} /** * @name setHours @@ -9,9 +19,11 @@ import { toDate } from '../toDate/index'; * Set the hours to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param hours - The hours of the new date + * @param options - An object with options * * @returns The new date with the hours set * @@ -20,8 +32,14 @@ import { toDate } from '../toDate/index'; * const result = setHours(new Date(2014, 8, 1, 11, 30), 4) * //=> Mon Sep 01 2014 04:30:00 */ -export function setHours(date: DateType | number | string, hours: number): DateType { - const _date = toDate(date); +export function setHours( + date: DateArg, + hours: number, + options?: SetHoursOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setHours(hours); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setISODay/index.ts b/src/date-fns/setISODay/index.ts index 0205b98..c08dda1 100644 --- a/src/date-fns/setISODay/index.ts +++ b/src/date-fns/setISODay/index.ts @@ -1,6 +1,16 @@ -import { addDays } from '../addDays/index'; -import { getISODay } from '../getISODay/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import { getISODay } from '../getISODay/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setISODay} function options. + */ +export interface SetISODayOptions extends ContextOptions {} /** * @name setISODay @@ -10,12 +20,14 @@ import { toDate } from '../toDate/index'; * @description * Set the day of the ISO week to the given date. * ISO week starts with Monday. - * 7 is the index of Sunday, 1 is the index of Monday etc. + * 7 is the index of Sunday, 1 is the index of Monday, etc. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param day - The day of the ISO week of the new date + * @param options - An object with options * * @returns The new date with the day of the ISO week set * @@ -24,9 +36,15 @@ import { toDate } from '../toDate/index'; * const result = setISODay(new Date(2014, 8, 1), 7) * //=> Sun Sep 07 2014 00:00:00 */ -export function setISODay(date: DateType | number | string, day: number): DateType { - const _date = toDate(date); - const currentDay = getISODay(_date); +export function setISODay( + date: DateArg, + day: number, + options?: SetISODayOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + const currentDay = getISODay(date_, options); const diff = day - currentDay; - return addDays(_date, diff); + return addDays(date_, diff, options); } + +/* eslint-enable */ diff --git a/src/date-fns/setISOWeek/index.ts b/src/date-fns/setISOWeek/index.ts index 4542858..5603ddd 100644 --- a/src/date-fns/setISOWeek/index.ts +++ b/src/date-fns/setISOWeek/index.ts @@ -1,5 +1,15 @@ -import { getISOWeek } from '../getISOWeek/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getISOWeek } from '../getISOWeek/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setISOWeek} function options. + */ +export interface SetISOWeekOptions extends ContextOptions {} /** * @name setISOWeek @@ -12,9 +22,11 @@ import { toDate } from '../toDate/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The `Date` type of the context function. * * @param date - The date to be changed * @param week - The ISO week of the new date + * @param options - An object with options * * @returns The new date with the ISO week set * @@ -23,9 +35,15 @@ import { toDate } from '../toDate/index'; * const result = setISOWeek(new Date(2004, 7, 7), 53) * //=> Sat Jan 01 2005 00:00:00 */ -export function setISOWeek(date: DateType | number | string, week: number): DateType { - const _date = toDate(date); - const diff = getISOWeek(_date) - week; +export function setISOWeek( + date: DateArg, + week: number, + options?: SetISOWeekOptions, +): ResultDate { + const _date = toDate(date, options?.in); + const diff = getISOWeek(_date, options) - week; _date.setDate(_date.getDate() - diff * 7); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setISOWeekYear/index.ts b/src/date-fns/setISOWeekYear/index.ts index 4c36d36..a57bc5b 100644 --- a/src/date-fns/setISOWeekYear/index.ts +++ b/src/date-fns/setISOWeekYear/index.ts @@ -1,7 +1,17 @@ -import { constructFrom } from '../constructFrom/index'; -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { startOfISOWeekYear } from '../startOfISOWeekYear/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { startOfISOWeekYear } from '../startOfISOWeekYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setISOWeekYear} function options. + */ +export interface SetISOWeekYearOptions extends ContextOptions {} /** * @name setISOWeekYear @@ -14,10 +24,12 @@ import { toDate } from '../toDate/index'; * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param weekYear - The ISO week-numbering year of the new date + * @param options - An object with options * * @returns The new date with the ISO week-numbering year set * @@ -26,13 +38,19 @@ import { toDate } from '../toDate/index'; * const result = setISOWeekYear(new Date(2008, 11, 29), 2007) * //=> Mon Jan 01 2007 00:00:00 */ -export function setISOWeekYear(date: DateType | number | string, weekYear: number): DateType { - let _date = toDate(date); - const diff = differenceInCalendarDays(_date, startOfISOWeekYear(_date)); - const fourthOfJanuary = constructFrom(date, 0); +export function setISOWeekYear( + date: DateArg, + weekYear: number, + options?: SetISOWeekYearOptions | undefined, +): ResultDate { + let _date = toDate(date, options?.in); + const diff = differenceInCalendarDays(_date, startOfISOWeekYear(_date, options)); + const fourthOfJanuary = constructFrom(options?.in || date, 0); fourthOfJanuary.setFullYear(weekYear, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); _date = startOfISOWeekYear(fourthOfJanuary); _date.setDate(_date.getDate() + diff); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setMilliseconds/index.ts b/src/date-fns/setMilliseconds/index.ts index 2dc6ba0..e2a4f6a 100644 --- a/src/date-fns/setMilliseconds/index.ts +++ b/src/date-fns/setMilliseconds/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setMilliseconds} function options. + */ +export interface SetMillisecondsOptions extends ContextOptions {} /** * @name setMilliseconds @@ -9,9 +19,11 @@ import { toDate } from '../toDate/index'; * Set the milliseconds to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param milliseconds - The milliseconds of the new date + * @param options - The options * * @returns The new date with the milliseconds set * @@ -20,11 +32,14 @@ import { toDate } from '../toDate/index'; * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) * //=> Mon Sep 01 2014 11:30:40.300 */ -export function setMilliseconds( - date: DateType | number | string, +export function setMilliseconds( + date: DateArg, milliseconds: number, -): DateType { - const _date = toDate(date); + options?: SetMillisecondsOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setMilliseconds(milliseconds); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setMinutes/index.ts b/src/date-fns/setMinutes/index.ts index 6ec6b1f..b1033a5 100644 --- a/src/date-fns/setMinutes/index.ts +++ b/src/date-fns/setMinutes/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setMinutes} function options. + */ +export interface SetMinutesOptions extends ContextOptions {} /** * @name setMinutes @@ -8,10 +18,12 @@ import { toDate } from '../toDate/index'; * @description * Set the minutes to the given date. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments. * * @param date - The date to be changed * @param minutes - The minutes of the new date + * @param options - An object with options * * @returns The new date with the minutes set * @@ -20,8 +32,14 @@ import { toDate } from '../toDate/index'; * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) * //=> Mon Sep 01 2014 11:45:40 */ -export function setMinutes(date: DateType | number | string, minutes: number): DateType { - const _date = toDate(date); - _date.setMinutes(minutes); - return _date; +export function setMinutes( + date: DateArg, + minutes: number, + options?: SetMinutesOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + date_.setMinutes(minutes); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/setMonth/index.ts b/src/date-fns/setMonth/index.ts index 0dc9fd5..36c4f6b 100644 --- a/src/date-fns/setMonth/index.ts +++ b/src/date-fns/setMonth/index.ts @@ -1,6 +1,16 @@ -import { constructFrom } from '../constructFrom/index'; -import { getDaysInMonth } from '../getDaysInMonth/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { getDaysInMonth } from '../getDaysInMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setMonth} function options. + */ +export interface SetMonthOptions extends ContextOptions {} /** * @name setMonth @@ -11,9 +21,11 @@ import { toDate } from '../toDate/index'; * Set the month to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param month - The month index to set (0-11) + * @param options - The options * * @returns The new date with the month set * @@ -22,17 +34,23 @@ import { toDate } from '../toDate/index'; * const result = setMonth(new Date(2014, 8, 1), 1) * //=> Sat Feb 01 2014 00:00:00 */ -export function setMonth(date: DateType | number | string, month: number): DateType { - const _date = toDate(date); +export function setMonth( + date: DateArg, + month: number, + options?: SetMonthOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const day = _date.getDate(); - const dateWithDesiredMonth = constructFrom(date, 0); - dateWithDesiredMonth.setFullYear(year, month, 15); - dateWithDesiredMonth.setHours(0, 0, 0, 0); - const daysInMonth = getDaysInMonth(dateWithDesiredMonth); - // Set the last day of the new month - // if the original date was the last day of the longer month + const midMonth = constructFrom(options?.in || date, 0); + midMonth.setFullYear(year, month, 15); + midMonth.setHours(0, 0, 0, 0); + const daysInMonth = getDaysInMonth(midMonth); + + // Set the earlier date, allows to wrap Jan 31 to Feb 28 _date.setMonth(month, Math.min(day, daysInMonth)); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setQuarter/index.ts b/src/date-fns/setQuarter/index.ts index 0df09d4..925f698 100644 --- a/src/date-fns/setQuarter/index.ts +++ b/src/date-fns/setQuarter/index.ts @@ -1,5 +1,15 @@ -import { setMonth } from '../setMonth/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { setMonth } from '../setMonth/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setQuarter} function options. + */ +export interface SetQuarterOptions extends ContextOptions {} /** * @name setQuarter @@ -10,9 +20,11 @@ import { toDate } from '../toDate/index'; * Set the year quarter to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param quarter - The quarter of the new date + * @param options - The options * * @returns The new date with the quarter set * @@ -21,9 +33,15 @@ import { toDate } from '../toDate/index'; * const result = setQuarter(new Date(2014, 6, 2), 2) * //=> Wed Apr 02 2014 00:00:00 */ -export function setQuarter(date: DateType | number | string, quarter: number): DateType { - const _date = toDate(date); - const oldQuarter = Math.trunc(_date.getMonth() / 3) + 1; +export function setQuarter( + date: DateArg, + quarter: number, + options?: SetQuarterOptions, +): ResultDate { + const date_ = toDate(date, options?.in); + const oldQuarter = Math.trunc(date_.getMonth() / 3) + 1; const diff = quarter - oldQuarter; - return setMonth(_date, _date.getMonth() + diff * 3); + return setMonth(date_, date_.getMonth() + diff * 3); } + +/* eslint-enable */ diff --git a/src/date-fns/setSeconds/index.ts b/src/date-fns/setSeconds/index.ts index 56ac839..bfceaa1 100644 --- a/src/date-fns/setSeconds/index.ts +++ b/src/date-fns/setSeconds/index.ts @@ -1,17 +1,29 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setSeconds} function options. + */ +export interface SetSecondsOptions extends ContextOptions {} /** * @name setSeconds * @category Second Helpers - * @summary Set the seconds to the given date. + * @summary Set the seconds to the given date, with context support. * * @description - * Set the seconds to the given date. + * Set the seconds to the given date, with an optional context for time zone specification. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param seconds - The seconds of the new date + * @param options - An object with options * * @returns The new date with the seconds set * @@ -20,8 +32,14 @@ import { toDate } from '../toDate/index'; * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) * //=> Mon Sep 01 2014 11:30:45 */ -export function setSeconds(date: DateType | number | string, seconds: number): DateType { - const _date = toDate(date); +export function setSeconds( + date: DateArg, + seconds: number, + options?: SetSecondsOptions, +): ResultDate { + const _date = toDate(date, options?.in); _date.setSeconds(seconds); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/setWeek/index.ts b/src/date-fns/setWeek/index.ts index 1b80416..dc9e393 100644 --- a/src/date-fns/setWeek/index.ts +++ b/src/date-fns/setWeek/index.ts @@ -1,11 +1,19 @@ -import { getWeek } from '../getWeek/index'; -import { toDate } from '../toDate/index'; -import type { FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getWeek } from '../getWeek/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link setWeek} function options. */ -export interface SetWeekOptions extends LocalizedOptions<'options'>, WeekOptions, FirstWeekContainsDateOptions {} +export interface SetWeekOptions + extends LocalizedOptions<'options'>, + WeekOptions, + FirstWeekContainsDateOptions, + ContextOptions {} /** * @name setWeek @@ -22,6 +30,7 @@ export interface SetWeekOptions extends LocalizedOptions<'options'>, WeekOptions * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param week - The week of the new date @@ -44,13 +53,15 @@ export interface SetWeekOptions extends LocalizedOptions<'options'>, WeekOptions * }) * //=> Sun Jan 4 2004 00:00:00 */ -export function setWeek( - date: DateType | number | string, +export function setWeek( + date: DateArg, week: number, - options?: SetWeekOptions, -): DateType { - const _date = toDate(date); - const diff = getWeek(_date, options) - week; - _date.setDate(_date.getDate() - diff * 7); - return _date; + options?: SetWeekOptions, +): ResultDate { + const date_ = toDate(date, options?.in); + const diff = getWeek(date_, options) - week; + date_.setDate(date_.getDate() - diff * 7); + return toDate(date_, options?.in); } + +/* eslint-enable */ diff --git a/src/date-fns/setWeekYear/index.ts b/src/date-fns/setWeekYear/index.ts index 5e0164f..a5e05c7 100644 --- a/src/date-fns/setWeekYear/index.ts +++ b/src/date-fns/setWeekYear/index.ts @@ -1,14 +1,22 @@ -import { constructFrom } from '../constructFrom/index'; -import { differenceInCalendarDays } from '../differenceInCalendarDays/index'; -import { startOfWeekYear } from '../startOfWeekYear/index'; -import { toDate } from '../toDate/index'; -import type { FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { differenceInCalendarDays } from '../differenceInCalendarDays/index.ts'; +import { startOfWeekYear } from '../startOfWeekYear/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link setWeekYear} function options. */ -export interface SetWeekYearOptions extends LocalizedOptions<'options'>, WeekOptions, FirstWeekContainsDateOptions {} +export interface SetWeekYearOptions + extends LocalizedOptions<'options'>, + WeekOptions, + FirstWeekContainsDateOptions, + ContextOptions {} /** * @name setWeekYear @@ -26,6 +34,7 @@ export interface SetWeekYearOptions extends LocalizedOptions<'options'>, WeekOpt * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param weekYear - The local week-numbering year of the new date @@ -48,11 +57,11 @@ export interface SetWeekYearOptions extends LocalizedOptions<'options'>, WeekOpt * }) * //=> Sat Jan 01 2005 00:00:00 */ -export function setWeekYear( - date: DateType | number | string, +export function setWeekYear( + date: DateArg, weekYear: number, - options?: SetWeekYearOptions, -): DateType { + options?: SetWeekYearOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const firstWeekContainsDate = options?.firstWeekContainsDate ?? @@ -61,12 +70,15 @@ export function setWeekYear( defaultOptions.locale?.options?.firstWeekContainsDate ?? 1; - let _date = toDate(date); - const diff = differenceInCalendarDays(_date, startOfWeekYear(_date, options)); - const firstWeek = constructFrom(date, 0); + const diff = differenceInCalendarDays(toDate(date, options?.in), startOfWeekYear(date, options), options); + + const firstWeek = constructFrom(options?.in || date, 0); firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate); firstWeek.setHours(0, 0, 0, 0); - _date = startOfWeekYear(firstWeek, options); - _date.setDate(_date.getDate() + diff); - return _date; + + const date_ = startOfWeekYear(firstWeek, options); + date_.setDate(date_.getDate() + diff); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/setYear/index.ts b/src/date-fns/setYear/index.ts index 9b13595..d077a65 100644 --- a/src/date-fns/setYear/index.ts +++ b/src/date-fns/setYear/index.ts @@ -1,5 +1,15 @@ -import { constructFrom } from '../constructFrom/index'; -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link setYear} function options. + */ +export interface SetYearOptions extends ContextOptions {} /** * @name setYear @@ -10,9 +20,11 @@ import { toDate } from '../toDate/index'; * Set the year to the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param year - The year of the new date + * @param options - An object with options. * * @returns The new date with the year set * @@ -21,14 +33,18 @@ import { toDate } from '../toDate/index'; * const result = setYear(new Date(2014, 8, 1), 2013) * //=> Sun Sep 01 2013 00:00:00 */ -export function setYear(date: DateType | number | string, year: number): DateType { - const _date = toDate(date); +export function setYear( + date: DateArg, + year: number, + options?: SetYearOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date - if (isNaN(+_date)) { - return constructFrom(date, NaN); - } + if (isNaN(+date_)) return constructFrom(options?.in || date, NaN); - _date.setFullYear(year); - return _date; + date_.setFullYear(year); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfDay/index.ts b/src/date-fns/startOfDay/index.ts index 59a8b55..5ffd943 100644 --- a/src/date-fns/startOfDay/index.ts +++ b/src/date-fns/startOfDay/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfDay} function options. + */ +export interface StartOfDayOptions extends ContextOptions {} /** * @name startOfDay @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The start of a day * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ -export function startOfDay(date: DateType | number | string): DateType { - const _date = toDate(date); +export function startOfDay( + date: DateArg, + options?: StartOfDayOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setHours(0, 0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfDecade/index.ts b/src/date-fns/startOfDecade/index.ts index fe8f388..336756f 100644 --- a/src/date-fns/startOfDecade/index.ts +++ b/src/date-fns/startOfDecade/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfDecade} options. + */ +export interface StartOfDecadeOptions extends ContextOptions {} /** * @name startOfDecade @@ -9,8 +19,10 @@ import { toDate } from '../toDate/index'; * Return the start of a decade for the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of a decade * @@ -19,14 +31,19 @@ import { toDate } from '../toDate/index'; * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00)) * //=> Jan 01 2010 00:00:00 */ -export function startOfDecade(date: DateType | number | string): DateType { +export function startOfDecade( + date: DateArg, + options?: StartOfDecadeOptions | undefined, +): ResultDate { // TODO: Switch to more technical definition in of decades that start with 1 // end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking // change, so it can only be done in 4.0. - const _date = toDate(date); + const _date = toDate(date, options?.in); const year = _date.getFullYear(); const decade = Math.floor(year / 10) * 10; _date.setFullYear(decade, 0, 1); _date.setHours(0, 0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfHour/index.ts b/src/date-fns/startOfHour/index.ts index 0f2c31d..18cfcbe 100644 --- a/src/date-fns/startOfHour/index.ts +++ b/src/date-fns/startOfHour/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfHour} function options. + */ +export interface StartOfHourOptions extends ContextOptions {} /** * @name startOfHour @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of an hour * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = startOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:00:00 */ -export function startOfHour(date: DateType | number | string): DateType { - const _date = toDate(date); +export function startOfHour( + date: DateArg, + options?: StartOfHourOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setMinutes(0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfISOWeek/index.ts b/src/date-fns/startOfISOWeek/index.ts index 5e41462..ea8ff3c 100644 --- a/src/date-fns/startOfISOWeek/index.ts +++ b/src/date-fns/startOfISOWeek/index.ts @@ -1,4 +1,14 @@ -import { startOfWeek } from '../startOfWeek/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfWeek } from '../startOfWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfISOWeek} function options. + */ +export interface StartOfISOWeekOptions extends ContextOptions {} /** * @name startOfISOWeek @@ -12,8 +22,10 @@ import { startOfWeek } from '../startOfWeek/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of an ISO week * @@ -22,6 +34,11 @@ import { startOfWeek } from '../startOfWeek/index'; * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ -export function startOfISOWeek(date: DateType | number | string): DateType { - return startOfWeek(date, { weekStartsOn: 1 }); +export function startOfISOWeek( + date: DateArg, + options?: StartOfISOWeekOptions | undefined, +): ResultDate { + return startOfWeek(date, { ...options, weekStartsOn: 1 }); } + +/* eslint-enable */ diff --git a/src/date-fns/startOfISOWeekYear/index.ts b/src/date-fns/startOfISOWeekYear/index.ts index 15148ad..e8471a0 100644 --- a/src/date-fns/startOfISOWeekYear/index.ts +++ b/src/date-fns/startOfISOWeekYear/index.ts @@ -1,6 +1,16 @@ -import { getISOWeekYear } from '../getISOWeekYear/index'; -import { startOfISOWeek } from '../startOfISOWeek/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { getISOWeekYear } from '../getISOWeekYear/index.ts'; +import { startOfISOWeek } from '../startOfISOWeek/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfISOWeekYear} function options. + */ +export interface StartOfISOWeekYearOptions extends ContextOptions {} /** * @name startOfISOWeekYear @@ -15,8 +25,10 @@ import { constructFrom } from '../constructFrom/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of an ISO week-numbering year * @@ -25,10 +37,15 @@ import { constructFrom } from '../constructFrom/index'; * const result = startOfISOWeekYear(new Date(2005, 6, 2)) * //=> Mon Jan 03 2005 00:00:00 */ -export function startOfISOWeekYear(date: DateType | number | string): DateType { - const year = getISOWeekYear(date); - const fourthOfJanuary = constructFrom(date, 0); +export function startOfISOWeekYear( + date: DateArg, + options?: StartOfISOWeekYearOptions | undefined, +): ResultDate { + const year = getISOWeekYear(date, options); + const fourthOfJanuary = constructFrom(options?.in || date, 0); fourthOfJanuary.setFullYear(year, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); return startOfISOWeek(fourthOfJanuary); } + +/* eslint-enable */ diff --git a/src/date-fns/startOfMinute/index.ts b/src/date-fns/startOfMinute/index.ts index 93e25d3..d606487 100644 --- a/src/date-fns/startOfMinute/index.ts +++ b/src/date-fns/startOfMinute/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfMinute} function options. + */ +export interface StartOfMinuteOptions extends ContextOptions {} /** * @name startOfMinute @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of a minute * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:00 */ -export function startOfMinute(date: DateType | number | string): DateType { - const _date = toDate(date); - _date.setSeconds(0, 0); - return _date; +export function startOfMinute( + date: DateArg, + options?: StartOfMinuteOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + date_.setSeconds(0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfMonth/index.ts b/src/date-fns/startOfMonth/index.ts index 76a46b5..f316c47 100644 --- a/src/date-fns/startOfMonth/index.ts +++ b/src/date-fns/startOfMonth/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfMonth} function options. + */ +export interface StartOfMonthOptions extends ContextOptions {} /** * @name startOfMonth @@ -6,12 +16,15 @@ import { toDate } from '../toDate/index'; * @summary Return the start of a month for the given date. * * @description - * Return the start of a month for the given date. - * The result will be in the local timezone. + * Return the start of a month for the given date. The result will be in the local timezone. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. + * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, + * or inferred from the arguments. * * @param date - The original date + * @param options - An object with options * * @returns The start of a month * @@ -20,9 +33,14 @@ import { toDate } from '../toDate/index'; * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ -export function startOfMonth(date: DateType | number | string): DateType { - const _date = toDate(date); +export function startOfMonth( + date: DateArg, + options?: StartOfMonthOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); _date.setDate(1); _date.setHours(0, 0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfQuarter/index.ts b/src/date-fns/startOfQuarter/index.ts index 3a1c8c4..0855a7e 100644 --- a/src/date-fns/startOfQuarter/index.ts +++ b/src/date-fns/startOfQuarter/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfQuarter} function options. + */ +export interface StartOfQuarterOptions extends ContextOptions {} /** * @name startOfQuarter @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The start of a quarter * @@ -20,11 +32,16 @@ import { toDate } from '../toDate/index'; * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Jul 01 2014 00:00:00 */ -export function startOfQuarter(date: DateType | number | string): DateType { - const _date = toDate(date); +export function startOfQuarter( + date: DateArg, + options?: StartOfQuarterOptions | undefined, +): ResultDate { + const _date = toDate(date, options?.in); const currentMonth = _date.getMonth(); const month = currentMonth - (currentMonth % 3); _date.setMonth(month, 1); _date.setHours(0, 0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfSecond/index.ts b/src/date-fns/startOfSecond/index.ts index f5cc562..7183e1a 100644 --- a/src/date-fns/startOfSecond/index.ts +++ b/src/date-fns/startOfSecond/index.ts @@ -1,4 +1,14 @@ -import { toDate } from '../toDate/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { DateArg, ContextOptions } from '../types.ts'; + +/** + * The {@link startOfSecond} function options. + */ +export interface StartOfSecondOptions extends ContextOptions {} /** * @name startOfSecond @@ -10,8 +20,10 @@ import { toDate } from '../toDate/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The start of a second * @@ -20,8 +32,13 @@ import { toDate } from '../toDate/index'; * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.000 */ -export function startOfSecond(date: DateType | number | string): DateType { - const _date = toDate(date); - _date.setMilliseconds(0); - return _date; +export function startOfSecond( + date: DateArg, + options?: StartOfSecondOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + date_.setMilliseconds(0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfToday/index.ts b/src/date-fns/startOfToday/index.ts index 2d79145..dff365a 100644 --- a/src/date-fns/startOfToday/index.ts +++ b/src/date-fns/startOfToday/index.ts @@ -1,4 +1,14 @@ -import { startOfDay } from '../startOfDay/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { startOfDay } from '../startOfDay/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link startOfToday} function options. + */ +export interface StartOfTodayOptions extends ContextOptions {} /** * @name startOfToday @@ -9,6 +19,10 @@ import { startOfDay } from '../startOfDay/index'; * @description * Return the start of today. * + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options + * * @returns The start of today * * @example @@ -16,6 +30,10 @@ import { startOfDay } from '../startOfDay/index'; * const result = startOfToday() * //=> Mon Oct 6 2014 00:00:00 */ -export function startOfToday(): Date { - return startOfDay(Date.now()); +export function startOfToday( + options?: StartOfTodayOptions | undefined, +): ContextDate { + return startOfDay(Date.now(), options); } + +/* eslint-enable */ diff --git a/src/date-fns/startOfTomorrow/index.ts b/src/date-fns/startOfTomorrow/index.ts index abfdaf2..0da8115 100644 --- a/src/date-fns/startOfTomorrow/index.ts +++ b/src/date-fns/startOfTomorrow/index.ts @@ -1,27 +1,48 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { constructNow } from '../constructNow/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link startOfTomorrow} function options. + */ +export interface StartOfTomorrowOptions extends ContextOptions {} + /** * @name startOfTomorrow * @category Day Helpers * @summary Return the start of tomorrow. * @pure false * - * @description - * Return the start of tomorrow. + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options * * @returns The start of tomorrow * + * @description + * Return the start of tomorrow. + * * @example * // If today is 6 October 2014: * const result = startOfTomorrow() * //=> Tue Oct 7 2014 00:00:00 */ -export function startOfTomorrow(): Date { - const now = new Date(); +export function startOfTomorrow( + options?: StartOfTomorrowOptions | undefined, +): ContextDate { + const now = constructNow(options?.in); const year = now.getFullYear(); const month = now.getMonth(); const day = now.getDate(); - const date = new Date(0); + const date = constructFrom(options?.in, 0); date.setFullYear(year, month, day + 1); date.setHours(0, 0, 0, 0); return date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfWeek/index.ts b/src/date-fns/startOfWeek/index.ts index 62c8ef2..9324390 100644 --- a/src/date-fns/startOfWeek/index.ts +++ b/src/date-fns/startOfWeek/index.ts @@ -1,11 +1,18 @@ -import { toDate } from '../toDate/index'; -import type { LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link startOfWeek} function options. */ -export interface StartOfWeekOptions extends LocalizedOptions<'options'>, WeekOptions {} +export interface StartOfWeekOptions + extends LocalizedOptions<'options'>, + WeekOptions, + ContextOptions {} /** * @name startOfWeek @@ -17,6 +24,7 @@ export interface StartOfWeekOptions extends LocalizedOptions<'options'>, WeekOpt * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date * @param options - An object with options @@ -33,10 +41,10 @@ export interface StartOfWeekOptions extends LocalizedOptions<'options'>, WeekOpt * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Mon Sep 01 2014 00:00:00 */ -export function startOfWeek( - date: DateType | number | string, - options?: StartOfWeekOptions, -): DateType { +export function startOfWeek( + date: DateArg, + options?: StartOfWeekOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? @@ -45,7 +53,7 @@ export function startOfWeek( defaultOptions.locale?.options?.weekStartsOn ?? 0; - const _date = toDate(date); + const _date = toDate(date, options?.in); const day = _date.getDay(); const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; @@ -53,3 +61,5 @@ export function startOfWeek( _date.setHours(0, 0, 0, 0); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfWeekYear/index.ts b/src/date-fns/startOfWeekYear/index.ts index 5e91243..bc28986 100644 --- a/src/date-fns/startOfWeekYear/index.ts +++ b/src/date-fns/startOfWeekYear/index.ts @@ -1,16 +1,21 @@ -import { constructFrom } from '../constructFrom/index'; -import { getWeekYear } from '../getWeekYear/index'; -import { startOfWeek } from '../startOfWeek/index'; -import type { FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types'; -import { getDefaultOptions } from '../_lib/defaultOptions/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { getDefaultOptions } from '../_lib/defaultOptions/index.ts'; +import { constructFrom } from '../constructFrom/index.ts'; +import { getWeekYear } from '../getWeekYear/index.ts'; +import { startOfWeek } from '../startOfWeek/index.ts'; +import type { ContextOptions, DateArg, FirstWeekContainsDateOptions, LocalizedOptions, WeekOptions } from '../types.ts'; /** * The {@link startOfWeekYear} function options. */ -export interface StartOfWeekYearOptions +export interface StartOfWeekYearOptions extends LocalizedOptions<'options'>, FirstWeekContainsDateOptions, - WeekOptions {} + WeekOptions, + ContextOptions {} /** * @name startOfWeekYear @@ -27,6 +32,7 @@ export interface StartOfWeekYearOptions * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type. * * @param date - The original date * @param options - An object with options @@ -48,10 +54,10 @@ export interface StartOfWeekYearOptions * }) * //=> Mon Jan 03 2005 00:00:00 */ -export function startOfWeekYear( - date: DateType | number | string, - options?: StartOfWeekYearOptions, -): DateType { +export function startOfWeekYear( + date: DateArg, + options?: StartOfWeekYearOptions, +): ResultDate { const defaultOptions = getDefaultOptions(); const firstWeekContainsDate = options?.firstWeekContainsDate ?? @@ -61,9 +67,11 @@ export function startOfWeekYear( 1; const year = getWeekYear(date, options); - const firstWeek = constructFrom(date, 0); + const firstWeek = constructFrom(options?.in || date, 0); firstWeek.setFullYear(year, 0, firstWeekContainsDate); firstWeek.setHours(0, 0, 0, 0); const _date = startOfWeek(firstWeek, options); return _date; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfYear/index.ts b/src/date-fns/startOfYear/index.ts index f80112d..3c01a89 100644 --- a/src/date-fns/startOfYear/index.ts +++ b/src/date-fns/startOfYear/index.ts @@ -1,5 +1,14 @@ -import { toDate } from '../toDate/index'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { toDate } from '../toDate/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link startOfYear} function options. + */ +export interface StartOfYearOptions extends ContextOptions {} /** * @name startOfYear @@ -11,8 +20,10 @@ import { constructFrom } from '../constructFrom/index'; * The result will be in the local timezone. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The original date + * @param options - The options * * @returns The start of a year * @@ -21,10 +32,14 @@ import { constructFrom } from '../constructFrom/index'; * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Jan 01 2014 00:00:00 */ -export function startOfYear(date: DateType | number | string): DateType { - const cleanDate = toDate(date); - const _date = constructFrom(date, 0); - _date.setFullYear(cleanDate.getFullYear(), 0, 1); - _date.setHours(0, 0, 0, 0); - return _date; +export function startOfYear( + date: DateArg, + options?: StartOfYearOptions | undefined, +): ResultDate { + const date_ = toDate(date, options?.in); + date_.setFullYear(date_.getFullYear(), 0, 1); + date_.setHours(0, 0, 0, 0); + return date_; } + +/* eslint-enable */ diff --git a/src/date-fns/startOfYesterday/index.ts b/src/date-fns/startOfYesterday/index.ts index 81552d5..613f46a 100644 --- a/src/date-fns/startOfYesterday/index.ts +++ b/src/date-fns/startOfYesterday/index.ts @@ -1,9 +1,25 @@ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructNow } from '../constructNow/index.ts'; +import type { ContextOptions } from '../types.ts'; + +/** + * The {@link startOfYesterday} function options. + */ +export interface StartOfYesterdayOptions extends ContextOptions {} + /** * @name startOfYesterday * @category Day Helpers * @summary Return the start of yesterday. * @pure false * + * @typeParam ContextDate - The `Date` type of the context function. + * + * @param options - An object with options + * * @description * Return the start of yesterday. * @@ -14,14 +30,18 @@ * const result = startOfYesterday() * //=> Sun Oct 5 2014 00:00:00 */ -export function startOfYesterday(): Date { - const now = new Date(); +export function startOfYesterday( + options?: StartOfYesterdayOptions | undefined, +): ContextDate { + const now = constructNow(options?.in); const year = now.getFullYear(); const month = now.getMonth(); const day = now.getDate(); - const date = new Date(0); + const date = constructNow(options?.in); date.setFullYear(year, month, day - 1); date.setHours(0, 0, 0, 0); return date; } + +/* eslint-enable */ diff --git a/src/date-fns/sub/index.ts b/src/date-fns/sub/index.ts index 6ab0b48..0df5965 100644 --- a/src/date-fns/sub/index.ts +++ b/src/date-fns/sub/index.ts @@ -1,7 +1,16 @@ -import { subDays } from '../subDays/index'; -import { subMonths } from '../subMonths/index'; -import type { Duration } from '../types'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import { subDays } from '../subDays/index.ts'; +import { subMonths } from '../subMonths/index.ts'; +import type { ContextOptions, DateArg, Duration } from '../types.ts'; + +/** + * The {@link sub} function options. + */ +export interface SubOptions extends ContextOptions {} /** * @name sub @@ -12,9 +21,11 @@ import { constructFrom } from '../constructFrom/index'; * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param duration - The object with years, months, weeks, days, hours, minutes and seconds to be subtracted + * @param options - An object with options * * | Key | Description | * |---------|------------------------------------| @@ -43,20 +54,21 @@ import { constructFrom } from '../constructFrom/index'; * }) * //=> Mon Sep 1 2014 10:19:50 */ -export function sub(date: DateType | number | string, duration: Duration): DateType { +export function sub( + date: DateArg, + duration: Duration, + options?: SubOptions, +): ResultDate { const { years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0 } = duration; - // Subtract years and months - const dateWithoutMonths = subMonths(date, months + years * 12); - - // Subtract weeks and days - const dateWithoutDays = subDays(dateWithoutMonths, days + weeks * 7); + const withoutMonths = subMonths(date, months + years * 12, options); + const withoutDays = subDays(withoutMonths, days + weeks * 7, options); - // Subtract hours, minutes and seconds - const minutestoSub = minutes + hours * 60; - const secondstoSub = seconds + minutestoSub * 60; - const mstoSub = secondstoSub * 1000; - const finalDate = constructFrom(date, dateWithoutDays.getTime() - mstoSub); + const minutesToSub = minutes + hours * 60; + const secondsToSub = seconds + minutesToSub * 60; + const msToSub = secondsToSub * 1000; - return finalDate; + return constructFrom(options?.in || date, +withoutDays - msToSub); } + +/* eslint-enable */ diff --git a/src/date-fns/subBusinessDays/index.ts b/src/date-fns/subBusinessDays/index.ts index 6c898aa..5946ebf 100644 --- a/src/date-fns/subBusinessDays/index.ts +++ b/src/date-fns/subBusinessDays/index.ts @@ -1,25 +1,43 @@ -import { addBusinessDays } from '../addBusinessDays/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addBusinessDays } from '../addBusinessDays/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subBusinessDays} function options. + */ +export interface SubBusinessDaysOptions extends ContextOptions {} /** * @name subBusinessDays * @category Day Helpers - * @summary Substract the specified number of business days (mon - fri) to the given date. + * @summary Subtract the specified number of business days (mon - fri) from the given date. * * @description - * Substract the specified number of business days (mon - fri) to the given date, ignoring weekends. + * Subtract the specified number of business days (mon - fri) from the given date, ignoring weekends. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of business days to be subtracted. + * @param options - An object with options * * @returns The new date with the business days subtracted * * @example - * // Substract 10 business days from 1 September 2014: + * // Subtract 10 business days from 1 September 2014: * const result = subBusinessDays(new Date(2014, 8, 1), 10) * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days) */ -export function subBusinessDays(date: DateType | number | string, amount: number): DateType { - return addBusinessDays(date, -amount); +export function subBusinessDays( + date: DateArg, + amount: number, + options?: SubBusinessDaysOptions | undefined, +): ResultDate { + return addBusinessDays(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subDays/index.ts b/src/date-fns/subDays/index.ts index 7629c17..220f39c 100644 --- a/src/date-fns/subDays/index.ts +++ b/src/date-fns/subDays/index.ts @@ -1,17 +1,26 @@ -import { addDays } from '../addDays/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addDays } from '../addDays/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subDays} function options. + */ +export interface SubDaysOptions extends ContextOptions {} /** * @name subDays * @category Day Helpers * @summary Subtract the specified number of days from the given date. * - * @description - * Subtract the specified number of days from the given date. - * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of days to be subtracted. + * @param options - An object with options * * @returns The new date with the days subtracted * @@ -20,6 +29,12 @@ import { addDays } from '../addDays/index'; * const result = subDays(new Date(2014, 8, 1), 10) * //=> Fri Aug 22 2014 00:00:00 */ -export function subDays(date: DateType | number | string, amount: number): DateType { - return addDays(date, -amount); +export function subDays( + date: DateArg, + amount: number, + options?: SubDaysOptions | undefined, +): ResultDate { + return addDays(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subHours/index.ts b/src/date-fns/subHours/index.ts index 3aa58cd..632f9b5 100644 --- a/src/date-fns/subHours/index.ts +++ b/src/date-fns/subHours/index.ts @@ -1,4 +1,14 @@ -import { addHours } from '../addHours/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addHours } from '../addHours/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subHours} function options. + */ +export interface SubHoursOptions extends ContextOptions {} /** * @name subHours @@ -9,9 +19,11 @@ import { addHours } from '../addHours/index'; * Subtract the specified number of hours from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of hours to be subtracted. + * @param options - The options * * @returns The new date with the hours subtracted * @@ -20,6 +32,12 @@ import { addHours } from '../addHours/index'; * const result = subHours(new Date(2014, 6, 11, 1, 0), 2) * //=> Thu Jul 10 2014 23:00:00 */ -export function subHours(date: DateType | number | string, amount: number): DateType { - return addHours(date, -amount); +export function subHours( + date: DateArg, + amount: number, + options?: SubHoursOptions | undefined, +): ResultDate { + return addHours(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subISOWeekYears/index.ts b/src/date-fns/subISOWeekYears/index.ts index bb2b7b7..116d2bf 100644 --- a/src/date-fns/subISOWeekYears/index.ts +++ b/src/date-fns/subISOWeekYears/index.ts @@ -1,4 +1,14 @@ -import { addISOWeekYears } from '../addISOWeekYears/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addISOWeekYears } from '../addISOWeekYears/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subISOWeekYears} function options. + */ +export interface SubISOWeekYearsOptions extends ContextOptions {} /** * @name subISOWeekYears @@ -11,9 +21,11 @@ import { addISOWeekYears } from '../addISOWeekYears/index'; * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of ISO week-numbering years to be subtracted. + * @param options - The options * * @returns The new date with the ISO week-numbering years subtracted * @@ -22,6 +34,12 @@ import { addISOWeekYears } from '../addISOWeekYears/index'; * const result = subISOWeekYears(new Date(2014, 8, 1), 5) * //=> Mon Aug 31 2009 00:00:00 */ -export function subISOWeekYears(date: DateType | number | string, amount: number): DateType { - return addISOWeekYears(date, -amount); +export function subISOWeekYears( + date: DateArg, + amount: number, + options?: SubISOWeekYearsOptions | undefined, +): ResultDate { + return addISOWeekYears(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subMilliseconds/index.ts b/src/date-fns/subMilliseconds/index.ts index 4052c79..a49c19e 100644 --- a/src/date-fns/subMilliseconds/index.ts +++ b/src/date-fns/subMilliseconds/index.ts @@ -1,25 +1,33 @@ -import { addMilliseconds } from '../addMilliseconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMilliseconds } from '../addMilliseconds/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subMilliseconds} function options. + */ +export interface SubMillisecondsOptions extends ContextOptions {} /** - * @name subMilliseconds - * @category Millisecond Helpers - * @summary Subtract the specified number of milliseconds from the given date. - * - * @description * Subtract the specified number of milliseconds from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of milliseconds to be subtracted. + * @param options - An object with options * * @returns The new date with the milliseconds subtracted - * - * @example - * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000: - * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:29.250 */ -export function subMilliseconds(date: DateType | number | string, amount: number): DateType { - return addMilliseconds(date, -amount); +export function subMilliseconds( + date: DateArg, + amount: number, + options?: SubMillisecondsOptions | undefined, +): ResultDate { + return addMilliseconds(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subMinutes/index.ts b/src/date-fns/subMinutes/index.ts index fca46a6..32a5ed9 100644 --- a/src/date-fns/subMinutes/index.ts +++ b/src/date-fns/subMinutes/index.ts @@ -1,4 +1,14 @@ -import { addMinutes } from '../addMinutes/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMinutes } from '../addMinutes/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subMinutes} function options. + */ +export interface SubMinutesOptions extends ContextOptions {} /** * @name subMinutes @@ -9,9 +19,11 @@ import { addMinutes } from '../addMinutes/index'; * Subtract the specified number of minutes from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of minutes to be subtracted. + * @param options - An object with options * * @returns The new date with the minutes subtracted * @@ -20,6 +32,12 @@ import { addMinutes } from '../addMinutes/index'; * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) * //=> Thu Jul 10 2014 11:30:00 */ -export function subMinutes(date: DateType | number | string, amount: number): DateType { - return addMinutes(date, -amount); +export function subMinutes( + date: DateArg, + amount: number, + options?: SubMinutesOptions | undefined, +): ResultDate { + return addMinutes(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subMonths/index.ts b/src/date-fns/subMonths/index.ts index 5e6dd0f..a812744 100644 --- a/src/date-fns/subMonths/index.ts +++ b/src/date-fns/subMonths/index.ts @@ -1,4 +1,14 @@ -import { addMonths } from '../addMonths/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addMonths } from '../addMonths/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The subMonths function options. + */ +export interface SubMonthsOptions extends ContextOptions {} /** * @name subMonths @@ -9,9 +19,11 @@ import { addMonths } from '../addMonths/index'; * Subtract the specified number of months from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of months to be subtracted. + * @param options - An object with options * * @returns The new date with the months subtracted * @@ -20,6 +32,12 @@ import { addMonths } from '../addMonths/index'; * const result = subMonths(new Date(2015, 1, 1), 5) * //=> Mon Sep 01 2014 00:00:00 */ -export function subMonths(date: DateType | number | string, amount: number): DateType { - return addMonths(date, -amount); +export function subMonths( + date: DateArg, + amount: number, + options?: SubMonthsOptions | undefined, +): ResultDate { + return addMonths(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subQuarters/index.ts b/src/date-fns/subQuarters/index.ts index 8e4b802..5a6ffc0 100644 --- a/src/date-fns/subQuarters/index.ts +++ b/src/date-fns/subQuarters/index.ts @@ -1,4 +1,14 @@ -import { addQuarters } from '../addQuarters/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addQuarters } from '../addQuarters/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subQuarters} function options. + */ +export interface SubQuartersOptions extends ContextOptions {} /** * @name subQuarters @@ -9,9 +19,11 @@ import { addQuarters } from '../addQuarters/index'; * Subtract the specified number of year quarters from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of quarters to be subtracted. + * @param options - An object with options * * @returns The new date with the quarters subtracted * @@ -20,6 +32,12 @@ import { addQuarters } from '../addQuarters/index'; * const result = subQuarters(new Date(2014, 8, 1), 3) * //=> Sun Dec 01 2013 00:00:00 */ -export function subQuarters(date: DateType | number | string, amount: number): DateType { - return addQuarters(date, -amount); +export function subQuarters( + date: DateArg, + amount: number, + options?: SubQuartersOptions, +): ResultDate { + return addQuarters(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subSeconds/index.ts b/src/date-fns/subSeconds/index.ts index fc84bf6..24a1ded 100644 --- a/src/date-fns/subSeconds/index.ts +++ b/src/date-fns/subSeconds/index.ts @@ -1,17 +1,24 @@ -import { addSeconds } from '../addSeconds/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addSeconds } from '../addSeconds/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subSeconds} function options. + */ +export interface SubSecondsOptions extends ContextOptions {} /** - * @name subSeconds - * @category Second Helpers - * @summary Subtract the specified number of seconds from the given date. - * - * @description * Subtract the specified number of seconds from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of seconds to be subtracted. + * @param options - The options * * @returns The new date with the seconds subtracted * @@ -20,6 +27,12 @@ import { addSeconds } from '../addSeconds/index'; * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) * //=> Thu Jul 10 2014 12:44:30 */ -export function subSeconds(date: DateType | number | string, amount: number): DateType { - return addSeconds(date, -amount); +export function subSeconds( + date: DateArg, + amount: number, + options?: SubSecondsOptions | undefined, +): ResultDate { + return addSeconds(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subWeeks/index.ts b/src/date-fns/subWeeks/index.ts index b312617..5c548f1 100644 --- a/src/date-fns/subWeeks/index.ts +++ b/src/date-fns/subWeeks/index.ts @@ -1,4 +1,14 @@ -import { addWeeks } from '../addWeeks/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addWeeks } from '../addWeeks/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subWeeks} function options. + */ +export interface SubWeeksOptions extends ContextOptions {} /** * @name subWeeks @@ -9,9 +19,11 @@ import { addWeeks } from '../addWeeks/index'; * Subtract the specified number of weeks from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of weeks to be subtracted. + * @param options - An object with options * * @returns The new date with the weeks subtracted * @@ -20,6 +32,12 @@ import { addWeeks } from '../addWeeks/index'; * const result = subWeeks(new Date(2014, 8, 1), 4) * //=> Mon Aug 04 2014 00:00:00 */ -export function subWeeks(date: DateType | number | string, amount: number): DateType { - return addWeeks(date, -amount); +export function subWeeks( + date: DateArg, + amount: number, + options?: SubWeeksOptions | undefined, +): ResultDate { + return addWeeks(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/subYears/index.ts b/src/date-fns/subYears/index.ts index fbec9b4..1801a62 100644 --- a/src/date-fns/subYears/index.ts +++ b/src/date-fns/subYears/index.ts @@ -1,4 +1,14 @@ -import { addYears } from '../addYears/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { addYears } from '../addYears/index.ts'; +import type { ContextOptions, DateArg } from '../types.ts'; + +/** + * The {@link subYears} function options. + */ +export interface SubYearsOptions extends ContextOptions {} /** * @name subYears @@ -9,9 +19,11 @@ import { addYears } from '../addYears/index'; * Subtract the specified number of years from the given date. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param date - The date to be changed * @param amount - The amount of years to be subtracted. + * @param options - An object with options * * @returns The new date with the years subtracted * @@ -20,6 +32,12 @@ import { addYears } from '../addYears/index'; * const result = subYears(new Date(2014, 8, 1), 5) * //=> Tue Sep 01 2009 00:00:00 */ -export function subYears(date: DateType | number | string, amount: number): DateType { - return addYears(date, -amount); +export function subYears( + date: DateArg, + amount: number, + options?: SubYearsOptions, +): ResultDate { + return addYears(date, -amount, options); } + +/* eslint-enable */ diff --git a/src/date-fns/toDate/index.ts b/src/date-fns/toDate/index.ts index f3b619b..673084f 100644 --- a/src/date-fns/toDate/index.ts +++ b/src/date-fns/toDate/index.ts @@ -1,5 +1,9 @@ -import type { GenericDateConstructor } from '..'; -import type { Instant } from '../../instant'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import type { ConstructableDate, ContextFn, DateArg } from '../types.ts'; /** * @name toDate @@ -15,9 +19,15 @@ import type { Instant } from '../../instant'; * * If the argument is none of the above, the function returns Invalid Date. * + * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]` + * enabling to transfer extra properties from the reference date to the new date. + * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz) + * that accept a time zone as a constructor argument. + * * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. * * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments. * * @param argument - The value to convert * @@ -33,34 +43,12 @@ import type { Instant } from '../../instant'; * const result = toDate(1392098430000) * //=> Tue Feb 11 2014 11:30:30 */ -export function toDate(argument: DateType | number | string): DateType { - const argStr = Object.prototype.toString.call(argument); - - if (argument instanceof Date || (typeof argument === 'object' && argStr === '[object Date]')) { - // [PATCH:] this hack is required to support nano seconds - let modifiedArgument = argument; - if (typeof (modifiedArgument as unknown as Instant)?.epochNanoseconds === 'bigint') { - modifiedArgument = new Date( - Number((modifiedArgument as unknown as Instant).epochNanoseconds / 1000000n), - ) as DateType; - } - // Prevent the date to lose the milliseconds when passed to new Date() in IE10 - const dateToReturn = new (argument.constructor as GenericDateConstructor)(+argument); - // [PATCH:] this hack is required because setHours doesn't work for hours that are spring-forward - if ((argument as any)[Symbol.for('UTCHours')] !== undefined) { - (dateToReturn as any)[Symbol.for('UTCHours')] = (argument as any)[Symbol.for('UTCHours')]; - } - return dateToReturn; - } else if ( - typeof argument === 'number' || - argStr === '[object Number]' || - typeof argument === 'string' || - argStr === '[object String]' - ) { - // TODO: Can we get rid of as? - return new Date(argument) as DateType; - } else { - // TODO: Can we get rid of as? - return new Date(NaN) as DateType; - } +export function toDate( + argument: DateArg, + context?: ContextFn | undefined, +): ResultDate { + // [TODO] Get rid of `toDate` or `constructFrom`? + return constructFrom(context || argument, argument); } + +/* eslint-enable */ diff --git a/src/date-fns/transpose/index.ts b/src/date-fns/transpose/index.ts index 389a9ac..75f8878 100644 --- a/src/date-fns/transpose/index.ts +++ b/src/date-fns/transpose/index.ts @@ -1,5 +1,9 @@ -import type { GenericDateConstructor } from '../types'; -import { constructFrom } from '../constructFrom/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { constructFrom } from '../constructFrom/index.ts'; +import type { ContextFn, GenericDateConstructor } from '../types.ts'; /** * @name transpose @@ -11,10 +15,10 @@ import { constructFrom } from '../constructFrom/index'; * to transpose the date in the system time zone to say `UTCDate` or any other * date extension. * - * @typeParam DateInputType - The input `Date` type derived from the passed argument. - * @typeParam DateOutputType - The output `Date` type derived from the passed constructor. + * @typeParam InputDate - The input `Date` type derived from the passed argument. + * @typeParam ResultDate - The result `Date` type derived from the passed constructor. * - * @param fromDate - The date to use values from + * @param date - The date to use values from * @param constructor - The date constructor to use * * @returns Date transposed to the given constructor @@ -29,12 +33,18 @@ import { constructFrom } from '../constructFrom/index'; * transpose(date, UTCDate) * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)' */ -export function transpose( - fromDate: DateInputType, - constructor: DateOutputType | GenericDateConstructor, -): DateOutputType { - const date = constructor instanceof Date ? constructFrom(constructor, 0) : new constructor(0); - date.setFullYear(fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate()); - date.setHours(fromDate.getHours(), fromDate.getMinutes(), fromDate.getSeconds(), fromDate.getMilliseconds()); - return date; +export function transpose( + date: InputDate, + constructor: ResultDate | GenericDateConstructor | ContextFn, +): ResultDate { + const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0); + date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); + date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()); + return date_; +} + +function isConstructor(constructor: unknown): constructor is GenericDateConstructor { + return typeof constructor === 'function' && constructor.prototype?.constructor === constructor; } + +/* eslint-enable */ diff --git a/src/date-fns/types.ts b/src/date-fns/types.ts index 0f6f8c1..cab6a0a 100644 --- a/src/date-fns/types.ts +++ b/src/date-fns/types.ts @@ -1,9 +1,25 @@ -/* eslint-disable no-unused-vars */ +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck -import type { Locale } from './locale/types'; +import type { constructFromSymbol } from './constants/index.ts'; +import type { Locale } from './locale/types.ts'; -export type * from './locale/types'; -export type * from './fp/types'; +export type * from './locale/types.ts'; + +/** + * The argument type. + */ +export type DateArg = DateType | number | string; + +/** + * Date extension interface that allows to transfer extra properties from + * the reference date to the new date. It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz) + * that accept a time zone as a constructor argument. + */ +export interface ConstructableDate extends Date { + [constructFromSymbol]: (value: DateArg & {}) => DateType; +} /** * The generic date constructor. Replicates the Date constructor. Used to build @@ -27,7 +43,7 @@ export interface GenericDateConstructor { * * @returns The date instance */ - new (value: Date | number | string): DateType; + new (value: DateArg & {}): DateType; /** * The date constructor. Creates date with the passed date values (year, @@ -83,24 +99,23 @@ export type DurationUnit = keyof Duration; /** * An object that combines two dates to represent the time interval. * - * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). + * @typeParam StartDate - The start `Date` type. + * @typeParam EndDate - The end `Date` type. */ -export interface Interval { +export interface Interval< + StartType extends DateArg = DateArg, + EndType extends DateArg = DateArg, +> { /** The start of the interval. */ - start: DateType | number | string; + start: StartType; /** The end of the interval. */ - end: DateType | number | string; + end: EndType; } /** * A version of {@link Interval} that has both start and end resolved to Date. */ -export interface NormalizedInterval { - /** The start of the interval. */ - start: DateType; - /** The end of the interval. */ - end: DateType; -} +export type NormalizedInterval = Interval; /** * The era. Can be either 0 (AD - Anno Domini) or 1 (BC - Before Christ). @@ -301,3 +316,28 @@ export interface NearestToUnitOptions { * hours. */ nearestTo?: Unit; } + +/** + * The context options. Used to build function options. + */ +export interface ContextOptions { + /** + * The context to use in the function. It allows to normalize the arguments + * to a specific date instance, which is useful for extensions like [`TZDate`](https://github.com/date-fns/tz). + */ + in?: ContextFn | undefined; +} + +/** + /** + * The context function type. It's used to normalize the input arguments to + * a specific date instance, which is useful for extensions like [`TZDate`](https://github.com/date-fns/tz). + */ +export type ContextFn = (value: DateArg & {}) => DateType; + +/** + * Resolves passed type or array of types. + */ +export type MaybeArray = Type | Type[]; + +/* eslint-enable */ diff --git a/src/date-fns/weeksToDays/index.ts b/src/date-fns/weeksToDays/index.ts index 3dc32e4..dfba0e3 100644 --- a/src/date-fns/weeksToDays/index.ts +++ b/src/date-fns/weeksToDays/index.ts @@ -1,4 +1,8 @@ -import { daysInWeek } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { daysInWeek } from '../constants/index.ts'; /** * @name weeksToDays @@ -20,3 +24,5 @@ import { daysInWeek } from '../constants/index'; export function weeksToDays(weeks: number): number { return Math.trunc(weeks * daysInWeek); } + +/* eslint-enable */ diff --git a/src/date-fns/yearsToDays/index.ts b/src/date-fns/yearsToDays/index.ts index feb9672..22e7789 100644 --- a/src/date-fns/yearsToDays/index.ts +++ b/src/date-fns/yearsToDays/index.ts @@ -1,4 +1,8 @@ -import { daysInYear } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { daysInYear } from '../constants/index.ts'; /** * @name yearsToDays @@ -20,3 +24,5 @@ import { daysInYear } from '../constants/index'; export function yearsToDays(years: number): number { return Math.trunc(years * daysInYear); } + +/* eslint-enable */ diff --git a/src/date-fns/yearsToMonths/index.ts b/src/date-fns/yearsToMonths/index.ts index bd74d08..0c13478 100644 --- a/src/date-fns/yearsToMonths/index.ts +++ b/src/date-fns/yearsToMonths/index.ts @@ -1,4 +1,8 @@ -import { monthsInYear } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { monthsInYear } from '../constants/index.ts'; /** * @name yearsToMonths @@ -20,3 +24,5 @@ import { monthsInYear } from '../constants/index'; export function yearsToMonths(years: number): number { return Math.trunc(years * monthsInYear); } + +/* eslint-enable */ diff --git a/src/date-fns/yearsToQuarters/index.ts b/src/date-fns/yearsToQuarters/index.ts index 2369c58..712e699 100644 --- a/src/date-fns/yearsToQuarters/index.ts +++ b/src/date-fns/yearsToQuarters/index.ts @@ -1,4 +1,8 @@ -import { quartersInYear } from '../constants/index'; +/* eslint-disable eslint-comments/no-unlimited-disable */ +/* eslint-disable */ +// @ts-nocheck + +import { quartersInYear } from '../constants/index.ts'; /** * @name yearsToQuarters @@ -20,3 +24,5 @@ import { quartersInYear } from '../constants/index'; export function yearsToQuarters(years: number): number { return Math.trunc(years * quartersInYear); } + +/* eslint-enable */ diff --git a/src/format-utc.spec.ts b/src/format-utc.spec.ts index 3312b9b..6666510 100644 --- a/src/format-utc.spec.ts +++ b/src/format-utc.spec.ts @@ -1,12 +1,13 @@ // format-utc.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { formatUtc } from './index'; +import { formatUtc } from './index.ts'; describe('format-utc', () => { + process.loadEnvFile(); + it('works', () => { assert.equal(formatUtc(new Date('Tue Sep 13 2022 13:38:00 GMT-0400'), 'yyyy-MM-dd'), '2022-09-13'); assert.equal( @@ -16,7 +17,7 @@ describe('format-utc', () => { }); it('matches toISOString', () => { - // make sure works during EST spring forward + // make sure works during EST close to daylight saving timezone threshold assert.equal( formatUtc(new Date('2038-03-14T02:07:44.594Z'), "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"), '2038-03-14T02:07:44.594Z', diff --git a/src/format-utc.ts b/src/format-utc.ts index be7f45e..2530e1a 100644 --- a/src/format-utc.ts +++ b/src/format-utc.ts @@ -1,6 +1,6 @@ // format-utc.ts -import { tzFormat, tzUtcToZonedTime } from './date-fns-tz'; +import { tzFormat, tzUtcToZonedTime } from './date-fns-tz/index.ts'; export default function (date: Date | string | number, format: string): string { return tzFormat(tzUtcToZonedTime(date, 'UTC'), format, { timeZone: 'UTC' }); diff --git a/src/holidays/index.ts b/src/holidays/index.ts index 1da190e..5104a88 100644 --- a/src/holidays/index.ts +++ b/src/holidays/index.ts @@ -1,3 +1,3 @@ // holidays/index.ts -export * from './united-states/federal-reserve-bank'; +export * from './united-states/federal-reserve-bank/index.ts'; diff --git a/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.spec.ts b/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.spec.ts index 18fe24d..132d498 100644 --- a/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.spec.ts +++ b/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.spec.ts @@ -1,12 +1,13 @@ // holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { addUSFederalReserveBankBusinessDays } from './index'; +import { addUSFederalReserveBankBusinessDays } from './index.ts'; describe('add-federal-reserve-bank-business-days', () => { + process.loadEnvFile(); + it('throws error when amount is NaN', () => { assert.throws( () => addUSFederalReserveBankBusinessDays({ year: 2022, month: 10, date: 13 }, Number.NaN), diff --git a/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts b/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts index e9861d5..90af7a1 100644 --- a/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts +++ b/src/holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts @@ -1,6 +1,6 @@ // holidays/united-states/federal-reserve-bank/add-us-federal-reserve-bank-business-days.ts -import { isUSFederalReserveBankClosed, type PlainDate } from './index'; +import { isUSFederalReserveBankClosed, type PlainDate } from './index.ts'; /** * @name addUSFederalReserveBankBusinessDays @@ -19,7 +19,7 @@ export default function (plainDate: PlainDate, amount: number): PlainDate { throw new TypeError('Invalid Amount'); } - const result = new Date(plainDate.year, plainDate.month, plainDate.date); + const result = new Date(Date.UTC(plainDate.year, plainDate.month, plainDate.date)); result.setUTCHours(0, 0, 0, 0); let count = 0; diff --git a/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.spec.ts b/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.spec.ts index b2c02b4..1d475ee 100644 --- a/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.spec.ts +++ b/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.spec.ts @@ -1,12 +1,13 @@ // holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { getAllUSFederalReserveBankHolidays } from './index'; +import { getAllUSFederalReserveBankHolidays } from './index.ts'; describe('get-all-federal-reserve-bank-holidays', () => { + process.loadEnvFile(); + it('works for 2022 based on the Federal Holidays outlined in https://www.federalreserve.gov/aboutthefed/k8.htm', () => { assert.deepEqual(getAllUSFederalReserveBankHolidays(2022), [ { name: `New Year's Day`, date: '2022-01-01' }, diff --git a/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts b/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts index fcd2e8a..d6fe6fd 100644 --- a/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts +++ b/src/holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts @@ -1,6 +1,6 @@ // holidays/united-states/federal-reserve-bank/get-all-us-federal-reserve-bank-holidays.ts -import { formatUtc } from '../../../index'; +import { formatUtc } from '../../../index.ts'; const YYYY_MM_DD_FORMAT = 'yyyy-MM-dd'; @@ -45,15 +45,15 @@ export interface FederalReserveBankHoliday { } function getLastMondayOfMay(year: number) { - const lastDayOfMay = new Date(year, MONTH_MAY, DATE_THIRTY_ONE); // last day of may + const lastDayOfMay = new Date(Date.UTC(year, MONTH_MAY, DATE_THIRTY_ONE)); // last day of may const lastMondayOfMayDay = lastDayOfMay.getUTCDate() - (lastDayOfMay.getUTCDay() - 1 < 1 ? DAY_OF_THE_WEEK_SATURDAY : lastDayOfMay.getUTCDay() - 1); - return formatUtc(new Date(year, MONTH_MAY, lastMondayOfMayDay), YYYY_MM_DD_FORMAT); + return formatUtc(new Date(Date.UTC(year, MONTH_MAY, lastMondayOfMayDay)), YYYY_MM_DD_FORMAT); } function getNthOccurrenceOfDayOfTheWeekInMonth(nth: number, dayOfTheWeek: number, month: number, year: number) { - const date = new Date(year, month, DATE_ONE); // first day of the month + const date = new Date(Date.UTC(year, month, DATE_ONE)); // first day of the month date.setUTCDate(1 + ((7 - date.getUTCDay() + dayOfTheWeek) % 7) + (nth - 1) * 7); return formatUtc(date, YYYY_MM_DD_FORMAT); } @@ -72,15 +72,15 @@ function getNthOccurrenceOfDayOfTheWeekInMonth(nth: number, dayOfTheWeek: number */ export default function (year: number): FederalReserveBankHoliday[] { const newYearsDay = - new Date(year, MONTH_JANUARY, DATE_ONE).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY + new Date(Date.UTC(year, MONTH_JANUARY, DATE_ONE)).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY ? { name: `New Year's Day`, - date: formatUtc(new Date(year, MONTH_JANUARY, DATE_ONE), YYYY_MM_DD_FORMAT), - observedOn: formatUtc(new Date(year, MONTH_JANUARY, DATE_TWO), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JANUARY, DATE_ONE)), YYYY_MM_DD_FORMAT), + observedOn: formatUtc(new Date(Date.UTC(year, MONTH_JANUARY, DATE_TWO)), YYYY_MM_DD_FORMAT), } : { name: `New Year's Day`, - date: formatUtc(new Date(year, MONTH_JANUARY, DATE_ONE), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JANUARY, DATE_ONE)), YYYY_MM_DD_FORMAT), }; const martinLutherKingJrDay = { @@ -99,27 +99,27 @@ export default function (year: number): FederalReserveBankHoliday[] { }; const juneteenth = - new Date(year, MONTH_JUNE, DATE_NINETEEN).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY + new Date(Date.UTC(year, MONTH_JUNE, DATE_NINETEEN)).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY ? { name: 'Juneteenth National Independence Day', - date: formatUtc(new Date(year, MONTH_JUNE, DATE_NINETEEN), YYYY_MM_DD_FORMAT), - observedOn: formatUtc(new Date(year, MONTH_JUNE, DATE_TWENTY), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JUNE, DATE_NINETEEN)), YYYY_MM_DD_FORMAT), + observedOn: formatUtc(new Date(Date.UTC(year, MONTH_JUNE, DATE_TWENTY)), YYYY_MM_DD_FORMAT), } : { name: 'Juneteenth National Independence Day', - date: formatUtc(new Date(year, MONTH_JUNE, DATE_NINETEEN), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JUNE, DATE_NINETEEN)), YYYY_MM_DD_FORMAT), }; const independenceDay = - new Date(year, MONTH_JULY, DATE_FOUR).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY + new Date(Date.UTC(year, MONTH_JULY, DATE_FOUR)).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY ? { name: 'Independence Day', - date: formatUtc(new Date(year, MONTH_JULY, DATE_FOUR), YYYY_MM_DD_FORMAT), - observedOn: formatUtc(new Date(year, MONTH_JULY, DATE_FIVE), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JULY, DATE_FOUR)), YYYY_MM_DD_FORMAT), + observedOn: formatUtc(new Date(Date.UTC(year, MONTH_JULY, DATE_FIVE)), YYYY_MM_DD_FORMAT), } : { name: 'Independence Day', - date: formatUtc(new Date(year, MONTH_JULY, DATE_FOUR), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_JULY, DATE_FOUR)), YYYY_MM_DD_FORMAT), }; const laborDay = { @@ -133,15 +133,15 @@ export default function (year: number): FederalReserveBankHoliday[] { }; const veteransDay = - new Date(year, MONTH_NOVEMBER, DATE_ELEVEN).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY + new Date(Date.UTC(year, MONTH_NOVEMBER, DATE_ELEVEN)).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY ? { name: 'Veterans Day', - date: formatUtc(new Date(year, MONTH_NOVEMBER, DATE_ELEVEN), YYYY_MM_DD_FORMAT), - observedOn: formatUtc(new Date(year, MONTH_NOVEMBER, DATE_TWELVE), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_NOVEMBER, DATE_ELEVEN)), YYYY_MM_DD_FORMAT), + observedOn: formatUtc(new Date(Date.UTC(year, MONTH_NOVEMBER, DATE_TWELVE)), YYYY_MM_DD_FORMAT), } : { name: 'Veterans Day', - date: formatUtc(new Date(year, MONTH_NOVEMBER, DATE_ELEVEN), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_NOVEMBER, DATE_ELEVEN)), YYYY_MM_DD_FORMAT), }; const thanksGivingDay = { @@ -150,15 +150,15 @@ export default function (year: number): FederalReserveBankHoliday[] { }; const christmasDay = - new Date(year, MONTH_DECEMBER, DATE_TWENTY_FIVE).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY + new Date(Date.UTC(year, MONTH_DECEMBER, DATE_TWENTY_FIVE)).getUTCDay() === DAY_OF_THE_WEEK_SUNDAY ? { name: 'Christmas Day', - date: formatUtc(new Date(year, MONTH_DECEMBER, DATE_TWENTY_FIVE), YYYY_MM_DD_FORMAT), - observedOn: formatUtc(new Date(year, MONTH_DECEMBER, DATE_TWENTY_SIX), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_DECEMBER, DATE_TWENTY_FIVE)), YYYY_MM_DD_FORMAT), + observedOn: formatUtc(new Date(Date.UTC(year, MONTH_DECEMBER, DATE_TWENTY_SIX)), YYYY_MM_DD_FORMAT), } : { name: 'Christmas Day', - date: formatUtc(new Date(year, MONTH_DECEMBER, DATE_TWENTY_FIVE), YYYY_MM_DD_FORMAT), + date: formatUtc(new Date(Date.UTC(year, MONTH_DECEMBER, DATE_TWENTY_FIVE)), YYYY_MM_DD_FORMAT), }; return year >= YEAR2021 diff --git a/src/holidays/united-states/federal-reserve-bank/index.ts b/src/holidays/united-states/federal-reserve-bank/index.ts index c884a9b..51f1094 100644 --- a/src/holidays/united-states/federal-reserve-bank/index.ts +++ b/src/holidays/united-states/federal-reserve-bank/index.ts @@ -1,6 +1,6 @@ // holidays/united-states/federal-reserve-bank/index.ts -export { default as addUSFederalReserveBankBusinessDays } from './add-us-federal-reserve-bank-business-days'; -export { default as getAllUSFederalReserveBankHolidays } from './get-all-us-federal-reserve-bank-holidays'; -export { default as isUSFederalReserveBankClosed } from './is-us-federal-reserve-bank-closed'; -export { type PlainDate } from './plain-date'; +export { default as addUSFederalReserveBankBusinessDays } from './add-us-federal-reserve-bank-business-days.ts'; +export { default as getAllUSFederalReserveBankHolidays } from './get-all-us-federal-reserve-bank-holidays.ts'; +export { default as isUSFederalReserveBankClosed } from './is-us-federal-reserve-bank-closed.ts'; +export { type PlainDate } from './plain-date.ts'; diff --git a/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.spec.ts b/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.spec.ts index 3f0ee49..2d8f46f 100644 --- a/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.spec.ts +++ b/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.spec.ts @@ -1,12 +1,13 @@ // holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { isUSFederalReserveBankClosed } from './index'; +import { isUSFederalReserveBankClosed } from './index.ts'; describe('is-us-federal-reserve-bank-holiday', () => { + process.loadEnvFile(); + it('works for random federal reserve bank business days in 2022', () => { assert.equal(isUSFederalReserveBankClosed({ year: 2022, month: 0, date: 10 }), false); assert.equal(isUSFederalReserveBankClosed({ year: 2022, month: 1, date: 7 }), false); diff --git a/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts b/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts index 3e16d1c..0041060 100644 --- a/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts +++ b/src/holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts @@ -1,8 +1,8 @@ // holidays/united-states/federal-reserve-bank/is-us-federal-reserve-bank-closed.ts -import { formatUtc } from '../../../index'; +import { formatUtc } from '../../../index.ts'; -import { getAllUSFederalReserveBankHolidays, type PlainDate } from './index'; +import { getAllUSFederalReserveBankHolidays, type PlainDate } from './index.ts'; const DAY_OF_THE_WEEK_SUNDAY = 0; const DAY_OF_THE_WEEK_SATURDAY = 6; @@ -20,7 +20,7 @@ const DAY_OF_THE_WEEK_SATURDAY = 6; * @returns boolean indicating if the US Federal Reserve Bank is closed on a given date */ export default function (plainDate: PlainDate): boolean { - const date = new Date(plainDate.year, plainDate.month, plainDate.date); + const date = new Date(Date.UTC(plainDate.year, plainDate.month, plainDate.date)); const year = date.getUTCFullYear(); const day = date.getUTCDay(); const formattedDate = formatUtc(date, 'yyyy-MM-dd'); diff --git a/src/holidays/united-states/federal-reserve-bank/subtract-us-federal-reserve-bank-business-days.spec.ts b/src/holidays/united-states/federal-reserve-bank/subtract-us-federal-reserve-bank-business-days.spec.ts index 1c6bd5c..d88512d 100644 --- a/src/holidays/united-states/federal-reserve-bank/subtract-us-federal-reserve-bank-business-days.spec.ts +++ b/src/holidays/united-states/federal-reserve-bank/subtract-us-federal-reserve-bank-business-days.spec.ts @@ -1,12 +1,13 @@ // holidays/united-states/federal-reserve-bank/subtract-us-federal-reserve-bank-business-days.spec.ts import { strict as assert } from 'node:assert'; +import { describe, it } from 'node:test'; -import { describe, it } from '@jest/globals'; - -import { addUSFederalReserveBankBusinessDays } from './index'; +import { addUSFederalReserveBankBusinessDays } from './index.ts'; describe('subtract-federal-reserve-bank-business-days', () => { + process.loadEnvFile(); + it('throws error when amount is NaN', () => { assert.throws( () => addUSFederalReserveBankBusinessDays({ year: 2022, month: 10, date: 13 }, Number.NaN), diff --git a/src/index.ts b/src/index.ts index 80ecdb3..5671910 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,13 @@ // index.ts -export * as Temporal from './temporal'; - // export all date-fns functions -export * from './date-fns'; +export * from './date-fns/index.ts'; // export all date-fns-tz functions -export * from './date-fns-tz'; +export * from './date-fns-tz/index.ts'; // export local date-fns-tz helper functions -export { default as formatUtc } from './format-utc'; +export { default as formatUtc } from './format-utc.ts'; // export all holidays functions -export * from './holidays'; +export * from './holidays/index.ts'; diff --git a/src/instant.spec.ts b/src/instant.spec.ts deleted file mode 100644 index 6d431fd..0000000 --- a/src/instant.spec.ts +++ /dev/null @@ -1,161 +0,0 @@ -// instant.spec.ts - -import { strict as assert } from 'node:assert'; - -import { describe, it } from '@jest/globals'; -import { Temporal as TemporalPolyfill } from '@js-temporal/polyfill'; - -import { Temporal } from './index'; - -describe('instant', () => { - it('from parses date strings correctly', () => { - [ - '1970-01-01T00:00:00.1Z', - '1970-01-01T00:00:00Z', - '1969-12-31T23:59:59.999999999Z', - '1969-12-31T23:59:59.999999Z', - '1969-12-31T23:59:59.999Z', - '1969-12-31T23:59:59Z', - '2286-11-20T17:46:40.123Z', - '2286-11-20T17:46:40.123456Z', - '2286-11-20T17:46:40.123456789Z', - '2286-11-20T17:46:40Z', - '2286-11-20T17:46:00Z', - ].forEach((dateString) => { - assert.equal(TemporalPolyfill.Instant.from(dateString).toString(), dateString); - assert.equal(Temporal.Instant.from(dateString).toString(), dateString); - }); - }); - - it('does not allow use of valueOf()', () => { - assert.throws(() => Temporal.Now.instant().valueOf()); - assert.throws(() => TemporalPolyfill.Now.instant().valueOf()); - assert.throws(() => (Temporal.Now.instant() as unknown as number) + 1); - assert.throws(() => (TemporalPolyfill.Now.instant() as unknown as number) + 1); - }); - - it('compare method works with sort()', () => { - // example from documentation - const one = Temporal.Instant.fromEpochSeconds(1e9); - const two = Temporal.Instant.fromEpochSeconds(1.1e9); - const three = Temporal.Instant.fromEpochSeconds(1.2e9); - - // this should not be an eslint error. Temporal.Instant.compare is a static method. - const sorted = [three, one, two].sort(Temporal.Instant.compare); - assert.equal(sorted.join(' '), '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z'); - - // example from documentation - const onePolyfill = TemporalPolyfill.Instant.fromEpochSeconds(1e9); - const twoPolyfill = TemporalPolyfill.Instant.fromEpochSeconds(1.1e9); - const threePolyfill = TemporalPolyfill.Instant.fromEpochSeconds(1.2e9); - - // this should not be an eslint error. Temporal.Instant.compare is a static method. - - const sortedPolyfill = [threePolyfill, onePolyfill, twoPolyfill].sort(TemporalPolyfill.Instant.compare); - assert.equal(sortedPolyfill.join(' '), '2001-09-09T01:46:40Z 2004-11-09T11:33:20Z 2008-01-10T21:20:00Z'); - }); - - it('static methods compatible with current TC39 Temporal polyfill', () => { - const time = TemporalPolyfill.Now.instant().epochNanoseconds; - - assert.equal( - Temporal.Instant.fromEpochSeconds(Number(time / BigInt(1e9))).toString(), - TemporalPolyfill.Instant.fromEpochSeconds(Number(time / BigInt(1e9))).toString(), - ); - - assert.equal( - Temporal.Instant.fromEpochMilliseconds(Number(time / BigInt(1e6))).toString(), - TemporalPolyfill.Instant.fromEpochMilliseconds(Number(time / BigInt(1e6))).toString(), - ); - - assert.equal( - Temporal.Instant.fromEpochMicroseconds(time / BigInt(1e3)).toString(), - TemporalPolyfill.Instant.fromEpochMicroseconds(time / BigInt(1e3)).toString(), - ); - - assert.equal( - Temporal.Instant.fromEpochNanoseconds(time).toString(), - TemporalPolyfill.Instant.fromEpochNanoseconds(time).toString(), - ); - - assert.equal( - Temporal.Instant.compare( - Temporal.Instant.fromEpochNanoseconds(time), - Temporal.Instant.fromEpochNanoseconds(time), - ), - TemporalPolyfill.Instant.compare( - TemporalPolyfill.Instant.fromEpochNanoseconds(time), - TemporalPolyfill.Instant.fromEpochNanoseconds(time), - ), - ); - - assert.equal( - Temporal.Instant.compare( - Temporal.Instant.fromEpochNanoseconds(time), - Temporal.Instant.fromEpochNanoseconds(time + BigInt(1)), - ), - TemporalPolyfill.Instant.compare( - TemporalPolyfill.Instant.fromEpochNanoseconds(time), - TemporalPolyfill.Instant.fromEpochNanoseconds(time + BigInt(1)), - ), - ); - - assert.equal( - Temporal.Instant.compare( - Temporal.Instant.fromEpochNanoseconds(time), - Temporal.Instant.fromEpochNanoseconds(time - BigInt(1)), - ), - TemporalPolyfill.Instant.compare( - TemporalPolyfill.Instant.fromEpochNanoseconds(time), - TemporalPolyfill.Instant.fromEpochNanoseconds(time - BigInt(1)), - ), - ); - - assert.equal( - Temporal.Instant.from(Temporal.Instant.fromEpochNanoseconds(time)).toString(), - TemporalPolyfill.Instant.from(TemporalPolyfill.Instant.fromEpochNanoseconds(time)).toString(), - ); - - assert.equal( - Temporal.Instant.from(Temporal.Instant.fromEpochNanoseconds(time).toString()).epochNanoseconds, - TemporalPolyfill.Instant.from(TemporalPolyfill.Instant.fromEpochNanoseconds(time).toString()).epochNanoseconds, - ); - }); - - it('compatible with current TC39 Temporal polyfill', () => { - function check(time: bigint = TemporalPolyfill.Now.instant().epochNanoseconds) { - const implementation = new Temporal.Instant(time); - const polyfill = new TemporalPolyfill.Instant(time); - - assert.equal(implementation.epochSeconds, polyfill.epochSeconds); - assert.equal(implementation.epochMicroseconds, polyfill.epochMicroseconds); - assert.equal(implementation.epochMilliseconds, polyfill.epochMilliseconds); - assert.ok(implementation.equals(implementation)); - assert.ok(polyfill.equals(polyfill)); - assert.equal(implementation.toJSON(), polyfill.toJSON()); - assert.equal(implementation.toString(), polyfill.toString()); - - assert.equal( - Temporal.Instant.from(implementation.toString()).epochNanoseconds, - TemporalPolyfill.Instant.from(polyfill.toString()).epochNanoseconds, - ); - } - - // current time - check(); - - // we only go to 10^20, the polyfill gets buggy with larger numbers far in the future and the distant past - for (let magnitude = 0; magnitude < 20; magnitude++) { - check(BigInt(magnitude)); - check(BigInt(-magnitude)); - check(BigInt(-2) ** BigInt(magnitude)); - check(BigInt(2) ** BigInt(magnitude)); - check(BigInt(-10) ** BigInt(magnitude)); - check(BigInt(10) ** BigInt(magnitude)); - check(BigInt(-10) ** BigInt(magnitude) - BigInt(magnitude)); - check(BigInt(-10) ** BigInt(magnitude) + BigInt(magnitude)); - check(BigInt(10) ** BigInt(magnitude) - BigInt(magnitude)); - check(BigInt(10) ** BigInt(magnitude) + BigInt(magnitude)); - } - }); -}); diff --git a/src/instant.ts b/src/instant.ts deleted file mode 100644 index 1852aca..0000000 --- a/src/instant.ts +++ /dev/null @@ -1,129 +0,0 @@ -// instant.ts - -export type ComparisonResult = -1 | 0 | 1; - -const YEAR_DIGITS = 4; - -const THOUSAND_DIGITS = 3; -const MILLION_DIGITS = 6; -const BILLION_DIGITS = 9; - -const THOUSAND = 10 ** THOUSAND_DIGITS; -const MILLION = 10 ** MILLION_DIGITS; -const BILLION = 10 ** BILLION_DIGITS; - -const extraRegEx = /\.\d\d\d(?\d+)Z$/u; // matches the extra digits (after millisecond) in a string like 2021-01-01T00:00:00.123456789Z - -/** - * Partial implementation of Temporal.Instant, part of the new TC39 Temporal proposal. - * - * See docs here: https://tc39.es/proposal-temporal/docs/instant.html - */ -export class Instant { - constructor(private readonly nanoseconds: bigint) {} - - static fromEpochSeconds(epochSeconds: number): Instant { - return new Instant(BigInt(epochSeconds) * BigInt(BILLION)); - } - - static fromEpochMilliseconds(epochMilliseconds: number): Instant { - return new Instant(BigInt(BigInt(epochMilliseconds) * BigInt(MILLION))); - } - - static fromEpochMicroseconds(epochMicroseconds: bigint): Instant { - return new Instant(BigInt(BigInt(epochMicroseconds) * BigInt(THOUSAND))); - } - - static fromEpochNanoseconds(epochNanoseconds: bigint): Instant { - return new Instant(epochNanoseconds); - } - - static from(item: Instant | string): Instant { - if (item instanceof Instant) { - return item; - } - const extra = extraRegEx.exec(item)?.groups?.['extra'] ?? ''; - const extraDigits = BigInt(extra) * BigInt(10 ** (MILLION_DIGITS - extra.length)); - const nanoseconds = BigInt(new Date(item).getTime()) * BigInt(MILLION) + extraDigits; - return new Instant(nanoseconds); - } - - static compare(one: { epochNanoseconds: bigint }, two: { epochNanoseconds: bigint }): ComparisonResult { - if (one.epochNanoseconds > two.epochNanoseconds) { - return 1; - } - if (one.epochNanoseconds < two.epochNanoseconds) { - return -1; - } - return 0; - } - - get epochSeconds(): number { - if (this.nanoseconds < 0 && this.nanoseconds % BigInt(BILLION) !== 0n) { - return Number(this.nanoseconds / BigInt(BILLION)) - 1; - } - return Number(this.nanoseconds / BigInt(BILLION)); - } - - get epochMilliseconds(): number { - if (this.nanoseconds < 0 && this.nanoseconds % BigInt(MILLION) !== 0n) { - return Number(this.nanoseconds / BigInt(MILLION)) - 1; - } - return Number(this.nanoseconds / BigInt(MILLION)); - } - - get epochMicroseconds(): bigint { - if (this.nanoseconds < 0 && this.nanoseconds % BigInt(THOUSAND) !== 0n) { - return this.nanoseconds / BigInt(THOUSAND) - 1n; - } - return this.nanoseconds / BigInt(THOUSAND); - } - - get epochNanoseconds(): bigint { - return this.nanoseconds; - } - - equals(this: Instant, other: Instant): boolean { - return this.nanoseconds === other.epochNanoseconds; - } - - toString(this: Instant): string { - let nanoseconds = Number(this.nanoseconds % BigInt(BILLION)); - const epochMilliseconds = - Number((this.nanoseconds / BigInt(BILLION)) * BigInt(THOUSAND)) + Math.floor(Number(nanoseconds / MILLION)); - nanoseconds = Number((this.nanoseconds < BigInt(0) ? BILLION : 0) + nanoseconds); - const millisecond = Math.floor(nanoseconds / MILLION) % THOUSAND; - const microsecond = Math.floor(nanoseconds / THOUSAND) % THOUSAND; - const nanosecond = Math.floor(nanoseconds) % THOUSAND; - - const item = new Date(epochMilliseconds); - const year = item.getUTCFullYear(); - const month = item.getUTCMonth() + 1; - const day = item.getUTCDate(); - const hour = item.getUTCHours(); - const minute = item.getUTCMinutes(); - const second = item.getUTCSeconds(); - - let fraction = `${millisecond * MILLION + microsecond * THOUSAND + nanosecond}`.padStart(BILLION_DIGITS, '0'); - while (fraction.endsWith('0')) { - fraction = fraction.slice(0, -1); - } - if (fraction.length > 0) { - fraction = `.${fraction}`; - } - return `${year.toString().padStart(YEAR_DIGITS, '0')}-${month.toString().padStart(2, '0')}-${day - .toString() - .padStart(2, '0')}T${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:${second - .toString() - .padStart(2, '0')}${fraction}Z`; - } - - toJSON(this: Instant): string { - return this.toString(); - } - - // eslint-disable-next-line class-methods-use-this - valueOf(): never { - throw new TypeError('use compare() or equals() to compare Temporal.Instant'); - } -} diff --git a/src/now.spec.ts b/src/now.spec.ts deleted file mode 100644 index a3a052a..0000000 --- a/src/now.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -// now.spec.ts - -import { strict as assert } from 'node:assert'; - -import { describe, it } from '@jest/globals'; -import { Temporal as TemporalPolyfill } from '@js-temporal/polyfill'; - -import { Temporal } from './index'; - -describe('now', () => { - it('instant() returns always-increasing values as a nanosecond-precision Instant', () => { - // make sure we're within 1ms of built-in Date - assert.ok(Math.abs(Temporal.Now.instant().epochMilliseconds - Date.now()) <= 1); - - // ensure always-increasing epoch nanosecond values over a million invocations. Polyfill fails this test. - let prior = BigInt(0); - for (let invocation = 0; invocation < 1_000_000; invocation++) { - const now = Temporal.Now.instant().epochNanoseconds; - assert.ok(prior < now); - prior = now; - } - - // make sure we're still within 1ms of built-in Date - assert.ok(Math.abs(Temporal.Now.instant().epochMilliseconds - Date.now()) <= 1); - }); - - it('polyfill instant() does not return always-increasing values as a nanosecond-precision Instant', () => { - let failed = false; - try { - // make sure we're within 1ms of built-in Date - assert.ok(Math.abs(TemporalPolyfill.Now.instant().epochMilliseconds - Date.now()) <= 1); - - // ensure always-increasing epoch nanosecond values over a million invocations. Polyfill fails this test. - let prior = BigInt(0); - for (let invocation = 0; invocation < 1_000_000; invocation++) { - const now = TemporalPolyfill.Now.instant().epochNanoseconds; - assert.ok(prior < now); - prior = now; - } - - // make sure we're still within 1ms of built-in Date - assert.ok(Math.abs(TemporalPolyfill.Now.instant().epochMilliseconds - Date.now()) <= 1); - } catch { - // expected to fail - failed = true; - } - assert.ok(failed); - }); -}); diff --git a/src/now.ts b/src/now.ts deleted file mode 100644 index 0b5089f..0000000 --- a/src/now.ts +++ /dev/null @@ -1,46 +0,0 @@ -// now.ts - -import { Instant } from './instant'; - -/** - * Partial implementation of Temporal.now, part of the new TC39 Temporal proposal. Currently only instant() is - * supported. - * - * See docs here: https://tc39.es/proposal-temporal/docs/now.html - */ - -const MILLION = 1e6; - -let baseDateTime = BigInt(Date.now()); -let baseHighResolutionTime = process.hrtime.bigint(); -let priorEpochNanoseconds = BigInt(0); - -/** - * This returns ever-increasing millisecond-accurate current time values in nanosecond form. - * - * To simulate nanosecond current time, we take the millisecond based clock and supplement with the HR timer. - * Two invocations within the same millisecond will have an accurate nanosecond difference between them, so - * this is useful for ensuring unique timestamps in webservices where concurrent execution may be an issue. - */ -export function instant(): Instant { - const dateTime = BigInt(Date.now()); - - if (dateTime > baseDateTime) { - // We're in a new millisecond, so reset the base HR time. - // This makes sure we're always returning a value that is consistent with the built-in millisecond clock. - baseHighResolutionTime = process.hrtime.bigint(); - baseDateTime = dateTime; - } - - let epochNanoseconds = - dateTime * BigInt(MILLION) + ((process.hrtime.bigint() - baseHighResolutionTime) % BigInt(MILLION)); - - if (epochNanoseconds < priorEpochNanoseconds) { - // the HR offset has overflowed, so reset the base HR time - baseHighResolutionTime = process.hrtime.bigint(); - epochNanoseconds = priorEpochNanoseconds + ((process.hrtime.bigint() - baseHighResolutionTime) % BigInt(MILLION)); - } - - priorEpochNanoseconds = epochNanoseconds; - return new Instant(epochNanoseconds); -} diff --git a/src/temporal.ts b/src/temporal.ts deleted file mode 100644 index dfdf5bc..0000000 --- a/src/temporal.ts +++ /dev/null @@ -1,4 +0,0 @@ -// temporal.ts - -export * from './instant'; -export * as Now from './now';