From 76116bae7c884bb3bb84f89a39869dd78267d66a Mon Sep 17 00:00:00 2001 From: tomcru Date: Sat, 6 Jan 2024 18:06:12 +0100 Subject: [PATCH 1/2] feat: add prettier & lint --- .eslintrc.json | 229 +++++++++++++++++---------------- .prettierrc | 7 + .vscode/settings.json | 20 +-- package.json | 6 +- src/__tests__/add.test.ts | 4 +- src/__tests__/end-of.test.ts | 74 +++++++++-- src/__tests__/format.test.ts | 20 ++- src/__tests__/general.test.ts | 1 - src/__tests__/start-of.test.ts | 91 ++++++++++--- src/__tests__/subtract.test.ts | 8 +- src/constants.ts | 46 +++++-- src/duration.ts | 5 +- src/time.ts | 211 ++++++++++++++++++++++-------- src/vitest.config.ts | 2 +- tsconfig.json | 36 +++--- yarn.lock | 115 +++++++++-------- 16 files changed, 574 insertions(+), 301 deletions(-) create mode 100644 .prettierrc diff --git a/.eslintrc.json b/.eslintrc.json index c92a0e4..93e768d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,21 +2,19 @@ "root": true, "parser": "@typescript-eslint/parser", "plugins": [ - "@typescript-eslint", - "eslint-plugin-unicorn", - "eslint-plugin-import" + "@typescript-eslint", + "eslint-plugin-unicorn", + "eslint-plugin-import" ], "env": { - "es6": true, - "node": true + "es6": true, + "node": true }, "parserOptions": { - "sourceType": "module", - "project": "./tsconfig.json" + "sourceType": "module", + "project": "./tsconfig.json" }, - "extends": [ - "plugin:unicorn/recommended" - ], + "extends": ["plugin:unicorn/recommended"], "rules": { "no-dupe-keys": "warn", "no-duplicate-case": "warn", @@ -68,9 +66,11 @@ "@typescript-eslint/no-shadow": "warn", "no-shadow-restricted-names": "warn", "no-undef-init": "warn", - "@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }], + "@typescript-eslint/no-unused-vars": [ + "warn", + { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" } + ], "array-bracket-newline": ["warn", "consistent"], - "array-bracket-spacing": ["warn", "always"], "block-spacing": ["warn", "always"], "brace-style": ["warn", "1tbs", { "allowSingleLine": true }], "comma-dangle": ["warn", "always-multiline"], @@ -87,17 +87,6 @@ "new-parens": "warn", "no-array-constructor": "warn", "no-lonely-if": "warn", - "no-mixed-operators": ["warn", { - "groups": [ - ["+", "-", "*", "/", "%", "**"], - ["&", "|", "^", "~", "<<", ">>", ">>>"], - ["==", "!=", "===", "!==", ">", ">=", "<", "<="], - ["&&", "||"], - ["+", "-", "*", "/", "%", "**", ">", ">=", "<", "<="], - ["in", "instanceof"] - ], - "allowSamePrecedence": true - }], "no-multiple-empty-lines": ["warn", { "max": 1 }], "no-new-object": "warn", "no-trailing-spaces": "warn", @@ -112,11 +101,14 @@ "@typescript-eslint/semi": "warn", "semi-spacing": "warn", "space-before-blocks": "warn", - "@typescript-eslint/space-before-function-paren": ["warn", { - "anonymous": "never", - "named": "never", - "asyncArrow": "always" - }], + "@typescript-eslint/space-before-function-paren": [ + "warn", + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + } + ], "array-element-newline": ["warn", "consistent"], "@typescript-eslint/require-await": "warn", "space-in-parens": "warn", @@ -142,16 +134,19 @@ "object-shorthand": "warn", "prefer-arrow-callback": "warn", "prefer-const": "warn", - "prefer-destructuring": ["warn", { - "VariableDeclarator": { - "array": false, - "object": true - }, - "AssignmentExpression": { - "array": false, - "object": false - } - }], + "prefer-destructuring": [ + "warn", + { + "VariableDeclarator": { + "array": false, + "object": true + }, + "AssignmentExpression": { + "array": false, + "object": false + } + } + ], "prefer-rest-params": "warn", "prefer-spread": "warn", "rest-spread-spacing": ["warn", "never"], @@ -160,24 +155,30 @@ "yield-star-spacing": "warn", "@typescript-eslint/adjacent-overload-signatures": ["warn"], "@typescript-eslint/array-type": ["warn", { "default": "array-simple" }], - "@typescript-eslint/explicit-member-accessibility": ["warn", { - "accessibility": "explicit", - "overrides": { - "accessors": "off", - "constructors": "no-public", - "parameterProperties": "off" - } - }], - "@typescript-eslint/member-delimiter-style": ["warn", { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - }], + "@typescript-eslint/explicit-member-accessibility": [ + "warn", + { + "accessibility": "explicit", + "overrides": { + "accessors": "off", + "constructors": "no-public", + "parameterProperties": "off" + } + } + ], + "@typescript-eslint/member-delimiter-style": [ + "warn", + { + "multiline": { + "delimiter": "semi", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } + } + ], "@typescript-eslint/method-signature-style": ["warn", "property"], "@typescript-eslint/no-empty-interface": "warn", "@typescript-eslint/no-extraneous-class": "warn", @@ -192,29 +193,32 @@ "unicorn/prefer-module": "off", "unicorn/no-process-exit": "off", "unicorn/no-null": "off", - "unicorn/prevent-abbreviations": ["error", { - "replacements": { - "args": false, - "db": false, - "idx": false, - "i": false - } - }], + "unicorn/prevent-abbreviations": [ + "error", + { + "replacements": { + "args": false, + "db": false, + "idx": false, + "i": false + } + } + ], "unicorn/no-await-expression-member": "off", "unicorn/no-new-array": "off", "unicorn/no-instanceof-array": "off", "padding-line-between-statements": [ - "error", - { - "blankLine": "always", - "prev": "multiline-block-like", - "next": "*" - }, - { - "blankLine": "any", - "prev": "if", - "next": "if" - } + "error", + { + "blankLine": "always", + "prev": "multiline-block-like", + "next": "*" + }, + { + "blankLine": "any", + "prev": "if", + "next": "if" + } ], "import/no-unresolved": "off", "import/named": "off", @@ -222,42 +226,51 @@ "import/export": "error", "import/order": "warn", "unicorn/no-array-callback-reference": "off", - "unicorn/prefer-number-properties": ["warn", { - "checkInfinity": false - }], - "unicorn/numeric-separators-style": ["warn", { - "hexadecimal": { - "minimumDigits": 0, - "groupLength": 2, - "onlyIfContainsSeparator": true - }, - "binary": { - "minimumDigits": 0, - "groupLength": 4, - "onlyIfContainsSeparator": true - }, - "octal": { - "minimumDigits": 0, - "groupLength": 4, - "onlyIfContainsSeparator": true - }, - "number": { - "minimumDigits": 5, - "groupLength": 3, - "onlyIfContainsSeparator": false - } - }], + "unicorn/prefer-number-properties": [ + "warn", + { + "checkInfinity": false + } + ], + "unicorn/numeric-separators-style": [ + "warn", + { + "hexadecimal": { + "minimumDigits": 0, + "groupLength": 2, + "onlyIfContainsSeparator": true + }, + "binary": { + "minimumDigits": 0, + "groupLength": 4, + "onlyIfContainsSeparator": true + }, + "octal": { + "minimumDigits": 0, + "groupLength": 4, + "onlyIfContainsSeparator": true + }, + "number": { + "minimumDigits": 5, + "groupLength": 3, + "onlyIfContainsSeparator": false + } + } + ], "unicorn/no-array-reduce": "off", "unicorn/no-array-method-this-argument": "off", "unicorn/no-array-for-each": "off", "unicorn/consistent-function-scoping": "off", "unicorn/no-nested-ternary": "off", - "@typescript-eslint/explicit-function-return-type": ["warn", { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - }] + "@typescript-eslint/explicit-function-return-type": [ + "warn", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ] } -} \ No newline at end of file +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..3761ac7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "tabWidth": 2, + "bracketSpacing": true, + "semi": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b7135f..f5d4978 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,11 @@ { - "editor.detectIndentation": false, - "editor.tabSize": 2, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, - "typescript.implementationsCodeLens.enabled": true, - "search.exclude": { - "**/node_modules": true, - }, -} \ No newline at end of file + "editor.detectIndentation": false, + "editor.tabSize": 2, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "typescript.implementationsCodeLens.enabled": true, + "search.exclude": { + "**/node_modules": true + } +} diff --git a/package.json b/package.json index 534812d..50861e1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "types": "dist/index.d.ts", "scripts": { "test:watch": "TZ=UTC vitest watch -c ./src/vitest.config.ts", - "test": "TZ=UTC vitest run -c ./src/vitest.config.ts" + "test": "TZ=UTC vitest run -c ./src/vitest.config.ts", + "lint": "eslint --ignore-path .gitignore --ext .ts .", + "lint:fix": "eslint --ignore-path .gitignore --ext .ts . --fix && npm run format:fix", + "format:fix": "prettier --ignore-path .gitignore --write \"**/*.+(ts|json)\"" }, "author": "Bartosz Krol ", "license": "MIT", @@ -22,6 +25,7 @@ "eslint-import-resolver-node": "^0.3.6", "eslint-plugin-import": "^2.25.4", "eslint-plugin-unicorn": "^39.0.0", + "prettier": "^3.1.1", "type-fest": "^3.0.0", "typescript": "^4.8.3", "vitest": "^0.34.6" diff --git a/src/__tests__/add.test.ts b/src/__tests__/add.test.ts index 1fb2e7e..205ce73 100644 --- a/src/__tests__/add.test.ts +++ b/src/__tests__/add.test.ts @@ -53,6 +53,8 @@ describe('test HolyTime.add', () => { it('should handle adding with non-standard units', () => { const date = new HolyTime(new Date('2023-01-01T00:00:00.000Z')); // @ts-expect-error - expect(() => date.add(1, 'nonStandardUnit')).toThrow('Invalid unit: nonStandardUnit'); + expect(() => date.add(1, 'nonStandardUnit')).toThrow( + 'Invalid unit: nonStandardUnit', + ); }); }); diff --git a/src/__tests__/end-of.test.ts b/src/__tests__/end-of.test.ts index 988d4dc..d909403 100644 --- a/src/__tests__/end-of.test.ts +++ b/src/__tests__/end-of.test.ts @@ -16,23 +16,69 @@ describe('test HolyTime.endOf', () => { describe('test endOf with timeZone', () => { it('should return end of unit in timeZone', () => { const date = new HolyTime(new Date('2023-01-01T01:02:03.000Z')); - expect(date.endOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 01:59:59'); - expect(date.endOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin')).toBe('2023-01-01 02:59:59'); + expect( + date.endOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 01:59:59'); + expect( + date + .endOf('hour', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin'), + ).toBe('2023-01-01 02:59:59'); - expect(date.endOf('day', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 23:59:59'); - expect(date.endOf('day', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2023-01-01 04:59:59'); - expect(date.endOf('day', 'Europe/Berlin').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-01-01 19:59:59'); + expect( + date.endOf('day', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 23:59:59'); + expect( + date + .endOf('day', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2023-01-01 04:59:59'); + expect( + date + .endOf('day', 'Europe/Berlin') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2023-01-01 19:59:59'); - expect(date.endOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-07 23:59:59'); - expect(date.endOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-01-07 18:59:59'); - expect(date.endOf('week', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2023-01-01 04:59:59'); + expect( + date.endOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-07 23:59:59'); + expect( + date + .endOf('week', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2023-01-07 18:59:59'); + expect( + date + .endOf('week', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2023-01-01 04:59:59'); - expect(date.endOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-31 23:59:59'); - expect(date.endOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-01-31 18:59:59'); - expect(date.endOf('month', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2023-01-01 04:59:59'); + expect( + date.endOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-31 23:59:59'); + expect( + date + .endOf('month', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2023-01-31 18:59:59'); + expect( + date + .endOf('month', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2023-01-01 04:59:59'); - expect(date.endOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-12-31 23:59:59'); - expect(date.endOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-12-31 18:59:59'); - expect(date.endOf('year', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2023-01-01 04:59:59'); + expect( + date.endOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-12-31 23:59:59'); + expect( + date + .endOf('year', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2023-12-31 18:59:59'); + expect( + date + .endOf('year', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2023-01-01 04:59:59'); }); }); diff --git a/src/__tests__/format.test.ts b/src/__tests__/format.test.ts index 76b0197..43bc923 100644 --- a/src/__tests__/format.test.ts +++ b/src/__tests__/format.test.ts @@ -48,12 +48,16 @@ describe('test HolyTime.format without timeZone', () => { it('should ignore unknown format & include it', () => { const date = new HolyTime(new Date('2023-01-01T00:00:00.000Z')); - expect(date.format('YYYY MM DD hh mm ss QQQ')).toBe('2023 01 01 00 00 00 QQQ'); + expect(date.format('YYYY MM DD hh mm ss QQQ')).toBe( + '2023 01 01 00 00 00 QQQ', + ); }); it('should format date with mixed valid and invalid tokens', () => { const date = new HolyTime(new Date('2023-01-01T15:45:30.000Z')); - expect(date.format('[Year:] YYYY, [Hour:] HH, [Unknown:] UUU')).toBe('Year: 2023, Hour: 15, Unknown: UUU'); + expect(date.format('[Year:] YYYY, [Hour:] HH, [Unknown:] UUU')).toBe( + 'Year: 2023, Hour: 15, Unknown: UUU', + ); }); it('should handle empty format string correctly', () => { @@ -66,7 +70,9 @@ describe('test HolyTime.format with timeZone', () => { it('should format date from UTC to America/New_York with 4h difference', () => { const date = new HolyTime(new Date('2023-04-01T00:00:00.000Z')); - expect(date.format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-03-31 20:00:00'); + expect(date.format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe( + '2023-03-31 20:00:00', + ); }); it('should format date from UTC to America/New_York with 5h difference', () => { @@ -79,12 +85,16 @@ describe('test HolyTime.format with timeZone', () => { it('should format date from UTC to America/New_York with 6h difference', () => { const date = new HolyTime(new Date('2023-12-01T00:00:00.000Z')); - expect(date.format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2023-11-30 19:00:00'); + expect(date.format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe( + '2023-11-30 19:00:00', + ); }); it('should format date from UTC to Europe/Berlin with 1h difference', () => { const date = new HolyTime(new Date('2023-04-01T00:00:00.000Z')); - expect(date.format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin')).toBe('2023-04-01 02:00:00'); + expect(date.format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin')).toBe( + '2023-04-01 02:00:00', + ); }); }); diff --git a/src/__tests__/general.test.ts b/src/__tests__/general.test.ts index 591236b..ceca93d 100644 --- a/src/__tests__/general.test.ts +++ b/src/__tests__/general.test.ts @@ -105,4 +105,3 @@ describe('test HolyTime.min', () => { expect(HolyTime.min(date, date2)).toStrictEqual(date); }); }); - diff --git a/src/__tests__/start-of.test.ts b/src/__tests__/start-of.test.ts index 0ec4301..2ffcaab 100644 --- a/src/__tests__/start-of.test.ts +++ b/src/__tests__/start-of.test.ts @@ -5,35 +5,88 @@ describe('test HolyTime.startOf', () => { it('should return start of unit', () => { const date = new HolyTime(new Date('2023-01-01T01:02:03.000Z')); - expect(date.startOf('hour').getISOString()).toBe('2023-01-01T01:00:00.000Z'); + expect(date.startOf('hour').getISOString()).toBe( + '2023-01-01T01:00:00.000Z', + ); expect(date.startOf('day').getISOString()).toBe('2023-01-01T00:00:00.000Z'); - expect(date.startOf('week').getISOString()).toBe('2023-01-01T00:00:00.000Z'); - expect(date.startOf('month').getISOString()).toBe('2023-01-01T00:00:00.000Z'); - expect(date.startOf('year').getISOString()).toBe('2023-01-01T00:00:00.000Z'); + expect(date.startOf('week').getISOString()).toBe( + '2023-01-01T00:00:00.000Z', + ); + expect(date.startOf('month').getISOString()).toBe( + '2023-01-01T00:00:00.000Z', + ); + expect(date.startOf('year').getISOString()).toBe( + '2023-01-01T00:00:00.000Z', + ); }); }); describe('test startOf with timeZone', () => { it('should return start of unit in timeZone', () => { const date = new HolyTime(new Date('2023-01-01T01:02:03.000Z')); - expect(date.startOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 01:00:00'); - expect(date.startOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin')).toBe('2023-01-01 02:00:00'); + expect( + date.startOf('hour', 'America/New_York').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 01:00:00'); + expect( + date + .startOf('hour', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/Berlin'), + ).toBe('2023-01-01 02:00:00'); - expect(date.startOf('day', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 00:00:00'); - expect(date.startOf('day', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2022-12-31 05:00:00'); - expect(date.startOf('day', 'Europe/Berlin').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2022-12-31 20:00:00'); + expect( + date.startOf('day', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 00:00:00'); + expect( + date + .startOf('day', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2022-12-31 05:00:00'); + expect( + date + .startOf('day', 'Europe/Berlin') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2022-12-31 20:00:00'); - expect(date.startOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 00:00:00'); - expect(date.startOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2022-12-31 19:00:00'); - expect(date.startOf('week', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2022-12-25 05:00:00'); + expect( + date.startOf('week', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 00:00:00'); + expect( + date + .startOf('week', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2022-12-31 19:00:00'); + expect( + date + .startOf('week', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2022-12-25 05:00:00'); - expect(date.startOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 00:00:00'); - expect(date.startOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2022-12-31 19:00:00'); - expect(date.startOf('month', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2022-12-01 05:00:00'); + expect( + date.startOf('month', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 00:00:00'); + expect( + date + .startOf('month', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2022-12-31 19:00:00'); + expect( + date + .startOf('month', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2022-12-01 05:00:00'); - expect(date.startOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss')).toBe('2023-01-01 00:00:00'); - expect(date.startOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss', 'America/New_York')).toBe('2022-12-31 19:00:00'); - expect(date.startOf('year', 'America/New_York').format('YYYY-MM-DD HH:mm:ss', 'Europe/London')).toBe('2022-01-01 05:00:00'); + expect( + date.startOf('year', 'Europe/London').format('YYYY-MM-DD HH:mm:ss'), + ).toBe('2023-01-01 00:00:00'); + expect( + date + .startOf('year', 'Europe/London') + .format('YYYY-MM-DD HH:mm:ss', 'America/New_York'), + ).toBe('2022-12-31 19:00:00'); + expect( + date + .startOf('year', 'America/New_York') + .format('YYYY-MM-DD HH:mm:ss', 'Europe/London'), + ).toBe('2022-01-01 05:00:00'); }); }); - diff --git a/src/__tests__/subtract.test.ts b/src/__tests__/subtract.test.ts index 9d0b755..1f45c88 100644 --- a/src/__tests__/subtract.test.ts +++ b/src/__tests__/subtract.test.ts @@ -47,12 +47,16 @@ describe('test HolyTime.subtract', () => { const date = new HolyTime(new Date('2023-01-01T00:00:00.000Z')); const yearInMs = 1000 * 60 * 60 * 24 * 365; const expected = new Date('2013-01-03T00:00:00.000Z'); // 2 leap years == -2 days - expect(date.subtract(10 * yearInMs, 'milliseconds').getDate()).toEqual(expected); + expect(date.subtract(10 * yearInMs, 'milliseconds').getDate()).toEqual( + expected, + ); }); it('should handle subtracting with non-standard units', () => { const date = new HolyTime(new Date('2023-01-01T00:00:00.000Z')); // @ts-expect-error - expect(() => date.subtract(1, 'nonStandardUnit')).toThrow('Invalid unit: nonStandardUnit'); + expect(() => date.subtract(1, 'nonStandardUnit')).toThrow( + 'Invalid unit: nonStandardUnit', + ); }); }); diff --git a/src/constants.ts b/src/constants.ts index 9c61508..bbbf891 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -9,24 +9,48 @@ export const TimeUnits = { MILLISECOND: 1, } as const; -export const FORMAT_REGEX = /\[(?[^\]]+)]|Y{4}|Y{2}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|a|A/g; -export const MONTH_NAMES = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; +export const FORMAT_REGEX = + /\[(?[^\]]+)]|Y{4}|Y{2}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|a|A/g; +export const MONTH_NAMES = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', +]; -export const RELATIVE_MAP: Record string)> = { +export const RELATIVE_MAP: Record< + number, + string | ((milliseconds: number) => string) +> = { [TimeUnits.SECOND * 0]: 'a few seconds', - [TimeUnits.SECOND * 5]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.SECOND)} seconds`, + [TimeUnits.SECOND * 5]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.SECOND)} seconds`, [TimeUnits.MINUTE]: 'a minute', - [TimeUnits.MINUTE * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.MINUTE)} minutes`, + [TimeUnits.MINUTE * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.MINUTE)} minutes`, [TimeUnits.HOUR]: 'an hour', - [TimeUnits.HOUR * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.HOUR)} hours`, + [TimeUnits.HOUR * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.HOUR)} hours`, [TimeUnits.DAY]: 'a day', - [TimeUnits.DAY * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.DAY)} days`, + [TimeUnits.DAY * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.DAY)} days`, [TimeUnits.WEEK]: 'a week', - [TimeUnits.WEEK * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.DAY)} weeks`, + [TimeUnits.WEEK * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.DAY)} weeks`, [TimeUnits.MONTH]: 'a month', - [TimeUnits.MONTH * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.MONTH)} months`, + [TimeUnits.MONTH * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.MONTH)} months`, [TimeUnits.YEAR]: 'a year', - [TimeUnits.YEAR * 2]: (milliseconds) => `${Math.floor(milliseconds / TimeUnits.YEAR)} years`, + [TimeUnits.YEAR * 2]: (milliseconds) => + `${Math.floor(milliseconds / TimeUnits.YEAR)} years`, }; export const TIMEZONES = [ @@ -465,4 +489,4 @@ export const TIMEZONE_MAP = { 'UTC+0': 'Europe/London', } as const; -export type TimeZone = typeof TIMEZONES[number] | keyof typeof TIMEZONE_MAP; +export type TimeZone = (typeof TIMEZONES)[number] | keyof typeof TIMEZONE_MAP; diff --git a/src/duration.ts b/src/duration.ts index 7c3d0b9..f75a921 100644 --- a/src/duration.ts +++ b/src/duration.ts @@ -10,7 +10,9 @@ export class HolyDuration { } private static getUnit(unit: HumanUnit): ValueOf { - const unitKey = unit.toUpperCase().slice(0, -1) as keyof typeof HolyTime.Units; + const unitKey = unit + .toUpperCase() + .slice(0, -1) as keyof typeof HolyTime.Units; if (!HolyTime.Units.hasOwnProperty(unitKey)) { throw new Error(`Invalid unit: ${unit}`); @@ -32,4 +34,3 @@ export class HolyDuration { return this.milliseconds / HolyDuration.getUnit(unit); } } - diff --git a/src/time.ts b/src/time.ts index 20cb6c1..10dcfca 100644 --- a/src/time.ts +++ b/src/time.ts @@ -1,5 +1,13 @@ import { ValueOf } from 'type-fest'; -import { FORMAT_REGEX, MONTH_NAMES, RELATIVE_MAP, TIMEZONES, TIMEZONE_MAP, TimeUnits, TimeZone } from './constants'; +import { + FORMAT_REGEX, + MONTH_NAMES, + RELATIVE_MAP, + TIMEZONES, + TIMEZONE_MAP, + TimeUnits, + TimeZone, +} from './constants'; import { HumanUnit, IntervalUnit, TimeResolvable } from './types'; import { HolyDuration } from './duration'; @@ -32,7 +40,9 @@ export class HolyTime { } private static getUnit(unit: HumanUnit): ValueOf { - const unitKey = unit.toUpperCase().slice(0, -1) as keyof typeof HolyTime.Units; + const unitKey = unit + .toUpperCase() + .slice(0, -1) as keyof typeof HolyTime.Units; if (!HolyTime.Units.hasOwnProperty(unitKey)) { throw new Error(`Invalid unit: ${unit}`); @@ -45,16 +55,26 @@ export class HolyTime { return new HolyTime(); } - public static add(time: TimeResolvable, amount: number, unit: HumanUnit = 'milliseconds'): HolyTime { - return new HolyTime(HolyTime.resolveDate(time).getTime() + (amount * HolyTime.getUnit(unit))); + public static add( + time: TimeResolvable, + amount: number, + unit: HumanUnit = 'milliseconds', + ): HolyTime { + return new HolyTime( + HolyTime.resolveDate(time).getTime() + amount * HolyTime.getUnit(unit), + ); } public add(amount: number, unit: HumanUnit = 'milliseconds'): this { - this.date = new Date(this.date.getTime() + (amount * HolyTime.getUnit(unit))); + this.date = new Date(this.date.getTime() + amount * HolyTime.getUnit(unit)); return this; } - public static subtract(time: TimeResolvable, amount: number, unit: HumanUnit = 'milliseconds'): HolyTime { + public static subtract( + time: TimeResolvable, + amount: number, + unit: HumanUnit = 'milliseconds', + ): HolyTime { return HolyTime.add(time, -amount, unit); } @@ -63,11 +83,16 @@ export class HolyTime { } public static in(amount: number, unit: HumanUnit = 'milliseconds'): HolyTime { - return new HolyTime(Date.now() + (amount * HolyTime.getUnit(unit ?? 'milliseconds'))); + return new HolyTime( + Date.now() + amount * HolyTime.getUnit(unit ?? 'milliseconds'), + ); } public static isEqual(timeA: TimeResolvable, timeB: TimeResolvable): boolean { - return HolyTime.resolveDate(timeA).getTime() === HolyTime.resolveDate(timeB).getTime(); + return ( + HolyTime.resolveDate(timeA).getTime() === + HolyTime.resolveDate(timeB).getTime() + ); } public isEqual(time: TimeResolvable): boolean { @@ -87,14 +112,18 @@ export class HolyTime { } /** - * Determines if a given year is a leap year. - * - * A leap year is a year that is divisible by 4, except for end-of-century years, - * which must be divisible by 400. This means that the year 2000 was a leap year, - * although 1900 was not. - */ + * Determines if a given year is a leap year. + * + * A leap year is a year that is divisible by 4, except for end-of-century years, + * which must be divisible by 400. This means that the year 2000 was a leap year, + * although 1900 was not. + */ public static isLeapYear(year: number): boolean { - if (typeof year !== 'number' || Number.isNaN(year) || !Number.isFinite(year)) { + if ( + typeof year !== 'number' || + Number.isNaN(year) || + !Number.isFinite(year) + ) { throw new TypeError('Invalid input: Year must be a finite number'); } @@ -110,19 +139,31 @@ export class HolyTime { } public static between(timeA: TimeResolvable, timeB: TimeResolvable): number { - return Math.abs(HolyTime.resolveDate(timeA).getTime() - HolyTime.resolveDate(timeB).getTime()); + return Math.abs( + HolyTime.resolveDate(timeA).getTime() - + HolyTime.resolveDate(timeB).getTime(), + ); } public static isAfter(timeA: TimeResolvable, timeB: TimeResolvable): boolean { - return HolyTime.resolveDate(timeA).getTime() > HolyTime.resolveDate(timeB).getTime(); + return ( + HolyTime.resolveDate(timeA).getTime() > + HolyTime.resolveDate(timeB).getTime() + ); } public isAfter(time: TimeResolvable): boolean { return this.date.getTime() > HolyTime.resolveDate(time).getTime(); } - public static isBefore(timeA: TimeResolvable, timeB: TimeResolvable): boolean { - return HolyTime.resolveDate(timeA).getTime() < HolyTime.resolveDate(timeB).getTime(); + public static isBefore( + timeA: TimeResolvable, + timeB: TimeResolvable, + ): boolean { + return ( + HolyTime.resolveDate(timeA).getTime() < + HolyTime.resolveDate(timeB).getTime() + ); } public isBefore(time: TimeResolvable): boolean { @@ -134,29 +175,55 @@ export class HolyTime { } public static max(...times: TimeResolvable[]): HolyTime { - return new HolyTime(Math.max(...times.map(time => HolyTime.resolveDate(time).getTime()))); + return new HolyTime( + Math.max(...times.map((time) => HolyTime.resolveDate(time).getTime())), + ); } public static min(...times: TimeResolvable[]): HolyTime { - return new HolyTime(Math.min(...times.map(time => HolyTime.resolveDate(time).getTime()))); + return new HolyTime( + Math.min(...times.map((time) => HolyTime.resolveDate(time).getTime())), + ); } - public static startOf(unit: IntervalUnit, time: TimeResolvable = new Date(), timeZone?: TimeZone): HolyTime { - const date = HolyTime.adjustToTimeZone(HolyTime.resolveDate(time), timeZone); + public static startOf( + unit: IntervalUnit, + time: TimeResolvable = new Date(), + timeZone?: TimeZone, + ): HolyTime { + const date = HolyTime.adjustToTimeZone( + HolyTime.resolveDate(time), + timeZone, + ); const offset = HolyTime.between(date, time); switch (unit) { case 'hour': - return new HolyTime(new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours())).add(offset); + return new HolyTime( + new Date( + date.getFullYear(), + date.getMonth(), + date.getDate(), + date.getHours(), + ), + ).add(offset); case 'day': - return new HolyTime(new Date(date.getFullYear(), date.getMonth(), date.getDate())).add(offset); + return new HolyTime( + new Date(date.getFullYear(), date.getMonth(), date.getDate()), + ).add(offset); case 'week': - return new HolyTime(new Date(date.getFullYear(), date.getMonth(), date.getDate())).subtract(date.getDay(), 'days').add(offset); + return new HolyTime( + new Date(date.getFullYear(), date.getMonth(), date.getDate()), + ) + .subtract(date.getDay(), 'days') + .add(offset); case 'month': - return new HolyTime(new Date(date.getFullYear(), date.getMonth())).add(offset); + return new HolyTime(new Date(date.getFullYear(), date.getMonth())).add( + offset, + ); case 'year': return new HolyTime(new Date(date.getFullYear(), 0)).add(offset); @@ -167,30 +234,52 @@ export class HolyTime { return HolyTime.startOf(unit, this, timeZone); } - public static endOf(unit: IntervalUnit, time: TimeResolvable = new Date(), timeZone?: TimeZone): HolyTime { - const date = HolyTime.adjustToTimeZone(HolyTime.resolveDate(time), timeZone); + public static endOf( + unit: IntervalUnit, + time: TimeResolvable = new Date(), + timeZone?: TimeZone, + ): HolyTime { + const date = HolyTime.adjustToTimeZone( + HolyTime.resolveDate(time), + timeZone, + ); const offset = HolyTime.between(date, time); switch (unit) { case 'hour': - return HolyTime.startOf('hour', date).add(HolyTime.Units.HOUR).subtract(HolyTime.Units.MILLISECOND).add(offset); + return HolyTime.startOf('hour', date) + .add(HolyTime.Units.HOUR) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); case 'day': - return HolyTime.startOf('day', date).add(HolyTime.Units.DAY).subtract(HolyTime.Units.MILLISECOND).add(offset); + return HolyTime.startOf('day', date) + .add(HolyTime.Units.DAY) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); case 'week': - return HolyTime.startOf('week', date).add(HolyTime.Units.WEEK).subtract(HolyTime.Units.MILLISECOND).add(offset); + return HolyTime.startOf('week', date) + .add(HolyTime.Units.WEEK) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); case 'month': { if (date.getMonth() === 11) { - return new HolyTime(new Date(date.getFullYear() + 1, 0)).subtract(HolyTime.Units.MILLISECOND).add(offset); + return new HolyTime(new Date(date.getFullYear() + 1, 0)) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); } - return new HolyTime(new Date(date.getFullYear(), date.getMonth() + 1)).subtract(HolyTime.Units.MILLISECOND).add(offset); + return new HolyTime(new Date(date.getFullYear(), date.getMonth() + 1)) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); } case 'year': - return new HolyTime(new Date(date.getFullYear() + 1, 0)).subtract(HolyTime.Units.MILLISECOND).add(offset); + return new HolyTime(new Date(date.getFullYear() + 1, 0)) + .subtract(HolyTime.Units.MILLISECOND) + .add(offset); } } @@ -198,8 +287,15 @@ export class HolyTime { return HolyTime.endOf(unit, this, timeZone); } - public static format(time: TimeResolvable, format: string, timeZone?: TimeZone): string { - const date = HolyTime.adjustToTimeZone(HolyTime.resolveDate(time), timeZone); + public static format( + time: TimeResolvable, + format: string, + timeZone?: TimeZone, + ): string { + const date = HolyTime.adjustToTimeZone( + HolyTime.resolveDate(time), + timeZone, + ); const values: Record = { YY: date.getFullYear().toString().slice(2, 4), @@ -212,8 +308,10 @@ export class HolyTime { DD: date.getDate().toString().padStart(2, '0'), HH: date.getHours().toString().padStart(2, '0'), H: date.getHours().toString(), - hh: (date.getHours() % 12 ? (date.getHours() % 12) : 12).toString().padStart(2, '0'), - h: (date.getHours() % 12 ? (date.getHours() % 12) : 12).toString(), + hh: (date.getHours() % 12 ? date.getHours() % 12 : 12) + .toString() + .padStart(2, '0'), + h: (date.getHours() % 12 ? date.getHours() % 12 : 12).toString(), A: date.getHours() >= 12 ? 'PM' : 'AM', a: date.getHours() >= 12 ? 'pm' : 'am', m: date.getMinutes().toString(), @@ -222,34 +320,39 @@ export class HolyTime { ss: date.getSeconds().toString().padStart(2, '0'), }; - return format.replace(FORMAT_REGEX, (match, group) => group ?? values[match] ?? '?'); + return format.replace( + FORMAT_REGEX, + (match, group) => group ?? values[match] ?? '?', + ); } public format(format: string, timeZone?: TimeZone): string { return HolyTime.format(this, format, timeZone); } - public static relativeFromTo(timeA: TimeResolvable, timeB: TimeResolvable): string { + public static relativeFromTo( + timeA: TimeResolvable, + timeB: TimeResolvable, + ): string { const differance = HolyTime.between(timeA, timeB); const time = Math.max( - ...Object - .keys(RELATIVE_MAP) + ...Object.keys(RELATIVE_MAP) .map(Number) - .filter(n => n <= differance), + .filter((n) => n <= differance), ); const format = RELATIVE_MAP[time]; const future = HolyTime.isBefore(timeA, timeB); - const output = typeof format === 'string' - ? format - : format(differance); + const output = typeof format === 'string' ? format : format(differance); - return future - ? `in ${output}` - : `${output} ago`; + return future ? `in ${output}` : `${output} ago`; } - public static next(unit: IntervalUnit, time: TimeResolvable = new Date(), timeZone?: TimeZone): HolyTime { + public static next( + unit: IntervalUnit, + time: TimeResolvable = new Date(), + timeZone?: TimeZone, + ): HolyTime { return HolyTime.endOf(unit, time, timeZone).add(HolyTime.Units.MILLISECOND); } @@ -257,7 +360,10 @@ export class HolyTime { return HolyTime.next(unit, this, timeZone); } - public static duration(amount: number, unit: HumanUnit = 'milliseconds'): HolyDuration { + public static duration( + amount: number, + unit: HumanUnit = 'milliseconds', + ): HolyDuration { return new HolyDuration(amount * HolyTime.getUnit(unit)); } @@ -289,4 +395,3 @@ export class HolyTime { return HolyTime.relativeFromTo(time, this); } } - diff --git a/src/vitest.config.ts b/src/vitest.config.ts index 7d46ecb..bf92dcf 100644 --- a/src/vitest.config.ts +++ b/src/vitest.config.ts @@ -1,5 +1,5 @@ export default { test: { - include: [ 'src/__tests__/**/*.test.ts' ], + include: ['src/__tests__/**/*.test.ts'], }, }; diff --git a/tsconfig.json b/tsconfig.json index c55ad37..d8a4647 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,18 @@ -{ - "compilerOptions": { - "module": "CommonJS", - "target": "esnext", - "outDir": "./dist", - "rootDir": "./src", - "moduleResolution": "node", - "declaration": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "allowSyntheticDefaultImports": true, - "lib": ["esnext", "esnext.asynciterable"], - "types": ["node"], - "skipLibCheck": true - }, - "include": ["src/"], - "exclude": ["node_modules/"] -} +{ + "compilerOptions": { + "module": "CommonJS", + "target": "esnext", + "outDir": "./dist", + "rootDir": "./src", + "moduleResolution": "node", + "declaration": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "allowSyntheticDefaultImports": true, + "lib": ["esnext", "esnext.asynciterable"], + "types": ["node"], + "skipLibCheck": true + }, + "include": ["src/"], + "exclude": ["node_modules/"] +} diff --git a/yarn.lock b/yarn.lock index 717c9cb..53f5415 100644 --- a/yarn.lock +++ b/yarn.lock @@ -215,7 +215,7 @@ "@esbuild/darwin-arm64@0.19.8": version "0.19.8" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.8.tgz#49f5718d36541f40dd62bfdf84da9c65168a0fc2" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.8.tgz" integrity sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw== "@esbuild/darwin-x64@0.19.8": @@ -349,7 +349,7 @@ "@jest/schemas@^29.6.3": version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz" integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: "@sinclair/typebox" "^0.27.8" @@ -388,7 +388,7 @@ "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@^0.3.9": @@ -439,7 +439,7 @@ "@rollup/rollup-darwin-arm64@4.6.0": version "4.6.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.0.tgz#6d2f53021fbb9fdecf60bfb6fd5d999aef8385e9" + resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.0.tgz" integrity sha512-oLzzxcUIHltHxOCmaXl+pkIlU+uhSxef5HfntW7RsLh1eHm+vJzjD9Oo4oUKso4YuP4PpbFJNlZjJuOrxo8dPg== "@rollup/rollup-darwin-x64@4.6.0": @@ -489,19 +489,19 @@ "@sinclair/typebox@^0.27.8": version "0.27.8" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== "@types/chai-subset@^1.3.3": version "1.3.5" - resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.5.tgz#3fc044451f26985f45625230a7f22284808b0a9a" + resolved "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.5.tgz" integrity sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A== dependencies: "@types/chai" "*" "@types/chai@*", "@types/chai@^4.3.5": version "4.3.11" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.11.tgz#e95050bf79a932cb7305dd130254ccdf9bde671c" + resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz" integrity sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ== "@types/json-schema@^7.0.9": @@ -516,7 +516,7 @@ "@types/node@*": version "20.10.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + resolved "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz" integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== dependencies: undici-types "~5.26.4" @@ -613,7 +613,7 @@ "@vitest/expect@0.34.6": version "0.34.6" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.6.tgz#608a7b7a9aa3de0919db99b4cc087340a03ea77e" + resolved "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz" integrity sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw== dependencies: "@vitest/spy" "0.34.6" @@ -622,7 +622,7 @@ "@vitest/runner@0.34.6": version "0.34.6" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.6.tgz#6f43ca241fc96b2edf230db58bcde5b974b8dcaf" + resolved "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz" integrity sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ== dependencies: "@vitest/utils" "0.34.6" @@ -631,7 +631,7 @@ "@vitest/snapshot@0.34.6": version "0.34.6" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.6.tgz#b4528cf683b60a3e8071cacbcb97d18b9d5e1d8b" + resolved "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz" integrity sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w== dependencies: magic-string "^0.30.1" @@ -640,14 +640,14 @@ "@vitest/spy@0.34.6": version "0.34.6" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.6.tgz#b5e8642a84aad12896c915bce9b3cc8cdaf821df" + resolved "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz" integrity sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ== dependencies: tinyspy "^2.1.1" "@vitest/utils@0.34.6": version "0.34.6" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.6.tgz#38a0a7eedddb8e7291af09a2409cb8a189516968" + resolved "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz" integrity sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A== dependencies: diff-sequences "^29.4.3" @@ -661,12 +661,12 @@ acorn-jsx@^5.3.2: acorn-walk@^8.2.0: version "8.3.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.0.tgz#2097665af50fd0cf7a2dfccd2b9368964e66540f" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz" integrity sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA== acorn@^8.10.0, acorn@^8.9.0: version "8.11.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz" integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== acorn@^8.8.0: @@ -705,7 +705,7 @@ ansi-styles@^4.1.0: ansi-styles@^5.0.0: version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== argparse@^2.0.1: @@ -741,7 +741,7 @@ array.prototype.flat@^1.2.5: assertion-error@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== balanced-match@^1.0.0: @@ -781,7 +781,7 @@ builtin-modules@^3.3.0: cac@^6.7.14: version "6.7.14" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + resolved "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz" integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== call-bind@^1.0.0, call-bind@^1.0.2: @@ -804,7 +804,7 @@ caniuse-lite@^1.0.30001400: chai@^4.3.10: version "4.3.10" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + resolved "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz" integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== dependencies: assertion-error "^1.1.0" @@ -834,7 +834,7 @@ chalk@^4.0.0: check-error@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz" integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== dependencies: get-func-name "^2.0.2" @@ -919,7 +919,7 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: deep-eql@^4.1.3: version "4.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== dependencies: type-detect "^4.0.0" @@ -939,7 +939,7 @@ define-properties@^1.1.3, define-properties@^1.1.4: diff-sequences@^29.4.3: version "29.6.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== dir-glob@^3.0.1: @@ -1023,7 +1023,7 @@ es-to-primitive@^1.2.1: esbuild@^0.19.3: version "0.19.8" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.8.tgz#ad05b72281d84483fa6b5345bd246c27a207b8f1" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.19.8.tgz" integrity sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w== optionalDependencies: "@esbuild/android-arm" "0.19.8" @@ -1329,7 +1329,7 @@ fs.realpath@^1.0.0: fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== function-bind@^1.1.1: @@ -1359,7 +1359,7 @@ gensync@^1.0.0-beta.2: get-func-name@^2.0.1, get-func-name@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: @@ -1692,7 +1692,7 @@ json5@^2.2.1: jsonc-parser@^3.2.0: version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== levn@^0.4.1: @@ -1710,7 +1710,7 @@ lines-and-columns@^1.1.6: local-pkg@^0.4.3: version "0.4.3" - resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" + resolved "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz" integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== locate-path@^5.0.0: @@ -1739,7 +1739,7 @@ lodash@^4.17.21: loupe@^2.3.6: version "2.3.7" - resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz" integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== dependencies: get-func-name "^2.0.1" @@ -1753,7 +1753,7 @@ lru-cache@^6.0.0: magic-string@^0.30.1: version "0.30.5" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz" integrity sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA== dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" @@ -1790,7 +1790,7 @@ minimist@^1.2.0, minimist@^1.2.6: mlly@^1.2.0, mlly@^1.4.0: version "1.4.2" - resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.2.tgz#7cf406aa319ff6563d25da6b36610a93f2a8007e" + resolved "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz" integrity sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg== dependencies: acorn "^8.10.0" @@ -1815,7 +1815,7 @@ multimap@^1.1.0: nanoid@^3.3.6: version "3.3.7" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== natural-compare@^1.4.0: @@ -1902,7 +1902,7 @@ p-limit@^3.0.2: p-limit@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz" integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== dependencies: yocto-queue "^1.0.0" @@ -1970,12 +1970,12 @@ path-type@^4.0.0: pathe@^1.1.0, pathe@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a" + resolved "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz" integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== pathval@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== picocolors@^1.0.0: @@ -1990,7 +1990,7 @@ picomatch@^2.3.1: pkg-types@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868" + resolved "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz" integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== dependencies: jsonc-parser "^3.2.0" @@ -2004,7 +2004,7 @@ pluralize@^8.0.0: postcss@^8.4.31: version "8.4.31" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz" integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: nanoid "^3.3.6" @@ -2016,9 +2016,14 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" + integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== + pretty-format@^29.5.0: version "29.7.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz" integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== dependencies: "@jest/schemas" "^29.6.3" @@ -2037,7 +2042,7 @@ queue-microtask@^1.2.2: react-is@^18.0.0: version "18.2.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== read-pkg-up@^7.0.1: @@ -2106,7 +2111,7 @@ rimraf@^3.0.2: rollup@^4.2.0: version "4.6.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.6.0.tgz#4f966f6dd3f6bafd01b864d68ba078d308b864fa" + resolved "https://registry.npmjs.org/rollup/-/rollup-4.6.0.tgz" integrity sha512-R8i5Her4oO1LiMQ3jKf7MUglYV/mhQ5g5OKeld5CnkmPdIGo79FDDQYqPhq/PCVuTQVuxsWgIbDy9F+zdHn80w== optionalDependencies: "@rollup/rollup-android-arm-eabi" "4.6.0" @@ -2191,7 +2196,7 @@ side-channel@^1.0.4: siginfo@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" + resolved "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz" integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== slash@^3.0.0: @@ -2201,7 +2206,7 @@ slash@^3.0.0: source-map-js@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== spdx-correct@^3.0.0: @@ -2232,12 +2237,12 @@ spdx-license-ids@^3.0.0: stackback@0.0.2: version "0.0.2" - resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" + resolved "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz" integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== std-env@^3.3.3: version "3.5.0" - resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.5.0.tgz#83010c9e29bd99bf6f605df87c19012d82d63b97" + resolved "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz" integrity sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA== string.prototype.trimend@^1.0.5: @@ -2284,7 +2289,7 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: strip-literal@^1.0.1: version "1.3.0" - resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.3.0.tgz#db3942c2ec1699e6836ad230090b84bb458e3a07" + resolved "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz" integrity sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg== dependencies: acorn "^8.10.0" @@ -2315,17 +2320,17 @@ text-table@^0.2.0: tinybench@^2.5.0: version "2.5.1" - resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.1.tgz#3408f6552125e53a5a48adee31261686fd71587e" + resolved "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz" integrity sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg== tinypool@^0.7.0: version "0.7.0" - resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.7.0.tgz#88053cc99b4a594382af23190c609d93fddf8021" + resolved "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz" integrity sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww== tinyspy@^2.1.1: version "2.2.0" - resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.0.tgz#9dc04b072746520b432f77ea2c2d17933de5d6ce" + resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz" integrity sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg== to-fast-properties@^2.0.0: @@ -2371,7 +2376,7 @@ type-check@^0.4.0, type-check@~0.4.0: type-detect@^4.0.0, type-detect@^4.0.8: version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== type-fest@^0.20.2: @@ -2401,7 +2406,7 @@ typescript@^4.8.3: ufo@^1.3.0: version "1.3.2" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.2.tgz#c7d719d0628a1c80c006d2240e0d169f6e3c0496" + resolved "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz" integrity sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA== unbox-primitive@^1.0.2: @@ -2416,7 +2421,7 @@ unbox-primitive@^1.0.2: undici-types@~5.26.4: version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== update-browserslist-db@^1.0.9: @@ -2444,7 +2449,7 @@ validate-npm-package-license@^3.0.1: vite-node@0.34.6: version "0.34.6" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.6.tgz#34d19795de1498562bf21541a58edcd106328a17" + resolved "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz" integrity sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA== dependencies: cac "^6.7.14" @@ -2456,7 +2461,7 @@ vite-node@0.34.6: "vite@^3.0.0 || ^4.0.0 || ^5.0.0-0", "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0": version "5.0.4" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.4.tgz#d984d2aaa8bac30f1ca9b9eea9b97e052f88c307" + resolved "https://registry.npmjs.org/vite/-/vite-5.0.4.tgz" integrity sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg== dependencies: esbuild "^0.19.3" @@ -2467,7 +2472,7 @@ vite-node@0.34.6: vitest@^0.34.6: version "0.34.6" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.6.tgz#44880feeeef493c04b7f795ed268f24a543250d7" + resolved "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz" integrity sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q== dependencies: "@types/chai" "^4.3.5" @@ -2515,7 +2520,7 @@ which@^2.0.1: why-is-node-running@^2.2.2: version "2.2.2" - resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e" + resolved "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz" integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== dependencies: siginfo "^2.0.0" @@ -2543,5 +2548,5 @@ yocto-queue@^0.1.0: yocto-queue@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== From 823bb48514ebc665e84a6d097cb0965b5b04eef5 Mon Sep 17 00:00:00 2001 From: tomcru Date: Sat, 6 Jan 2024 18:07:07 +0100 Subject: [PATCH 2/2] chore: remove .vscode --- .gitignore | 3 ++- .vscode/settings.json | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index e5aaf39..da955ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules dist *.tgz -package-lock.json \ No newline at end of file +package-lock.json +.vscode \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f5d4978..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "editor.detectIndentation": false, - "editor.tabSize": 2, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, - "typescript.implementationsCodeLens.enabled": true, - "search.exclude": { - "**/node_modules": true - } -}