diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cb4a78245..d9dd06b3f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -56,6 +56,7 @@ jobs:
- run: npm cache clean --force
- run: npm ci
- run: npm run build --if-present
+ - run: npm run lint
Upload_Coverage_Report:
name: Upload coverage report to codecov
diff --git a/.npmignore b/.npmignore
index d8064e0c2..238ec2f75 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,29 +1,23 @@
-src
-**/*.js.map
-test
-typings
-bundled
-build
-temp
-coverage
-docs
-wiki
-gulpfile.js
-bower.json
-mocha.opts
-tsconfig.json
-typings.json
-CONTRIBUTING.md
-ISSUE_TEMPLATE.md
-PULL_REQUEST_TEMPLATE.md
-CODE_OF_CONDUCT.md
-tslint.json
-wallaby.js
.auditignore
-.nyc_output
.github
.gitignore
+.nyc_output
.publishrc
.travis.yml
.vscode
-type_definitions
+**/*.js.map
+build
+CODE_OF_CONDUCT.md
+CONTRIBUTING.md
+coverage
+docs
+eslint.config.mjs
+ISSUE_TEMPLATE.md
+mocha.opts
+prettier.config.mjs
+PULL_REQUEST_TEMPLATE.md
+src
+temp
+test
+tsconfig.json
+wiki
diff --git a/README.md b/README.md
index df70c8088..fbbdc36f1 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,15 @@

-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
# InversifyJS
@@ -176,9 +176,9 @@ class Ninja implements Warrior {
private _katana: Weapon;
private _shuriken: ThrowableWeapon;
- public constructor(
- @inject(TYPES.Weapon) katana: Weapon,
- @inject(TYPES.ThrowableWeapon) shuriken: ThrowableWeapon
+ constructor(
+ @inject(TYPES.Weapon) katana: Weapon,
+ @inject(TYPES.ThrowableWeapon) shuriken: ThrowableWeapon
) {
this._katana = katana;
this._shuriken = shuriken;
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 000000000..5b0e25724
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,177 @@
+// @ts-check
+
+import eslint from '@eslint/js';
+import tseslint from 'typescript-eslint';
+import eslintPrettierConfig from 'eslint-plugin-prettier/recommended';
+import simpleImportSort from 'eslint-plugin-simple-import-sort';
+
+/**
+ * @returns {import('typescript-eslint').ConfigWithExtends}
+ */
+function buildBaseConfig() {
+ return {
+ extends: [
+ eslint.configs.recommended,
+ ...tseslint.configs.strictTypeChecked,
+ ],
+ languageOptions: {
+ parser: tseslint.parser,
+ parserOptions: {
+ project: './tsconfig.json',
+ },
+ },
+ plugins: {
+ '@typescript-eslint': tseslint.plugin,
+ 'simple-import-sort': simpleImportSort,
+ },
+ rules: {
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
+ '@typescript-eslint/explicit-member-accessibility': [
+ 'error',
+ {
+ overrides: {
+ constructors: 'no-public',
+ },
+ },
+ ],
+ '@typescript-eslint/member-ordering': ['warn'],
+ '@typescript-eslint/naming-convention': [
+ 'error',
+ {
+ selector: ['classProperty'],
+ format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'],
+ leadingUnderscore: 'allow',
+ },
+ {
+ selector: 'typeParameter',
+ format: ['StrictPascalCase'],
+ prefix: ['T'],
+ },
+ {
+ selector: ['typeLike'],
+ format: ['StrictPascalCase'],
+ },
+ {
+ selector: ['function', 'classMethod'],
+ format: ['strictCamelCase'],
+ leadingUnderscore: 'allow',
+ },
+ {
+ selector: ['parameter'],
+ format: ['strictCamelCase'],
+ leadingUnderscore: 'allow',
+ },
+ {
+ selector: ['variableLike'],
+ format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'],
+ },
+ ],
+ '@typescript-eslint/no-deprecated': 'error',
+ '@typescript-eslint/no-duplicate-type-constituents': 'off',
+ '@typescript-eslint/no-dynamic-delete': 'error',
+ '@typescript-eslint/no-extraneous-class': 'off',
+ '@typescript-eslint/no-inferrable-types': 'off',
+ '@typescript-eslint/no-empty-interface': 'warn',
+ '@typescript-eslint/no-explicit-any': 'error',
+ '@typescript-eslint/no-floating-promises': ['error'],
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
+ 'no-magic-numbers': 'off',
+ '@typescript-eslint/no-magic-numbers': [
+ 'warn',
+ {
+ ignore: [0, 1],
+ ignoreArrayIndexes: true,
+ ignoreEnums: true,
+ ignoreReadonlyClassProperties: true,
+ },
+ ],
+ '@typescript-eslint/no-require-imports': 'error',
+ '@typescript-eslint/no-unnecessary-type-arguments': 'off',
+ '@typescript-eslint/no-unused-expressions': ['error'],
+ '@typescript-eslint/no-useless-constructor': 'error',
+ '@typescript-eslint/prefer-for-of': 'error',
+ '@typescript-eslint/prefer-nullish-coalescing': ['off'],
+ '@typescript-eslint/prefer-optional-chain': 'off',
+ '@typescript-eslint/prefer-readonly': ['warn'],
+ '@typescript-eslint/promise-function-async': ['error'],
+ '@typescript-eslint/require-await': 'off',
+ '@typescript-eslint/restrict-plus-operands': [
+ 'error',
+ {
+ skipCompoundAssignments: false,
+ },
+ ],
+ '@typescript-eslint/typedef': [
+ 'error',
+ {
+ arrayDestructuring: true,
+ arrowParameter: true,
+ memberVariableDeclaration: true,
+ objectDestructuring: true,
+ parameter: true,
+ propertyDeclaration: true,
+ variableDeclaration: true,
+ },
+ ],
+ '@typescript-eslint/unified-signatures': 'error',
+ '@typescript-eslint/strict-boolean-expressions': 'error',
+ '@typescript-eslint/switch-exhaustiveness-check': [
+ 'error',
+ {
+ considerDefaultExhaustiveForUnions: true,
+ },
+ ],
+ '@typescript-eslint/no-unused-vars': [
+ 'warn',
+ {
+ args: 'all',
+ argsIgnorePattern: '^_',
+ caughtErrors: 'all',
+ caughtErrorsIgnorePattern: '^_',
+ destructuredArrayIgnorePattern: '^_',
+ varsIgnorePattern: '^_',
+ ignoreRestSiblings: true,
+ },
+ ],
+ 'simple-import-sort/imports': [
+ 'error',
+ {
+ groups: [['^\\u0000'], ['^node:'], ['^@?\\w'], ['^'], ['^\\.']],
+ },
+ ],
+ 'sort-keys': [
+ 'error',
+ 'asc',
+ {
+ caseSensitive: false,
+ natural: true,
+ },
+ ],
+ },
+ };
+}
+
+const baseRules = buildBaseConfig();
+
+const config = tseslint.config(
+ {
+ ...baseRules,
+ files: ['**/*.ts'],
+ ignores: ['**/*.test.ts'],
+ },
+ {
+ ...baseRules,
+ files: ['**/*.test.ts'],
+ rules: {
+ ...(baseRules.rules ?? {}),
+ '@typescript-eslint/no-confusing-void-expression': 'off',
+ '@typescript-eslint/unbound-method': 'off',
+ '@typescript-eslint/no-magic-numbers': 'off',
+ },
+ },
+ /** @type {import('typescript-eslint').ConfigWithExtends} */ (
+ eslintPrettierConfig
+ ),
+);
+
+export default [...config];
diff --git a/package-lock.json b/package-lock.json
index 7c39352de..3cebf59dc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,10 +9,17 @@
"version": "6.0.3",
"license": "MIT",
"devDependencies": {
+ "@eslint/js": "9.13.0",
"@types/chai": "4.3.6",
"@types/mocha": "10.0.9",
"@types/sinon": "17.0.3",
+ "@typescript-eslint/eslint-plugin": "8.12.2",
+ "@typescript-eslint/parser": "8.12.2",
"chai": "4.3.8",
+ "eslint": "9.13.0",
+ "eslint-config-prettier": "9.1.0",
+ "eslint-plugin-prettier": "5.2.1",
+ "eslint-plugin-simple-import-sort": "12.1.1",
"mocha": "10.7.3",
"nyc": "17.1.0",
"prettier": "3.3.3",
@@ -21,8 +28,8 @@
"rimraf": "6.0.1",
"sinon": "19.0.2",
"ts-node": "10.9.2",
- "tslint": "6.1.3",
"typescript": "5.6.3",
+ "typescript-eslint": "8.12.2",
"updates": "16.4.0"
}
},
@@ -401,6 +408,252 @@
"node": ">=12"
}
},
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz",
+ "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eslint-visitor-keys": "^3.4.3"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "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",
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@eslint/config-array": {
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz",
+ "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.4",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/config-array/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@eslint/config-array/node_modules/ms": {
+ "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"
+ },
+ "node_modules/@eslint/core": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz",
+ "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz",
+ "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "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"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint/eslintrc/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"
+ },
+ "node_modules/@eslint/eslintrc/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@eslint/eslintrc/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",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/ms": {
+ "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"
+ },
+ "node_modules/@eslint/js": {
+ "version": "9.13.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz",
+ "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz",
+ "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.2.tgz",
+ "integrity": "sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "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",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "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",
+ "dependencies": {
+ "@humanfs/core": "^0.19.1",
+ "@humanwhocodes/retry": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "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",
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "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",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@@ -642,6 +895,57 @@
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
+ "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",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "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,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "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,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@pkgr/core": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz",
+ "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/unts"
+ }
+ },
"node_modules/@sinonjs/commons": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
@@ -722,6 +1026,20 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/estree": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
+ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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"
+ },
"node_modules/@types/mocha": {
"version": "10.0.9",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.9.tgz",
@@ -736,22 +1054,349 @@
"dev": true,
"peer": true
},
- "node_modules/@types/sinon": {
- "version": "17.0.3",
- "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz",
- "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==",
+ "node_modules/@types/sinon": {
+ "version": "17.0.3",
+ "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz",
+ "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/sinonjs__fake-timers": "*"
+ }
+ },
+ "node_modules/@types/sinonjs__fake-timers": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz",
+ "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==",
+ "dev": true
+ },
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.2.tgz",
+ "integrity": "sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/regexpp": "^4.10.0",
+ "@typescript-eslint/scope-manager": "8.12.2",
+ "@typescript-eslint/type-utils": "8.12.2",
+ "@typescript-eslint/utils": "8.12.2",
+ "@typescript-eslint/visitor-keys": "8.12.2",
+ "graphemer": "^1.4.0",
+ "ignore": "^5.3.1",
+ "natural-compare": "^1.4.0",
+ "ts-api-utils": "^1.3.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
+ "eslint": "^8.57.0 || ^9.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.2.tgz",
+ "integrity": "sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "8.12.2",
+ "@typescript-eslint/types": "8.12.2",
+ "@typescript-eslint/typescript-estree": "8.12.2",
+ "@typescript-eslint/visitor-keys": "8.12.2",
+ "debug": "^4.3.4"
+ },
+ "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"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser/node_modules/ms": {
+ "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"
+ },
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.2.tgz",
+ "integrity": "sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.12.2",
+ "@typescript-eslint/visitor-keys": "8.12.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.2.tgz",
+ "integrity": "sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/typescript-estree": "8.12.2",
+ "@typescript-eslint/utils": "8.12.2",
+ "debug": "^4.3.4",
+ "ts-api-utils": "^1.3.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils/node_modules/ms": {
+ "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"
+ },
+ "node_modules/@typescript-eslint/types": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.2.tgz",
+ "integrity": "sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.2.tgz",
+ "integrity": "sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@typescript-eslint/types": "8.12.2",
+ "@typescript-eslint/visitor-keys": "8.12.2",
+ "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": "^1.3.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/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",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "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",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": {
+ "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"
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.2.tgz",
+ "integrity": "sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.4.0",
+ "@typescript-eslint/scope-manager": "8.12.2",
+ "@typescript-eslint/types": "8.12.2",
+ "@typescript-eslint/typescript-estree": "8.12.2"
+ },
+ "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"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.2.tgz",
+ "integrity": "sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.12.2",
+ "eslint-visitor-keys": "^3.4.3"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.14.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
+ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "@types/sinonjs__fake-timers": "*"
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
- "node_modules/@types/sinonjs__fake-timers": {
- "version": "8.1.1",
- "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz",
- "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==",
- "dev": true
- },
"node_modules/aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
@@ -765,6 +1410,23 @@
"node": ">=8"
}
},
+ "node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
"node_modules/ansi-colors": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
@@ -974,12 +1636,13 @@
}
},
"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",
"dependencies": {
- "fill-range": "^7.0.1"
+ "fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
@@ -1024,15 +1687,6 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
- "node_modules/builtin-modules": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
- "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
@@ -1068,6 +1722,16 @@
"node": ">=8"
}
},
+ "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",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@@ -1412,12 +2076,6 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
- "node_modules/commander": {
- "version": "2.20.3",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
- "dev": true
- },
"node_modules/commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -1550,6 +2208,13 @@
"node": ">=6"
}
},
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "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"
+ },
"node_modules/default-require-extensions": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz",
@@ -1614,96 +2279,435 @@
"integrity": "sha1-Qe9KXy0DZCmDurtPZKS1drEVUhU=",
"dev": true,
"dependencies": {
- "chalk": "^1.1.1",
- "elegant-spinner": "^1.0.1",
- "log-update": "^1.0.2",
- "os-family": "^1.0.0"
+ "chalk": "^1.1.1",
+ "elegant-spinner": "^1.0.1",
+ "log-update": "^1.0.2",
+ "os-family": "^1.0.0"
+ }
+ },
+ "node_modules/elegant-status/node_modules/ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/elegant-status/node_modules/ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/elegant-status/node_modules/chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/elegant-status/node_modules/strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/elegant-status/node_modules/supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "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
+ },
+ "node_modules/es6-error": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
+ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
+ "dev": true
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "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": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "9.13.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz",
+ "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@eslint-community/regexpp": "^4.11.0",
+ "@eslint/config-array": "^0.18.0",
+ "@eslint/core": "^0.7.0",
+ "@eslint/eslintrc": "^3.1.0",
+ "@eslint/js": "9.13.0",
+ "@eslint/plugin-kit": "^0.2.0",
+ "@humanfs/node": "^0.16.5",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@humanwhocodes/retry": "^0.3.1",
+ "@types/estree": "^1.0.6",
+ "@types/json-schema": "^7.0.15",
+ "ajv": "^6.12.4",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
+ "debug": "^4.3.2",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^8.1.0",
+ "eslint-visitor-keys": "^4.1.0",
+ "espree": "^10.2.0",
+ "esquery": "^1.5.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^8.0.0",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "ignore": "^5.2.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.3",
+ "text-table": "^0.2.0"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ }
+ }
+ },
+ "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==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "eslint-config-prettier": "bin/cli.js"
+ },
+ "peerDependencies": {
+ "eslint": ">=7.0.0"
+ }
+ },
+ "node_modules/eslint-plugin-prettier": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz",
+ "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prettier-linter-helpers": "^1.0.0",
+ "synckit": "^0.9.1"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint-plugin-prettier"
+ },
+ "peerDependencies": {
+ "@types/eslint": ">=8.0.0",
+ "eslint": ">=8.0.0",
+ "eslint-config-prettier": "*",
+ "prettier": ">=3.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/eslint": {
+ "optional": true
+ },
+ "eslint-config-prettier": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-plugin-simple-import-sort": {
+ "version": "12.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz",
+ "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "eslint": ">=5.0.0"
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
+ "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "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",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "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"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/eslint/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",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/eslint/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"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/eslint/node_modules/color-name": {
+ "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,
+ "license": "MIT"
+ },
+ "node_modules/eslint/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "node_modules/elegant-status/node_modules/ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+ "node_modules/eslint/node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
+ "license": "MIT",
"engines": {
- "node": ">=0.10.0"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/elegant-status/node_modules/ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "node_modules/eslint/node_modules/eslint-visitor-keys": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+ "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
"dev": true,
+ "license": "Apache-2.0",
"engines": {
- "node": ">=0.10.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/elegant-status/node_modules/chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "node_modules/eslint/node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
"dev": true,
+ "license": "ISC",
"dependencies": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
+ "is-glob": "^4.0.3"
},
"engines": {
- "node": ">=0.10.0"
+ "node": ">=10.13.0"
}
},
- "node_modules/elegant-status/node_modules/strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "node_modules/eslint/node_modules/ms": {
+ "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"
+ },
+ "node_modules/espree": {
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
+ "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
"dependencies": {
- "ansi-regex": "^2.0.0"
+ "acorn": "^8.14.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.0"
},
"engines": {
- "node": ">=0.10.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/elegant-status/node_modules/supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "node_modules/espree/node_modules/eslint-visitor-keys": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+ "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
"dev": true,
+ "license": "Apache-2.0",
"engines": {
- "node": ">=0.8.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "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
+ "node_modules/esquery": {
+ "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",
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
},
- "node_modules/es6-error": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
- "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
- "dev": true
+ "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",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
},
- "node_modules/escalade": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
- "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true,
- "license": "MIT",
+ "license": "BSD-2-Clause",
"engines": {
- "node": ">=6"
+ "node": ">=4.0"
}
},
- "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": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true,
+ "license": "BSD-2-Clause",
"engines": {
- "node": ">=0.8.0"
+ "node": ">=0.10.0"
}
},
"node_modules/exit-hook": {
@@ -1928,6 +2932,75 @@
"node": ">=0.10.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"
+ },
+ "node_modules/fast-diff": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
+ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
+ "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==",
+ "dev": true,
+ "license": "MIT",
+ "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"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-glob/node_modules/micromatch": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "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"
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fastq": {
+ "version": "1.17.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
+ "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
"node_modules/figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
@@ -1940,11 +3013,25 @@
"node": ">=4"
}
},
+ "node_modules/file-entry-cache": {
+ "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",
+ "dependencies": {
+ "flat-cache": "^4.0.0"
+ },
+ "engines": {
+ "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",
"dependencies": {
"to-regex-range": "^5.0.1"
},
@@ -1994,6 +3081,27 @@
"flat": "cli.js"
}
},
+ "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",
+ "dependencies": {
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.4"
+ },
+ "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==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/for-in": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
@@ -2068,12 +3176,6 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
- "node_modules/function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
- },
"node_modules/gensync": {
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
@@ -2169,17 +3271,12 @@
"integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==",
"dev": true
},
- "node_modules/has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "node_modules/graphemer": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
+ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true,
- "dependencies": {
- "function-bind": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4.0"
- }
+ "license": "MIT"
},
"node_modules/has-ansi": {
"version": "2.0.0",
@@ -2202,6 +3299,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/has-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
@@ -2284,6 +3391,43 @@
"node": ">=0.10.0"
}
},
+ "node_modules/ignore": {
+ "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",
+ "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==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/import-fresh/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",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@@ -2384,18 +3528,6 @@
"is-ci": "bin.js"
}
},
- "node_modules/is-core-module": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz",
- "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
- "dev": true,
- "dependencies": {
- "has": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/is-data-descriptor": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
@@ -2669,27 +3801,6 @@
"node": ">=8"
}
},
- "node_modules/istanbul-lib-report/node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/istanbul-lib-report/node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"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",
@@ -2803,13 +3914,34 @@
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
"integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
"dev": true,
- "license": "MIT",
- "bin": {
- "jsesc": "bin/jsesc"
- },
- "engines": {
- "node": ">=6"
- }
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "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,
+ "license": "MIT"
+ },
+ "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"
+ },
+ "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"
},
"node_modules/json5": {
"version": "2.2.3",
@@ -2831,6 +3963,16 @@
"dev": true,
"license": "MIT"
},
+ "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,
+ "license": "MIT",
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -2840,6 +3982,20 @@
"node": ">=0.10.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==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
"node_modules/locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
@@ -2874,6 +4030,13 @@
"dev": true,
"license": "MIT"
},
+ "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"
+ },
"node_modules/lodash.toarray": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
@@ -2998,6 +4161,16 @@
"node": ">=0.10.0"
}
},
+ "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",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
"node_modules/micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@@ -3125,15 +4298,6 @@
"node": "*"
}
},
- "node_modules/minimist": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
- "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
@@ -3157,18 +4321,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/mkdirp": {
- "version": "0.5.5",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
- "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
- "dev": true,
- "dependencies": {
- "minimist": "^1.2.5"
- },
- "bin": {
- "mkdirp": "bin/cmd.js"
- }
- },
"node_modules/mocha": {
"version": "10.7.3",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz",
@@ -3333,15 +4485,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/mocha/node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/mocha/node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -3438,6 +4581,13 @@
"node": ">=0.10.0"
}
},
+ "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,
+ "license": "MIT"
+ },
"node_modules/nise": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz",
@@ -3918,6 +5068,24 @@
"node": ">=4"
}
},
+ "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",
+ "dependencies": {
+ "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/os-family": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/os-family/-/os-family-1.1.0.tgz",
@@ -4025,6 +5193,19 @@
"dev": true,
"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",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/pascalcase": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
@@ -4061,12 +5242,6 @@
"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
- },
"node_modules/path-scurry": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
@@ -4227,6 +5402,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
"node_modules/prettier": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
@@ -4243,6 +5428,19 @@
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
+ "node_modules/prettier-linter-helpers": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
+ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-diff": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/process-on-spawn": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz",
@@ -4345,6 +5543,37 @@
"node": ">=4"
}
},
+ "node_modules/punycode": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
"node_modules/randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@@ -4432,23 +5661,6 @@
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"dev": true
},
- "node_modules/resolve": {
- "version": "1.22.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
- "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
- "dev": true,
- "dependencies": {
- "is-core-module": "^2.8.1",
- "path-parse": "^1.0.7",
- "supports-preserve-symlinks-flag": "^1.0.0"
- },
- "bin": {
- "resolve": "bin/resolve"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@@ -4487,6 +5699,17 @@
"node": ">=0.12"
}
},
+ "node_modules/reusify": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/rimraf": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz",
@@ -4596,6 +5819,30 @@
"node": ">=0.12.0"
}
},
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
"node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
@@ -4768,27 +6015,6 @@
"node": ">=0.3.1"
}
},
- "node_modules/sinon/node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sinon/node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -5274,18 +6500,43 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/supports-preserve-symlinks-flag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
- "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "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",
+ "dependencies": {
+ "@pkgr/core": "^0.1.0",
+ "tslib": "^2.6.2"
+ },
"engines": {
- "node": ">= 0.4"
+ "node": "^14.18.0 || >=16.0.0"
},
"funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "url": "https://opencollective.com/unts"
}
},
+ "node_modules/synckit/node_modules/tslib": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz",
+ "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==",
+ "dev": true,
+ "license": "0BSD"
+ },
"node_modules/test-exclude": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
@@ -5300,6 +6551,13 @@
"node": ">=8"
}
},
+ "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,
+ "license": "MIT"
+ },
"node_modules/through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@@ -5360,6 +6618,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",
"dependencies": {
"is-number": "^7.0.0"
},
@@ -5372,10 +6631,24 @@
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
+ "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==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.2.0"
+ }
+ },
"node_modules/ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
@@ -5420,18 +6693,6 @@
}
}
},
- "node_modules/ts-node/node_modules/acorn": {
- "version": "8.7.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
- "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
"node_modules/ts-node/node_modules/acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
@@ -5456,65 +6717,17 @@
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
- "node_modules/tslint": {
- "version": "6.1.3",
- "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz",
- "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==",
- "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.",
+ "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",
"dependencies": {
- "@babel/code-frame": "^7.0.0",
- "builtin-modules": "^1.1.1",
- "chalk": "^2.3.0",
- "commander": "^2.12.1",
- "diff": "^4.0.1",
- "glob": "^7.1.1",
- "js-yaml": "^3.13.1",
- "minimatch": "^3.0.4",
- "mkdirp": "^0.5.3",
- "resolve": "^1.3.2",
- "semver": "^5.3.0",
- "tslib": "^1.13.0",
- "tsutils": "^2.29.0"
+ "prelude-ls": "^1.2.1"
},
- "bin": {
- "tslint": "bin/tslint"
- },
- "engines": {
- "node": ">=4.8.0"
- },
- "peerDependencies": {
- "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev"
- }
- },
- "node_modules/tslint/node_modules/diff": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
- "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
- "dev": true,
"engines": {
- "node": ">=0.3.1"
- }
- },
- "node_modules/tslint/node_modules/semver": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
- "dev": true,
- "bin": {
- "semver": "bin/semver"
- }
- },
- "node_modules/tsutils": {
- "version": "2.29.0",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
- "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
- "dev": true,
- "dependencies": {
- "tslib": "^1.8.1"
- },
- "peerDependencies": {
- "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev"
+ "node": ">= 0.8.0"
}
},
"node_modules/type-detect": {
@@ -5558,6 +6771,30 @@
"node": ">=14.17"
}
},
+ "node_modules/typescript-eslint": {
+ "version": "8.12.2",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.12.2.tgz",
+ "integrity": "sha512-UbuVUWSrHVR03q9CWx+JDHeO6B/Hr9p4U5lRH++5tq/EbFq1faYZe50ZSBePptgfIKLEti0aPQ3hFgnPVcd8ZQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/eslint-plugin": "8.12.2",
+ "@typescript-eslint/parser": "8.12.2",
+ "@typescript-eslint/utils": "8.12.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
@@ -5674,6 +6911,16 @@
"node": ">=18"
}
},
+ "node_modules/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
"node_modules/urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
@@ -5724,6 +6971,16 @@
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
+ "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",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/workerpool": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz",
diff --git a/package.json b/package.json
index 455a54288..ff12b2e1e 100644
--- a/package.json
+++ b/package.json
@@ -5,10 +5,17 @@
},
"description": "A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.",
"devDependencies": {
+ "@eslint/js": "9.13.0",
"@types/chai": "4.3.6",
"@types/mocha": "10.0.9",
"@types/sinon": "17.0.3",
+ "@typescript-eslint/eslint-plugin": "8.12.2",
+ "@typescript-eslint/parser": "8.12.2",
"chai": "4.3.8",
+ "eslint": "9.13.0",
+ "eslint-config-prettier": "9.1.0",
+ "eslint-plugin-prettier": "5.2.1",
+ "eslint-plugin-simple-import-sort": "12.1.1",
"mocha": "10.7.3",
"nyc": "17.1.0",
"prettier": "3.3.3",
@@ -17,8 +24,8 @@
"rimraf": "6.0.1",
"sinon": "19.0.2",
"ts-node": "10.9.2",
- "tslint": "6.1.3",
"typescript": "5.6.3",
+ "typescript-eslint": "8.12.2",
"updates": "16.4.0"
},
"engines": {},
@@ -49,10 +56,10 @@
"build:es6": "tsc -p src/tsconfig-es6.json",
"build:lib": "tsc -p src/tsconfig.json",
"clean": "rimraf amd es es6 lib",
- "format": "prettier --write ./src/*.ts ./src/**/*.ts",
+ "format": "prettier --write ./src/*.ts ./src/**/*.ts ./test/*.ts ./test/**/*.ts",
+ "lint": "eslint ./src ./test",
"postupdate": "git diff-files --quiet package-lock.json || npm test",
"prepublish": "npm run build && publish-please guard",
- "pretest": "tslint --project .",
"publish-please": "publish-please",
"test": "nyc --reporter=lcov --require ts-node/register mocha test/**/*.test.ts --reporter spec --retries 3 --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"update": "updates --update --minor && npm install"
diff --git a/prettier.config.mjs b/prettier.config.mjs
index dabd894d8..69c1a7331 100644
--- a/prettier.config.mjs
+++ b/prettier.config.mjs
@@ -5,7 +5,7 @@ export default {
semi: true,
singleQuote: true,
bracketSpacing: true,
- arrowParens: "always",
- endOfLine: "lf",
- trailingComma: "all",
+ arrowParens: 'always',
+ endOfLine: 'lf',
+ trailingComma: 'all',
};
diff --git a/src/annotation/decorator_utils.ts b/src/annotation/decorator_utils.ts
index ba45791dd..cf10ada31 100644
--- a/src/annotation/decorator_utils.ts
+++ b/src/annotation/decorator_utils.ts
@@ -3,10 +3,10 @@ import * as METADATA_KEY from '../constants/metadata_keys';
import { interfaces } from '../interfaces/interfaces';
import { getFirstArrayDuplicate } from '../utils/js';
-function targetIsConstructorFunction(
+function targetIsConstructorFunction(
target: DecoratorTarget,
): target is ConstructorFunction {
- return (target as ConstructorFunction).prototype !== undefined;
+ return (target as Partial>).prototype !== undefined;
}
type Prototype = {
@@ -16,8 +16,8 @@ type Prototype = {
} & { constructor: NewableFunction };
interface ConstructorFunction> {
- new (...args: unknown[]): T;
prototype: Prototype;
+ new (...args: unknown[]): T;
}
export type DecoratorTarget =
@@ -69,7 +69,10 @@ function _ensureNoMetadataKeyDuplicates(
let metadatas: interfaces.Metadata[] = [];
if (Array.isArray(metadata)) {
metadatas = metadata;
- const duplicate = getFirstArrayDuplicate(metadatas.map((md) => md.key));
+ const duplicate: string | number | symbol | undefined =
+ getFirstArrayDuplicate(
+ metadatas.map((md: interfaces.Metadata) => md.key),
+ );
if (duplicate !== undefined) {
throw new Error(
`${ERROR_MSGS.DUPLICATED_METADATA} ${duplicate.toString()}`,
@@ -99,17 +102,17 @@ function _tagParameterOrProperty(
paramsOrPropertiesMetadata = Reflect.getMetadata(
metadataKey,
annotationTarget,
- );
+ ) as interfaces.MetadataMap;
}
let paramOrPropertyMetadata: interfaces.Metadata[] | undefined =
- paramsOrPropertiesMetadata[key as string];
+ paramsOrPropertiesMetadata[key];
if (paramOrPropertyMetadata === undefined) {
paramOrPropertyMetadata = [];
} else {
for (const m of paramOrPropertyMetadata) {
- if (metadatas.some((md) => md.key === m.key)) {
+ if (metadatas.some((md: interfaces.Metadata) => md.key === m.key)) {
throw new Error(
`${ERROR_MSGS.DUPLICATED_METADATA} ${m.key.toString()}`,
);
diff --git a/src/annotation/inject.ts b/src/annotation/inject.ts
index 392c85df0..c6702efca 100644
--- a/src/annotation/inject.ts
+++ b/src/annotation/inject.ts
@@ -1,6 +1,14 @@
import * as METADATA_KEY from '../constants/metadata_keys';
+import { DecoratorTarget } from './decorator_utils';
import { injectBase } from './inject_base';
+import { ServiceIdentifierOrFunc } from './lazy_service_identifier';
-const inject = injectBase(METADATA_KEY.INJECT_TAG);
+const inject: (
+ serviceIdentifier: ServiceIdentifierOrFunc,
+) => (
+ target: DecoratorTarget,
+ targetKey?: string | symbol,
+ indexOrPropertyDescriptor?: number | TypedPropertyDescriptor,
+) => void = injectBase(METADATA_KEY.INJECT_TAG);
export { inject };
diff --git a/src/annotation/inject_base.ts b/src/annotation/inject_base.ts
index ff5536d36..dc8d71444 100644
--- a/src/annotation/inject_base.ts
+++ b/src/annotation/inject_base.ts
@@ -3,22 +3,34 @@ import { Metadata } from '../planning/metadata';
import { createTaggedDecorator, DecoratorTarget } from './decorator_utils';
import { ServiceIdentifierOrFunc } from './lazy_service_identifier';
-export function injectBase(metadataKey: string) {
+export function injectBase(
+ metadataKey: string,
+): (
+ serviceIdentifier: ServiceIdentifierOrFunc,
+) => (
+ target: DecoratorTarget,
+ targetKey?: string | symbol,
+ indexOrPropertyDescriptor?: number | TypedPropertyDescriptor,
+) => void {
return (serviceIdentifier: ServiceIdentifierOrFunc) => {
return (
target: DecoratorTarget,
targetKey?: string | symbol,
indexOrPropertyDescriptor?: number | TypedPropertyDescriptor,
) => {
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (serviceIdentifier === undefined) {
- const className =
+ const className: string =
typeof target === 'function' ? target.name : target.constructor.name;
throw new Error(UNDEFINED_INJECT_ANNOTATION(className));
}
- return createTaggedDecorator(
- new Metadata(metadataKey, serviceIdentifier),
- )(target, targetKey, indexOrPropertyDescriptor);
+
+ createTaggedDecorator(new Metadata(metadataKey, serviceIdentifier))(
+ target,
+ targetKey,
+ indexOrPropertyDescriptor,
+ );
};
};
}
diff --git a/src/annotation/injectable.ts b/src/annotation/injectable.ts
index 6d0d66f40..7cfd8f255 100644
--- a/src/annotation/injectable.ts
+++ b/src/annotation/injectable.ts
@@ -2,6 +2,7 @@ import * as ERRORS_MSGS from '../constants/error_msgs';
import * as METADATA_KEY from '../constants/metadata_keys';
function injectable() {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
return function unknown>(
target: T,
) {
@@ -9,8 +10,10 @@ function injectable() {
throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
}
- const types =
- Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
+ const types: NewableFunction[] =
+ (Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) as
+ | NewableFunction[]
+ | undefined) || [];
Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
return target;
diff --git a/src/annotation/lazy_service_identifier.ts b/src/annotation/lazy_service_identifier.ts
index 53f28e4a8..aa8317a0f 100644
--- a/src/annotation/lazy_service_identifier.ts
+++ b/src/annotation/lazy_service_identifier.ts
@@ -5,8 +5,8 @@ export type ServiceIdentifierOrFunc =
| LazyServiceIdentifier;
export class LazyServiceIdentifier {
- private _cb: () => interfaces.ServiceIdentifier;
- public constructor(cb: () => interfaces.ServiceIdentifier) {
+ private readonly _cb: () => interfaces.ServiceIdentifier;
+ constructor(cb: () => interfaces.ServiceIdentifier) {
this._cb = cb;
}
diff --git a/src/annotation/multi_inject.ts b/src/annotation/multi_inject.ts
index ec234781b..ad32a81db 100644
--- a/src/annotation/multi_inject.ts
+++ b/src/annotation/multi_inject.ts
@@ -1,6 +1,14 @@
import * as METADATA_KEY from '../constants/metadata_keys';
+import { DecoratorTarget } from './decorator_utils';
import { injectBase } from './inject_base';
+import { ServiceIdentifierOrFunc } from './lazy_service_identifier';
-const multiInject = injectBase(METADATA_KEY.MULTI_INJECT_TAG);
+const multiInject: (
+ serviceIdentifier: ServiceIdentifierOrFunc,
+) => (
+ target: DecoratorTarget,
+ targetKey?: string | symbol,
+ indexOrPropertyDescriptor?: number | TypedPropertyDescriptor,
+) => void = injectBase(METADATA_KEY.MULTI_INJECT_TAG);
export { multiInject };
diff --git a/src/annotation/post_construct.ts b/src/annotation/post_construct.ts
index 77d825694..7dc0ffc17 100644
--- a/src/annotation/post_construct.ts
+++ b/src/annotation/post_construct.ts
@@ -2,7 +2,12 @@ import * as ERRORS_MSGS from '../constants/error_msgs';
import * as METADATA_KEY from '../constants/metadata_keys';
import { propertyEventDecorator } from './property_event_decorator';
-const postConstruct = propertyEventDecorator(
+const postConstruct: () => (
+ target: {
+ constructor: NewableFunction;
+ },
+ propertyKey: string,
+) => void = propertyEventDecorator(
METADATA_KEY.POST_CONSTRUCT,
ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS,
);
diff --git a/src/annotation/pre_destroy.ts b/src/annotation/pre_destroy.ts
index ded1713b6..88bec0947 100644
--- a/src/annotation/pre_destroy.ts
+++ b/src/annotation/pre_destroy.ts
@@ -2,7 +2,12 @@ import * as ERRORS_MSGS from '../constants/error_msgs';
import * as METADATA_KEY from '../constants/metadata_keys';
import { propertyEventDecorator } from './property_event_decorator';
-const preDestroy = propertyEventDecorator(
+const preDestroy: () => (
+ target: {
+ constructor: NewableFunction;
+ },
+ propertyKey: string,
+) => void = propertyEventDecorator(
METADATA_KEY.PRE_DESTROY,
ERRORS_MSGS.MULTIPLE_PRE_DESTROY_METHODS,
);
diff --git a/src/annotation/property_event_decorator.ts b/src/annotation/property_event_decorator.ts
index 8f1c4b675..b1fa95679 100644
--- a/src/annotation/property_event_decorator.ts
+++ b/src/annotation/property_event_decorator.ts
@@ -3,7 +3,7 @@ import { Metadata } from '../planning/metadata';
function propertyEventDecorator(eventKey: string, errorMessage: string) {
return () => {
return (target: { constructor: NewableFunction }, propertyKey: string) => {
- const metadata = new Metadata(eventKey, propertyKey);
+ const metadata: Metadata = new Metadata(eventKey, propertyKey);
if (Reflect.hasOwnMetadata(eventKey, target.constructor)) {
throw new Error(errorMessage);
diff --git a/src/annotation/tagged.ts b/src/annotation/tagged.ts
index 32431f483..465428ff3 100644
--- a/src/annotation/tagged.ts
+++ b/src/annotation/tagged.ts
@@ -2,10 +2,7 @@ import { Metadata } from '../planning/metadata';
import { createTaggedDecorator } from './decorator_utils';
// Used to add custom metadata which is used to resolve metadata-based contextual bindings.
-function tagged(
- metadataKey: string | number | symbol,
- metadataValue: unknown,
-) {
+function tagged(metadataKey: string | number | symbol, metadataValue: unknown) {
return createTaggedDecorator(new Metadata(metadataKey, metadataValue));
}
diff --git a/src/annotation/target_name.ts b/src/annotation/target_name.ts
index d639cf661..a0e59ea73 100644
--- a/src/annotation/target_name.ts
+++ b/src/annotation/target_name.ts
@@ -1,6 +1,6 @@
import * as METADATA_KEY from '../constants/metadata_keys';
import { Metadata } from '../planning/metadata';
-import { tagParameter, DecoratorTarget } from './decorator_utils';
+import { DecoratorTarget, tagParameter } from './decorator_utils';
function targetName(name: string) {
return function (
@@ -8,7 +8,7 @@ function targetName(name: string) {
targetKey: string | undefined,
index: number,
) {
- const metadata = new Metadata(METADATA_KEY.NAME_TAG, name);
+ const metadata: Metadata = new Metadata(METADATA_KEY.NAME_TAG, name);
tagParameter(target, targetKey, index, metadata);
};
}
diff --git a/src/annotation/unmanaged.ts b/src/annotation/unmanaged.ts
index 465f049c7..a9f2415b0 100644
--- a/src/annotation/unmanaged.ts
+++ b/src/annotation/unmanaged.ts
@@ -1,6 +1,6 @@
import * as METADATA_KEY from '../constants/metadata_keys';
import { Metadata } from '../planning/metadata';
-import { tagParameter, DecoratorTarget } from './decorator_utils';
+import { DecoratorTarget, tagParameter } from './decorator_utils';
function unmanaged() {
return function (
@@ -8,7 +8,7 @@ function unmanaged() {
targetKey: string | undefined,
index: number,
) {
- const metadata = new Metadata(METADATA_KEY.UNMANAGED_TAG, true);
+ const metadata: Metadata = new Metadata(METADATA_KEY.UNMANAGED_TAG, true);
tagParameter(target, targetKey, index, metadata);
};
}
diff --git a/src/bindings/binding.ts b/src/bindings/binding.ts
index 49984dcd2..98468791b 100644
--- a/src/bindings/binding.ts
+++ b/src/bindings/binding.ts
@@ -44,7 +44,7 @@ class Binding implements interfaces.Binding {
// On deactivation handler (invoked just before an instance is unbinded and removed from container)
public onDeactivation: interfaces.BindingDeactivation | null;
- public constructor(
+ constructor(
serviceIdentifier: interfaces.ServiceIdentifier,
scope: interfaces.BindingScope,
) {
@@ -53,7 +53,7 @@ class Binding implements interfaces.Binding {
this.serviceIdentifier = serviceIdentifier;
this.scope = scope;
this.type = BindingTypeEnum.Invalid;
- this.constraint = (request: interfaces.Request | null) => true;
+ this.constraint = (_request: interfaces.Request | null) => true;
this.implementationType = null;
this.cache = null;
this.factory = null;
@@ -64,7 +64,10 @@ class Binding implements interfaces.Binding {
}
public clone(): interfaces.Binding {
- const clone = new Binding(this.serviceIdentifier, this.scope);
+ const clone: Binding = new Binding(
+ this.serviceIdentifier,
+ this.scope,
+ );
clone.activated =
clone.scope === BindingScopeEnum.Singleton ? this.activated : false;
clone.implementationType = this.implementationType;
diff --git a/src/bindings/binding_count.ts b/src/bindings/binding_count.ts
index 8697ea88c..ee9e81df8 100644
--- a/src/bindings/binding_count.ts
+++ b/src/bindings/binding_count.ts
@@ -1,5 +1,5 @@
-export const BindingCount = {
- MultipleBindingsAvailable: 2,
- NoBindingsAvailable: 0,
- OnlyOneBindingAvailable: 1,
-};
+export enum BindingCount {
+ MultipleBindingsAvailable = 2,
+ NoBindingsAvailable = 0,
+ OnlyOneBindingAvailable = 1,
+}
diff --git a/src/constants/error_msgs.ts b/src/constants/error_msgs.ts
index b628b567e..cd8ba8b0b 100644
--- a/src/constants/error_msgs.ts
+++ b/src/constants/error_msgs.ts
@@ -1,81 +1,96 @@
-export const DUPLICATED_INJECTABLE_DECORATOR =
+export const DUPLICATED_INJECTABLE_DECORATOR: string =
'Cannot apply @injectable decorator multiple times.';
-export const DUPLICATED_METADATA =
+export const DUPLICATED_METADATA: string =
'Metadata key was used more than once in a parameter:';
-export const NULL_ARGUMENT = 'NULL argument';
-export const KEY_NOT_FOUND = 'Key Not Found';
-export const AMBIGUOUS_MATCH = 'Ambiguous match found for serviceIdentifier:';
-export const CANNOT_UNBIND = 'Could not unbind serviceIdentifier:';
-export const NOT_REGISTERED =
+export const NULL_ARGUMENT: string = 'NULL argument';
+export const KEY_NOT_FOUND: string = 'Key Not Found';
+export const AMBIGUOUS_MATCH: string =
+ 'Ambiguous match found for serviceIdentifier:';
+export const CANNOT_UNBIND: string = 'Could not unbind serviceIdentifier:';
+export const NOT_REGISTERED: string =
'No matching bindings found for serviceIdentifier:';
-export const MISSING_INJECTABLE_ANNOTATION =
+export const MISSING_INJECTABLE_ANNOTATION: string =
'Missing required @injectable annotation in:';
-export const MISSING_INJECT_ANNOTATION =
+export const MISSING_INJECT_ANNOTATION: string =
'Missing required @inject or @multiInject annotation in:';
-export const UNDEFINED_INJECT_ANNOTATION = (name: string) =>
+export const UNDEFINED_INJECT_ANNOTATION: (name: string) => string = (
+ name: string,
+) =>
`@inject called with undefined this could mean that the class ${name} has ` +
'a circular dependency problem. You can use a LazyServiceIdentifer to ' +
'overcome this limitation.';
-export const CIRCULAR_DEPENDENCY = 'Circular dependency found:';
-export const NOT_IMPLEMENTED =
+export const CIRCULAR_DEPENDENCY: string = 'Circular dependency found:';
+export const NOT_IMPLEMENTED: string =
'Sorry, this feature is not fully implemented yet.';
-export const INVALID_BINDING_TYPE = 'Invalid binding type:';
-export const NO_MORE_SNAPSHOTS_AVAILABLE = 'No snapshot available to restore.';
-export const INVALID_MIDDLEWARE_RETURN =
+export const INVALID_BINDING_TYPE: string = 'Invalid binding type:';
+export const NO_MORE_SNAPSHOTS_AVAILABLE: string =
+ 'No snapshot available to restore.';
+export const INVALID_MIDDLEWARE_RETURN: string =
'Invalid return type in middleware. Middleware must return!';
-export const INVALID_FUNCTION_BINDING =
+export const INVALID_FUNCTION_BINDING: string =
'Value provided to function binding must be a function!';
-export const LAZY_IN_SYNC = (key: unknown) =>
+export const LAZY_IN_SYNC: (key: unknown) => string = (key: unknown) =>
`You are attempting to construct ${keyToString(key)} in a synchronous way ` +
'but it has asynchronous dependencies.';
-export const INVALID_TO_SELF_VALUE =
+export const INVALID_TO_SELF_VALUE: string =
'The toSelf function can only be applied when a constructor is ' +
'used as service identifier';
-export const INVALID_DECORATOR_OPERATION =
+export const INVALID_DECORATOR_OPERATION: string =
'The @inject @multiInject @tagged and @named decorators ' +
'must be applied to the parameters of a class constructor or a class property.';
-export const ARGUMENTS_LENGTH_MISMATCH = (...values: unknown[]) =>
+export const ARGUMENTS_LENGTH_MISMATCH: (name: string) => string = (
+ name: string,
+) =>
'The number of constructor arguments in the derived class ' +
- `${values[0]} must be >= than the number of constructor arguments of its base class.`;
+ `${name} must be >= than the number of constructor arguments of its base class.`;
-export const CONTAINER_OPTIONS_MUST_BE_AN_OBJECT =
+export const CONTAINER_OPTIONS_MUST_BE_AN_OBJECT: string =
'Invalid Container constructor argument. Container options ' +
'must be an object.';
-export const CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE =
+export const CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE: string =
'Invalid Container option. Default scope must ' +
'be a string ("singleton" or "transient").';
-export const CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE =
+export const CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE: string =
'Invalid Container option. Auto bind injectable must ' + 'be a boolean';
-export const CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK =
+export const CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK: string =
'Invalid Container option. Skip base check must ' + 'be a boolean';
-export const MULTIPLE_PRE_DESTROY_METHODS =
+export const MULTIPLE_PRE_DESTROY_METHODS: string =
'Cannot apply @preDestroy decorator multiple times in the same class';
-export const MULTIPLE_POST_CONSTRUCT_METHODS =
+export const MULTIPLE_POST_CONSTRUCT_METHODS: string =
'Cannot apply @postConstruct decorator multiple times in the same class';
-export const ASYNC_UNBIND_REQUIRED =
+export const ASYNC_UNBIND_REQUIRED: string =
'Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)';
-export const POST_CONSTRUCT_ERROR = (clazz: string, errorMessage: string) =>
+export const POST_CONSTRUCT_ERROR: (
+ clazz: string,
+ errorMessage: string,
+) => string = (clazz: string, errorMessage: string): string =>
`@postConstruct error in class ${clazz}: ${errorMessage}`;
-export const PRE_DESTROY_ERROR = (clazz: string, errorMessage: string) =>
+export const PRE_DESTROY_ERROR: (
+ clazz: string,
+ errorMessage: string,
+) => string = (clazz: string, errorMessage: string): string =>
`@preDestroy error in class ${clazz}: ${errorMessage}`;
-export const ON_DEACTIVATION_ERROR = (clazz: string, errorMessage: string) =>
+export const ON_DEACTIVATION_ERROR: (
+ clazz: string,
+ errorMessage: string,
+) => string = (clazz: string, errorMessage: string): string =>
`onDeactivation() error in class ${clazz}: ${errorMessage}`;
-export const CIRCULAR_DEPENDENCY_IN_FACTORY = (
+export const CIRCULAR_DEPENDENCY_IN_FACTORY: (
factoryType: string,
serviceIdentifier: string,
-) =>
+) => string = (factoryType: string, serviceIdentifier: string): string =>
`It looks like there is a circular dependency in one of the '${factoryType}' bindings. Please investigate bindings with ` +
`service identifier '${serviceIdentifier}'.`;
-export const STACK_OVERFLOW = 'Maximum call stack size exceeded';
+export const STACK_OVERFLOW: string = 'Maximum call stack size exceeded';
function keyToString(key: unknown): string {
if (typeof key === 'function') {
@@ -84,5 +99,6 @@ function keyToString(key: unknown): string {
if (typeof key === 'symbol') {
return key.toString();
}
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return `'${key}'`;
}
diff --git a/src/constants/literal_types.ts b/src/constants/literal_types.ts
index 10ab76ce8..6319087dd 100644
--- a/src/constants/literal_types.ts
+++ b/src/constants/literal_types.ts
@@ -1,11 +1,13 @@
import { interfaces } from '../interfaces/interfaces';
+// eslint-disable-next-line @typescript-eslint/naming-convention
const BindingScopeEnum: interfaces.BindingScopeEnum = {
Request: 'Request',
Singleton: 'Singleton',
Transient: 'Transient',
};
+// eslint-disable-next-line @typescript-eslint/naming-convention
const BindingTypeEnum: interfaces.BindingTypeEnum = {
ConstantValue: 'ConstantValue',
Constructor: 'Constructor',
@@ -17,6 +19,7 @@ const BindingTypeEnum: interfaces.BindingTypeEnum = {
Provider: 'Provider',
};
+// eslint-disable-next-line @typescript-eslint/naming-convention
const TargetTypeEnum: interfaces.TargetTypeEnum = {
ClassProperty: 'ClassProperty',
ConstructorArgument: 'ConstructorArgument',
diff --git a/src/constants/metadata_keys.ts b/src/constants/metadata_keys.ts
index f6e7b55ec..1589adf63 100644
--- a/src/constants/metadata_keys.ts
+++ b/src/constants/metadata_keys.ts
@@ -1,38 +1,38 @@
// Used for named bindings
-export const NAMED_TAG = 'named';
+export const NAMED_TAG: string = 'named';
// The name of the target at design time
-export const NAME_TAG = 'name';
+export const NAME_TAG: string = 'name';
// The for unmanaged injections (in base classes when using inheritance)
-export const UNMANAGED_TAG = 'unmanaged';
+export const UNMANAGED_TAG: string = 'unmanaged';
// The for optional injections
-export const OPTIONAL_TAG = 'optional';
+export const OPTIONAL_TAG: string = 'optional';
// The type of the binding at design time
-export const INJECT_TAG = 'inject';
+export const INJECT_TAG: string = 'inject';
// The type of the binding at design type for multi-injections
-export const MULTI_INJECT_TAG = 'multi_inject';
+export const MULTI_INJECT_TAG: string = 'multi_inject';
// used to store constructor arguments tags
-export const TAGGED = 'inversify:tagged';
+export const TAGGED: string = 'inversify:tagged';
// used to store class properties tags
-export const TAGGED_PROP = 'inversify:tagged_props';
+export const TAGGED_PROP: string = 'inversify:tagged_props';
// used to store types to be injected
-export const PARAM_TYPES = 'inversify:paramtypes';
+export const PARAM_TYPES: string = 'inversify:paramtypes';
// used to access design time types
-export const DESIGN_PARAM_TYPES = 'design:paramtypes';
+export const DESIGN_PARAM_TYPES: string = 'design:paramtypes';
// used to identify postConstruct functions
-export const POST_CONSTRUCT = 'post_construct';
+export const POST_CONSTRUCT: string = 'post_construct';
// used to identify preDestroy functions
-export const PRE_DESTROY = 'pre_destroy';
+export const PRE_DESTROY: string = 'pre_destroy';
function getNonCustomTagKeys(): string[] {
return [
diff --git a/src/container/container.ts b/src/container/container.ts
index 40b194d7f..22c800206 100644
--- a/src/container/container.ts
+++ b/src/container/container.ts
@@ -35,46 +35,14 @@ class Container implements interfaces.Container {
private _deactivations: interfaces.Lookup<
interfaces.BindingDeactivation
>;
- private _snapshots: interfaces.ContainerSnapshot[];
+ private readonly _snapshots: interfaces.ContainerSnapshot[];
private _metadataReader: interfaces.MetadataReader;
private _moduleActivationStore: interfaces.ModuleActivationStore;
- public static merge(
- container1: interfaces.Container,
- container2: interfaces.Container,
- ...containers: interfaces.Container[]
- ): interfaces.Container {
- const container = new Container();
- const targetContainers: interfaces.Lookup>[] = [
- container1,
- container2,
- ...containers,
- ].map((targetContainer) => getBindingDictionary(targetContainer));
- const bindingDictionary: interfaces.Lookup> =
- getBindingDictionary(container);
-
- function copyDictionary(
- origin: interfaces.Lookup>,
- destination: interfaces.Lookup>,
- ) {
- origin.traverse((_key, value) => {
- value.forEach((binding) => {
- destination.add(binding.serviceIdentifier, binding.clone());
- });
- });
- }
-
- targetContainers.forEach((targetBindingDictionary) => {
- copyDictionary(targetBindingDictionary, bindingDictionary);
- });
-
- return container;
- }
-
- public constructor(containerOptions?: interfaces.ContainerOptions) {
- const options = containerOptions || {};
+ constructor(containerOptions?: interfaces.ContainerOptions) {
+ const options: interfaces.ContainerOptions = containerOptions || {};
if (typeof options !== 'object') {
- throw new Error(`${ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT}`);
+ throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);
}
if (options.defaultScope === undefined) {
@@ -84,23 +52,21 @@ class Container implements interfaces.Container {
options.defaultScope !== BindingScopeEnum.Transient &&
options.defaultScope !== BindingScopeEnum.Request
) {
- throw new Error(`${ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE}`);
+ throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);
}
if (options.autoBindInjectable === undefined) {
options.autoBindInjectable = false;
} else if (typeof options.autoBindInjectable !== 'boolean') {
throw new Error(
- `${ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE}`,
+ ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE,
);
}
if (options.skipBaseClassChecks === undefined) {
options.skipBaseClassChecks = false;
} else if (typeof options.skipBaseClassChecks !== 'boolean') {
- throw new Error(
- `${ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK}`,
- );
+ throw new Error(ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);
}
this.options = {
@@ -120,17 +86,57 @@ class Container implements interfaces.Container {
this._moduleActivationStore = new ModuleActivationStore();
}
- public load(...modules: interfaces.ContainerModule[]) {
+ public static merge(
+ container1: interfaces.Container,
+ container2: interfaces.Container,
+ ...containers: interfaces.Container[]
+ ): interfaces.Container {
+ const container: Container = new Container();
+ const targetContainers: interfaces.Lookup>[] = [
+ container1,
+ container2,
+ ...containers,
+ ].map((targetContainer: interfaces.Container) =>
+ getBindingDictionary(targetContainer),
+ );
+ const bindingDictionary: interfaces.Lookup> =
+ getBindingDictionary(container);
+
+ function copyDictionary(
+ origin: interfaces.Lookup>,
+ destination: interfaces.Lookup>,
+ ) {
+ origin.traverse(
+ (_key: interfaces.ServiceIdentifier, value: interfaces.Binding[]) => {
+ value.forEach((binding: interfaces.Binding) => {
+ destination.add(binding.serviceIdentifier, binding.clone());
+ });
+ },
+ );
+ }
+
+ targetContainers.forEach(
+ (targetBindingDictionary: interfaces.Lookup) => {
+ copyDictionary(targetBindingDictionary, bindingDictionary);
+ },
+ );
+
+ return container;
+ }
+
+ public load(...modules: interfaces.ContainerModule[]): void {
+ // eslint-disable-next-line @typescript-eslint/typedef
const getHelpers = this._getContainerModuleHelpersFactory();
for (const currentModule of modules) {
+ // eslint-disable-next-line @typescript-eslint/typedef
const containerModuleHelpers = getHelpers(currentModule.id);
currentModule.registry(
- containerModuleHelpers.bindFunction as interfaces.Bind,
+ containerModuleHelpers.bindFunction,
containerModuleHelpers.unbindFunction,
containerModuleHelpers.isboundFunction,
- containerModuleHelpers.rebindFunction as interfaces.Rebind,
+ containerModuleHelpers.rebindFunction,
containerModuleHelpers.unbindAsyncFunction,
containerModuleHelpers.onActivationFunction as interfaces.Container['onActivation'],
containerModuleHelpers.onDeactivationFunction as interfaces.Container['onDeactivation'],
@@ -139,16 +145,18 @@ class Container implements interfaces.Container {
}
public async loadAsync(...modules: interfaces.AsyncContainerModule[]) {
+ // eslint-disable-next-line @typescript-eslint/typedef
const getHelpers = this._getContainerModuleHelpersFactory();
for (const currentModule of modules) {
+ // eslint-disable-next-line @typescript-eslint/typedef
const containerModuleHelpers = getHelpers(currentModule.id);
await currentModule.registry(
- containerModuleHelpers.bindFunction as interfaces.Bind,
+ containerModuleHelpers.bindFunction,
containerModuleHelpers.unbindFunction,
containerModuleHelpers.isboundFunction,
- containerModuleHelpers.rebindFunction as interfaces.Rebind,
+ containerModuleHelpers.rebindFunction,
containerModuleHelpers.unbindAsyncFunction,
containerModuleHelpers.onActivationFunction as interfaces.Container['onActivation'],
containerModuleHelpers.onDeactivationFunction as interfaces.Container['onDeactivation'],
@@ -157,8 +165,10 @@ class Container implements interfaces.Container {
}
public unload(...modules: interfaces.ContainerModuleBase[]): void {
- modules.forEach((module) => {
- const deactivations = this._removeModuleBindings(module.id);
+ modules.forEach((module: interfaces.ContainerModuleBase) => {
+ const deactivations: interfaces.Binding[] = this._removeModuleBindings(
+ module.id,
+ );
this._deactivateSingletons(deactivations);
this._removeModuleHandlers(module.id);
@@ -169,7 +179,9 @@ class Container implements interfaces.Container {
...modules: interfaces.ContainerModuleBase[]
): Promise {
for (const module of modules) {
- const deactivations = this._removeModuleBindings(module.id);
+ const deactivations: interfaces.Binding[] = this._removeModuleBindings(
+ module.id,
+ );
await this._deactivateSingletonsAsync(deactivations);
this._removeModuleHandlers(module.id);
@@ -180,8 +192,9 @@ class Container implements interfaces.Container {
public bind(
serviceIdentifier: interfaces.ServiceIdentifier,
): interfaces.BindingToSyntax {
- const scope = this.options.defaultScope || BindingScopeEnum.Transient;
- const binding = new Binding(serviceIdentifier, scope);
+ const scope: interfaces.BindingScope =
+ this.options.defaultScope || BindingScopeEnum.Transient;
+ const binding: Binding = new Binding(serviceIdentifier, scope);
this._bindingDictionary.add(serviceIdentifier, binding as Binding);
return new BindingToSyntax(binding);
}
@@ -203,7 +216,8 @@ class Container implements interfaces.Container {
// Removes a type binding from the registry by its key
public unbind(serviceIdentifier: interfaces.ServiceIdentifier): void {
if (this._bindingDictionary.hasKey(serviceIdentifier)) {
- const bindings = this._bindingDictionary.get(serviceIdentifier);
+ const bindings: interfaces.Binding[] =
+ this._bindingDictionary.get(serviceIdentifier);
this._deactivateSingletons(bindings);
}
@@ -215,7 +229,8 @@ class Container implements interfaces.Container {
serviceIdentifier: interfaces.ServiceIdentifier,
): Promise {
if (this._bindingDictionary.hasKey(serviceIdentifier)) {
- const bindings = this._bindingDictionary.get(serviceIdentifier);
+ const bindings: interfaces.Binding[] =
+ this._bindingDictionary.get(serviceIdentifier);
await this._deactivateSingletonsAsync(bindings);
}
@@ -225,9 +240,11 @@ class Container implements interfaces.Container {
// Removes all the type bindings from the registry
public unbindAll(): void {
- this._bindingDictionary.traverse((_key, value) => {
- this._deactivateSingletons(value);
- });
+ this._bindingDictionary.traverse(
+ (_key: interfaces.ServiceIdentifier, value: interfaces.Binding[]) => {
+ this._deactivateSingletons(value);
+ },
+ );
this._bindingDictionary = new Lookup>();
}
@@ -235,9 +252,11 @@ class Container implements interfaces.Container {
public async unbindAllAsync(): Promise {
const promises: Promise[] = [];
- this._bindingDictionary.traverse((_key, value) => {
- promises.push(this._deactivateSingletonsAsync(value));
- });
+ this._bindingDictionary.traverse(
+ (_key: interfaces.ServiceIdentifier, value: interfaces.Binding[]) => {
+ promises.push(this._deactivateSingletonsAsync(value));
+ },
+ );
await Promise.all(promises);
@@ -268,7 +287,7 @@ class Container implements interfaces.Container {
public isBound(
serviceIdentifier: interfaces.ServiceIdentifier,
): boolean {
- let bound = this._bindingDictionary.hasKey(serviceIdentifier);
+ let bound: boolean = this._bindingDictionary.hasKey(serviceIdentifier);
if (!bound && this.parent) {
bound = this.parent.isBound(serviceIdentifier);
}
@@ -295,13 +314,19 @@ class Container implements interfaces.Container {
key: string | number | symbol,
value: unknown,
): boolean {
- let bound = false;
+ let bound: boolean = false;
// verify if there are bindings available for serviceIdentifier on current binding dictionary
if (this._bindingDictionary.hasKey(serviceIdentifier)) {
- const bindings = this._bindingDictionary.get(serviceIdentifier);
- const request = createMockRequest(this, serviceIdentifier, key, value);
- bound = bindings.some((b) => b.constraint(request));
+ const bindings: interfaces.Binding[] =
+ this._bindingDictionary.get(serviceIdentifier);
+ const request: interfaces.Request = createMockRequest(
+ this,
+ serviceIdentifier,
+ key,
+ value,
+ );
+ bound = bindings.some((b: interfaces.Binding) => b.constraint(request));
}
// verify if there is a parent container that could solve the request
@@ -325,7 +350,8 @@ class Container implements interfaces.Container {
}
public restore(): void {
- const snapshot = this._snapshots.pop();
+ const snapshot: interfaces.ContainerSnapshot | undefined =
+ this._snapshots.pop();
if (snapshot === undefined) {
throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);
}
@@ -339,7 +365,7 @@ class Container implements interfaces.Container {
public createChild(
containerOptions?: interfaces.ContainerOptions,
): Container {
- const child = new Container(containerOptions || this.options);
+ const child: Container = new Container(containerOptions || this.options);
child.parent = this;
return child;
}
@@ -348,7 +374,10 @@ class Container implements interfaces.Container {
const initial: interfaces.Next = this._middleware
? this._middleware
: this._planAndResolve();
- this._middleware = middlewares.reduce((prev, curr) => curr(prev), initial);
+ this._middleware = middlewares.reduce(
+ (prev: interfaces.Next, curr: interfaces.Middleware) => curr(prev),
+ initial,
+ );
}
public applyCustomMetadataReader(metadataReader: interfaces.MetadataReader) {
@@ -359,7 +388,7 @@ class Container implements interfaces.Container {
// The runtime identifier must be associated with only one binding
// use getAll when the runtime identifier is associated with multiple bindings
public get(serviceIdentifier: interfaces.ServiceIdentifier): T {
- const getArgs = this._getNotAllArgs(serviceIdentifier, false);
+ const getArgs: GetArgs = this._getNotAllArgs(serviceIdentifier, false);
return this._getButThrowIfAsync(getArgs) as T;
}
@@ -367,7 +396,7 @@ class Container implements interfaces.Container {
public async getAsync(
serviceIdentifier: interfaces.ServiceIdentifier,
): Promise {
- const getArgs = this._getNotAllArgs(serviceIdentifier, false);
+ const getArgs: GetArgs = this._getNotAllArgs(serviceIdentifier, false);
return this._get(getArgs) as Promise | T;
}
@@ -377,7 +406,12 @@ class Container implements interfaces.Container {
key: string | number | symbol,
value: unknown,
): T {
- const getArgs = this._getNotAllArgs(serviceIdentifier, false, key, value);
+ const getArgs: GetArgs = this._getNotAllArgs(
+ serviceIdentifier,
+ false,
+ key,
+ value,
+ );
return this._getButThrowIfAsync(getArgs) as T;
}
@@ -387,7 +421,12 @@ class Container implements interfaces.Container {
key: string | number | symbol,
value: unknown,
): Promise {
- const getArgs = this._getNotAllArgs(serviceIdentifier, false, key, value);
+ const getArgs: GetArgs = this._getNotAllArgs(
+ serviceIdentifier,
+ false,
+ key,
+ value,
+ );
return this._get(getArgs) as Promise | T;
}
@@ -399,7 +438,7 @@ class Container implements interfaces.Container {
return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
}
- public getNamedAsync(
+ public async getNamedAsync(
serviceIdentifier: interfaces.ServiceIdentifier,
named: string | number | symbol,
): Promise {
@@ -413,15 +452,15 @@ class Container implements interfaces.Container {
// Resolves a dependency by its runtime identifier
// The runtime identifier can be associated with one or multiple bindings
public getAll(serviceIdentifier: interfaces.ServiceIdentifier): T[] {
- const getArgs = this._getAllArgs(serviceIdentifier);
+ const getArgs: GetArgs = this._getAllArgs(serviceIdentifier);
return this._getButThrowIfAsync(getArgs) as T[];
}
- public getAllAsync(
+ public async getAllAsync(
serviceIdentifier: interfaces.ServiceIdentifier,
): Promise {
- const getArgs = this._getAllArgs(serviceIdentifier);
+ const getArgs: GetArgs = this._getAllArgs(serviceIdentifier);
return this._getAll(getArgs);
}
@@ -431,17 +470,27 @@ class Container implements interfaces.Container {
key: string | number | symbol,
value: unknown,
): T[] {
- const getArgs = this._getNotAllArgs(serviceIdentifier, true, key, value);
+ const getArgs: GetArgs = this._getNotAllArgs(
+ serviceIdentifier,
+ true,
+ key,
+ value,
+ );
return this._getButThrowIfAsync(getArgs) as T[];
}
- public getAllTaggedAsync(
+ public async getAllTaggedAsync(
serviceIdentifier: interfaces.ServiceIdentifier,
key: string | number | symbol,
value: unknown,
): Promise {
- const getArgs = this._getNotAllArgs(serviceIdentifier, true, key, value);
+ const getArgs: GetArgs = this._getNotAllArgs(
+ serviceIdentifier,
+ true,
+ key,
+ value,
+ );
return this._getAll(getArgs);
}
@@ -457,7 +506,7 @@ class Container implements interfaces.Container {
);
}
- public getAllNamedAsync(
+ public async getAllNamedAsync(
serviceIdentifier: interfaces.ServiceIdentifier,
named: string | number | symbol,
): Promise {
@@ -469,31 +518,34 @@ class Container implements interfaces.Container {
}
public resolve(constructorFunction: interfaces.Newable) {
- const isBound = this.isBound(constructorFunction);
+ const isBound: boolean = this.isBound(constructorFunction);
if (!isBound) {
this.bind(constructorFunction).toSelf();
}
- const resolved = this.get(constructorFunction);
+ const resolved: T = this.get(constructorFunction);
if (!isBound) {
this.unbind(constructorFunction);
}
return resolved;
}
- private _preDestroy(
+ private _preDestroy(
constructor: NewableFunction,
- instance: T,
+ instance: unknown,
): Promise | void {
if (Reflect.hasMetadata(METADATA_KEY.PRE_DESTROY, constructor)) {
const data: interfaces.Metadata = Reflect.getMetadata(
METADATA_KEY.PRE_DESTROY,
constructor,
- );
- return (instance as interfaces.Instance)[data.value as string]?.();
+ ) as interfaces.Metadata;
+
+ return (instance as interfaces.Instance)[
+ data.value as string
+ ]?.();
}
}
private _removeModuleHandlers(moduleId: number): void {
- const moduleActivationsHandlers =
+ const moduleActivationsHandlers: interfaces.ModuleActivationHandlers =
this._moduleActivationStore.remove(moduleId);
this._activations.removeIntersection(
@@ -508,7 +560,7 @@ class Container implements interfaces.Container {
moduleId: number,
): interfaces.Binding[] {
return this._bindingDictionary.removeByCondition(
- (binding) => binding.moduleId === moduleId,
+ (binding: interfaces.Binding) => binding.moduleId === moduleId,
);
}
@@ -516,19 +568,21 @@ class Container implements interfaces.Container {
binding: Binding,
instance: T,
): void | Promise {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const constructor: NewableFunction =
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Object.getPrototypeOf(instance).constructor;
try {
if (this._deactivations.hasKey(binding.serviceIdentifier)) {
- const result = this._deactivateContainer(
+ const result: void | Promise = this._deactivateContainer(
instance,
this._deactivations.get(binding.serviceIdentifier).values(),
);
if (isPromise(result)) {
return this._handleDeactivationError(
- result.then(() =>
+ result.then(async () =>
this._propagateContainerDeactivationThenBindingAndPreDestroyAsync(
binding,
instance,
@@ -540,7 +594,7 @@ class Container implements interfaces.Container {
}
}
- const propagateDeactivationResult =
+ const propagateDeactivationResult: void | Promise =
this._propagateContainerDeactivationThenBindingAndPreDestroy(
binding,
instance,
@@ -577,19 +631,22 @@ class Container implements interfaces.Container {
}
}
- private _deactivateContainer(
- instance: T,
+ private _deactivateContainer(
+ instance: unknown,
deactivationsIterator: IterableIterator<
interfaces.BindingDeactivation
>,
): void | Promise {
- let deactivation = deactivationsIterator.next();
+ let deactivation: IteratorResult =
+ deactivationsIterator.next();
- while (deactivation.value) {
- const result = deactivation.value(instance);
+ while (typeof deactivation.value === 'function') {
+ const result: unknown = (
+ deactivation.value as (instance: unknown) => void | Promise
+ )(instance);
if (isPromise(result)) {
- return result.then(() =>
+ return result.then(async () =>
this._deactivateContainerAsync(instance, deactivationsIterator),
);
}
@@ -598,22 +655,28 @@ class Container implements interfaces.Container {
}
}
- private async _deactivateContainerAsync(
- instance: T,
+ private async _deactivateContainerAsync(
+ instance: unknown,
deactivationsIterator: IterableIterator<
interfaces.BindingDeactivation
>,
): Promise {
- let deactivation = deactivationsIterator.next();
+ let deactivation: IteratorResult =
+ deactivationsIterator.next();
- while (deactivation.value) {
- await deactivation.value(instance);
+ while (typeof deactivation.value === 'function') {
+ await (deactivation.value as (instance: unknown) => Promise)(
+ instance,
+ );
deactivation = deactivationsIterator.next();
}
}
private _getContainerModuleHelpersFactory() {
- const setModuleId = (
+ const setModuleId: (
+ bindingToSyntax: interfaces.BindingToSyntax,
+ moduleId: interfaces.ContainerModuleBase['id'],
+ ) => void = (
bindingToSyntax: interfaces.BindingToSyntax,
moduleId: interfaces.ContainerModuleBase['id'],
) => {
@@ -627,38 +690,58 @@ class Container implements interfaces.Container {
)._binding.moduleId = moduleId;
};
- const getBindFunction =
- (moduleId: interfaces.ContainerModuleBase['id']) =>
- (serviceIdentifier: interfaces.ServiceIdentifier) => {
- const bindingToSyntax = this.bind(serviceIdentifier);
+ const getBindFunction: (
+ moduleId: interfaces.ContainerModuleBase['id'],
+ ) => interfaces.Bind =
+ (moduleId: interfaces.ContainerModuleBase['id']) =>
+ (serviceIdentifier: interfaces.ServiceIdentifier) => {
+ const bindingToSyntax: interfaces.BindingToSyntax =
+ this.bind(serviceIdentifier);
setModuleId(bindingToSyntax, moduleId);
- return bindingToSyntax as BindingToSyntax;
+ return bindingToSyntax;
};
- const getUnbindFunction =
- () => (serviceIdentifier: interfaces.ServiceIdentifier) => {
- return this.unbind(serviceIdentifier);
- };
+ const getUnbindFunction: () => (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ ) => void = () => (serviceIdentifier: interfaces.ServiceIdentifier) => {
+ this.unbind(serviceIdentifier);
+ };
- const getUnbindAsyncFunction =
- () => (serviceIdentifier: interfaces.ServiceIdentifier) => {
+ const getUnbindAsyncFunction: () => (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ ) => Promise =
+ () =>
+ async (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ ): Promise => {
return this.unbindAsync(serviceIdentifier);
};
- const getIsboundFunction =
- () => (serviceIdentifier: interfaces.ServiceIdentifier) => {
+ const getIsboundFunction: () => (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ ) => boolean =
+ () =>
+ (serviceIdentifier: interfaces.ServiceIdentifier): boolean => {
return this.isBound(serviceIdentifier);
};
- const getRebindFunction =
- (moduleId: interfaces.ContainerModuleBase['id']) =>
- (serviceIdentifier: interfaces.ServiceIdentifier) => {
- const bindingToSyntax = this.rebind(serviceIdentifier);
+ const getRebindFunction: (
+ moduleId: interfaces.ContainerModuleBase['id'],
+ ) => interfaces.Rebind =
+ (moduleId: interfaces.ContainerModuleBase['id']) =>
+ (serviceIdentifier: interfaces.ServiceIdentifier) => {
+ const bindingToSyntax: interfaces.BindingToSyntax =
+ this.rebind(serviceIdentifier);
setModuleId(bindingToSyntax, moduleId);
- return bindingToSyntax as BindingToSyntax;
+ return bindingToSyntax;
};
- const getOnActivationFunction =
+ const getOnActivationFunction: (
+ moduleId: interfaces.ContainerModuleBase['id'],
+ ) => (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ onActivation: interfaces.BindingActivation,
+ ) => void =
(moduleId: interfaces.ContainerModuleBase['id']) =>
(
serviceIdentifier: interfaces.ServiceIdentifier,
@@ -672,7 +755,12 @@ class Container implements interfaces.Container {
this.onActivation(serviceIdentifier, onActivation);
};
- const getOnDeactivationFunction =
+ const getOnDeactivationFunction: (
+ moduleId: interfaces.ContainerModuleBase['id'],
+ ) => (
+ serviceIdentifier: interfaces.ServiceIdentifier,
+ onDeactivation: interfaces.BindingDeactivation,
+ ) => void =
(moduleId: interfaces.ContainerModuleBase['id']) =>
(
serviceIdentifier: interfaces.ServiceIdentifier,
@@ -692,11 +780,11 @@ class Container implements interfaces.Container {
onActivationFunction: getOnActivationFunction(mId),
onDeactivationFunction: getOnDeactivationFunction(mId),
rebindFunction: getRebindFunction(mId),
- unbindFunction: getUnbindFunction(),
unbindAsyncFunction: getUnbindAsyncFunction(),
+ unbindFunction: getUnbindFunction(),
});
}
- private _getAll(getArgs: GetArgs): Promise {
+ private async _getAll(getArgs: GetArgs): Promise {
return Promise.all(this._get(getArgs) as (Promise | T)[]);
}
// Prepares arguments required for resolution and
@@ -705,11 +793,11 @@ class Container implements interfaces.Container {
private _get(getArgs: GetArgs): interfaces.ContainerResolution {
const planAndResolveArgs: interfaces.NextArgs = {
...getArgs,
- contextInterceptor: (context) => context,
+ contextInterceptor: (context: interfaces.Context) => context,
targetType: TargetTypeEnum.Variable,
};
if (this._middleware) {
- const middlewareResult = this._middleware(planAndResolveArgs);
+ const middlewareResult: unknown = this._middleware(planAndResolveArgs);
if (middlewareResult === undefined || middlewareResult === null) {
throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);
}
@@ -720,7 +808,7 @@ class Container implements interfaces.Container {
}
private _getButThrowIfAsync(getArgs: GetArgs): T | T[] {
- const result = this._get(getArgs);
+ const result: interfaces.ContainerResolution = this._get(getArgs);
if (isPromiseOrContainsPromise(result)) {
throw new Error(ERROR_MSGS.LAZY_IN_SYNC(getArgs.serviceIdentifier));
@@ -750,8 +838,8 @@ class Container implements interfaces.Container {
const getNotAllArgs: GetArgs = {
avoidConstraints: false,
isMultiInject,
- serviceIdentifier,
key,
+ serviceIdentifier,
value,
};
@@ -764,9 +852,11 @@ class Container implements interfaces.Container {
private _planAndResolve(): (
args: interfaces.NextArgs,
) => interfaces.ContainerResolution {
- return (args: interfaces.NextArgs) => {
+ return (
+ args: interfaces.NextArgs,
+ ): T | Promise | (T | Promise)[] => {
// create a plan
- let context = plan(
+ let context: interfaces.Context = plan(
this._metadataReader,
this,
args.isMultiInject,
@@ -781,7 +871,7 @@ class Container implements interfaces.Container {
context = args.contextInterceptor(context);
// resolve plan
- const result = resolve(context);
+ const result: T | Promise | (T | Promise)[] = resolve(context);
return result;
};
@@ -795,7 +885,7 @@ class Container implements interfaces.Container {
}
if (isPromise(binding.cache)) {
- return binding.cache.then((resolved) =>
+ return binding.cache.then((resolved: unknown): void | Promise =>
this._deactivate(binding, resolved),
);
}
@@ -805,7 +895,7 @@ class Container implements interfaces.Container {
private _deactivateSingletons(bindings: Binding[]): void {
for (const binding of bindings) {
- const result = this._deactivateIfSingleton(binding);
+ const result: void | Promise = this._deactivateIfSingleton(binding);
if (isPromise(result)) {
throw new Error(ERROR_MSGS.ASYNC_UNBIND_REQUIRED);
@@ -816,7 +906,12 @@ class Container implements interfaces.Container {
private async _deactivateSingletonsAsync(
bindings: Binding[],
): Promise {
- await Promise.all(bindings.map((b) => this._deactivateIfSingleton(b)));
+ await Promise.all(
+ bindings.map(
+ async (b: interfaces.Binding): Promise =>
+ this._deactivateIfSingleton(b),
+ ),
+ );
}
private _propagateContainerDeactivationThenBindingAndPreDestroy(
@@ -856,7 +951,7 @@ class Container implements interfaces.Container {
): void {
try {
this._bindingDictionary.remove(serviceIdentifier);
- } catch (e) {
+ } catch (_e: unknown) {
throw new Error(
`${ERROR_MSGS.CANNOT_UNBIND} ${getServiceIdentifierAsString(serviceIdentifier)}`,
);
@@ -869,10 +964,12 @@ class Container implements interfaces.Container {
constructor: NewableFunction,
): void | Promise {
if (typeof binding.onDeactivation === 'function') {
- const result = binding.onDeactivation(instance);
+ const result: void | Promise = binding.onDeactivation(instance);
if (isPromise(result)) {
- return result.then(() => this._preDestroy(constructor, instance));
+ return result.then((): void | Promise =>
+ this._preDestroy(constructor, instance),
+ );
}
}
diff --git a/src/container/container_module.ts b/src/container/container_module.ts
index f722ae449..997fd4c4a 100644
--- a/src/container/container_module.ts
+++ b/src/container/container_module.ts
@@ -5,7 +5,7 @@ export class ContainerModule implements interfaces.ContainerModule {
public id: number;
public registry: interfaces.ContainerModuleCallBack;
- public constructor(registry: interfaces.ContainerModuleCallBack) {
+ constructor(registry: interfaces.ContainerModuleCallBack) {
this.id = id();
this.registry = registry;
}
@@ -15,7 +15,7 @@ export class AsyncContainerModule implements interfaces.AsyncContainerModule {
public id: number;
public registry: interfaces.AsyncContainerModuleCallBack;
- public constructor(registry: interfaces.AsyncContainerModuleCallBack) {
+ constructor(registry: interfaces.AsyncContainerModuleCallBack) {
this.id = id();
this.registry = registry;
}
diff --git a/src/container/container_snapshot.ts b/src/container/container_snapshot.ts
index d26bb1bd4..f8d299823 100644
--- a/src/container/container_snapshot.ts
+++ b/src/container/container_snapshot.ts
@@ -16,7 +16,7 @@ class ContainerSnapshot implements interfaces.ContainerSnapshot {
deactivations: interfaces.Lookup>,
moduleActivationStore: interfaces.ModuleActivationStore,
) {
- const snapshot = new ContainerSnapshot();
+ const snapshot: ContainerSnapshot = new ContainerSnapshot();
snapshot.bindings = bindings;
snapshot.middleware = middleware;
snapshot.deactivations = deactivations;
diff --git a/src/container/lookup.ts b/src/container/lookup.ts
index 5190555ab..dd7d87d28 100644
--- a/src/container/lookup.ts
+++ b/src/container/lookup.ts
@@ -4,9 +4,9 @@ import { isClonable } from '../utils/clonable';
class Lookup implements interfaces.Lookup {
// dictionary used store multiple values for each key
- private _map: Map;
+ private readonly _map: Map;
- public constructor() {
+ constructor() {
this._map = new Map();
}
@@ -16,15 +16,13 @@ class Lookup implements interfaces.Lookup {
// adds a new entry to _map
public add(serviceIdentifier: interfaces.ServiceIdentifier, value: T): void {
- if (serviceIdentifier === null || serviceIdentifier === undefined) {
- throw new Error(ERROR_MSGS.NULL_ARGUMENT);
- }
+ this._checkNonNulish(serviceIdentifier);
if (value === null || value === undefined) {
throw new Error(ERROR_MSGS.NULL_ARGUMENT);
}
- const entry = this._map.get(serviceIdentifier);
+ const entry: T[] | undefined = this._map.get(serviceIdentifier);
if (entry !== undefined) {
entry.push(value);
} else {
@@ -34,11 +32,9 @@ class Lookup implements interfaces.Lookup {
// gets the value of a entry by its key (serviceIdentifier)
public get(serviceIdentifier: interfaces.ServiceIdentifier): T[] {
- if (serviceIdentifier === null || serviceIdentifier === undefined) {
- throw new Error(ERROR_MSGS.NULL_ARGUMENT);
- }
+ this._checkNonNulish(serviceIdentifier);
- const entry = this._map.get(serviceIdentifier);
+ const entry: T[] | undefined = this._map.get(serviceIdentifier);
if (entry !== undefined) {
return entry;
@@ -49,9 +45,7 @@ class Lookup implements interfaces.Lookup {
// removes a entry from _map by its key (serviceIdentifier)
public remove(serviceIdentifier: interfaces.ServiceIdentifier): void {
- if (serviceIdentifier === null || serviceIdentifier === undefined) {
- throw new Error(ERROR_MSGS.NULL_ARGUMENT);
- }
+ this._checkNonNulish(serviceIdentifier);
if (!this._map.delete(serviceIdentifier)) {
throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
@@ -64,14 +58,16 @@ class Lookup implements interfaces.Lookup {
serviceIdentifier: interfaces.ServiceIdentifier,
value: T[],
) => {
- const lookupActivations = lookup.hasKey(serviceIdentifier)
+ const lookupActivations: T[] | undefined = lookup.hasKey(
+ serviceIdentifier,
+ )
? lookup.get(serviceIdentifier)
: undefined;
if (lookupActivations !== undefined) {
- const filteredValues = value.filter(
- (lookupValue) =>
+ const filteredValues: T[] = value.filter(
+ (lookupValue: T) =>
!lookupActivations.some(
- (moduleActivation) => lookupValue === moduleActivation,
+ (moduleActivation: T) => lookupValue === moduleActivation,
),
);
@@ -83,11 +79,11 @@ class Lookup implements interfaces.Lookup {
public removeByCondition(condition: (item: T) => boolean): T[] {
const removals: T[] = [];
- this._map.forEach((entries, key) => {
+ this._map.forEach((entries: T[], key: interfaces.ServiceIdentifier) => {
const updatedEntries: T[] = [];
for (const entry of entries) {
- const remove = condition(entry);
+ const remove: boolean = condition(entry);
if (remove) {
removals.push(entry);
} else {
@@ -103,9 +99,7 @@ class Lookup implements interfaces.Lookup {
// returns true if _map contains a key (serviceIdentifier)
public hasKey(serviceIdentifier: interfaces.ServiceIdentifier): boolean {
- if (serviceIdentifier === null || serviceIdentifier === undefined) {
- throw new Error(ERROR_MSGS.NULL_ARGUMENT);
- }
+ this._checkNonNulish(serviceIdentifier);
return this._map.has(serviceIdentifier);
}
@@ -113,10 +107,12 @@ class Lookup implements interfaces.Lookup {
// returns a new Lookup instance; note: this is not a deep clone, only Lookup related data structure (dictionary) is
// cloned, content remains the same
public clone(): interfaces.Lookup {
- const copy = new Lookup();
+ const copy: Lookup = new Lookup();
- this._map.forEach((value, key) => {
- value.forEach((b) => copy.add(key, isClonable(b) ? b.clone() : b));
+ this._map.forEach((value: T[], key: interfaces.ServiceIdentifier) => {
+ value.forEach((b: T) => {
+ copy.add(key, isClonable(b) ? b.clone() : b);
+ });
});
return copy;
@@ -125,11 +121,17 @@ class Lookup implements interfaces.Lookup {
public traverse(
func: (key: interfaces.ServiceIdentifier, value: T[]) => void,
): void {
- this._map.forEach((value, key) => {
+ this._map.forEach((value: T[], key: interfaces.ServiceIdentifier) => {
func(key, value);
});
}
+ private _checkNonNulish(value: unknown): void {
+ if (value == null) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ }
+
private _setValue(
serviceIdentifier: interfaces.ServiceIdentifier,
value: T[],
diff --git a/src/container/module_activation_store.ts b/src/container/module_activation_store.ts
index cd3eb3504..2f0d87118 100644
--- a/src/container/module_activation_store.ts
+++ b/src/container/module_activation_store.ts
@@ -2,15 +2,20 @@ import { interfaces } from '../interfaces/interfaces';
import { Lookup } from './lookup';
export class ModuleActivationStore implements interfaces.ModuleActivationStore {
- private _map = new Map();
+ private readonly _map: Map =
+ new Map();
public remove(moduleId: number): interfaces.ModuleActivationHandlers {
- if (this._map.has(moduleId)) {
- const handlers = this._map.get(moduleId);
- this._map.delete(moduleId);
- return handlers!;
+ const handlers: interfaces.ModuleActivationHandlers | undefined =
+ this._map.get(moduleId);
+
+ if (handlers === undefined) {
+ return this._getEmptyHandlersStore();
}
- return this._getEmptyHandlersStore();
+
+ this._map.delete(moduleId);
+
+ return handlers;
}
public addDeactivation(
@@ -36,14 +41,19 @@ export class ModuleActivationStore implements interfaces.ModuleActivationStore {
}
public clone(): interfaces.ModuleActivationStore {
- const clone = new ModuleActivationStore();
+ const clone: ModuleActivationStore = new ModuleActivationStore();
- this._map.forEach((handlersStore, moduleId) => {
- clone._map.set(moduleId, {
- onActivations: handlersStore.onActivations.clone(),
- onDeactivations: handlersStore.onDeactivations.clone(),
- });
- });
+ this._map.forEach(
+ (
+ handlersStore: interfaces.ModuleActivationHandlers,
+ moduleId: number,
+ ) => {
+ clone._map.set(moduleId, {
+ onActivations: handlersStore.onActivations.clone(),
+ onDeactivations: handlersStore.onDeactivations.clone(),
+ });
+ },
+ );
return clone;
}
diff --git a/src/interfaces/interfaces.ts b/src/interfaces/interfaces.ts
index 3edb9134d..b7e1f459a 100644
--- a/src/interfaces/interfaces.ts
+++ b/src/interfaces/interfaces.ts
@@ -1,5 +1,7 @@
+/* eslint-disable @typescript-eslint/naming-convention */
import { FactoryType } from '../utils/factory_type';
+// eslint-disable-next-line @typescript-eslint/no-namespace
namespace interfaces {
export type DynamicValue = (context: interfaces.Context) => T | Promise;
export type ContainerResolution = T | Promise | (T | Promise)[];
@@ -47,6 +49,7 @@ namespace interfaces {
Variable: interfaces.TargetType;
}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Newable = new (...args: any[]) => T;
export type Instance = T & Record void>;
@@ -128,7 +131,9 @@ namespace interfaces {
}
export type Provider = (
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
) => ((...args: any[]) => Promise) | Promise;
export type ProviderCreator = (context: Context) => Provider;
@@ -143,6 +148,7 @@ namespace interfaces {
value?: unknown;
}
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
export type Next = (args: NextArgs) => unknown | unknown[];
export type Middleware = (next: Next) => Next;
@@ -480,8 +486,8 @@ namespace interfaces {
}
export interface ConstraintFunction {
- metaData?: Metadata;
(request: Request | null): boolean;
+ metaData?: Metadata;
}
export interface MetadataReader {
diff --git a/src/inversify.ts b/src/inversify.ts
index a1d1119c0..ddafcf926 100644
--- a/src/inversify.ts
+++ b/src/inversify.ts
@@ -1,4 +1,5 @@
import * as keys from './constants/metadata_keys';
+// eslint-disable-next-line @typescript-eslint/typedef
export const METADATA_KEY = keys;
export { Container } from './container/container';
export {
diff --git a/src/planning/context.ts b/src/planning/context.ts
index 4af56a614..fb4bfc859 100644
--- a/src/planning/context.ts
+++ b/src/planning/context.ts
@@ -7,7 +7,7 @@ class Context implements interfaces.Context {
public plan!: interfaces.Plan;
public currentRequest!: interfaces.Request;
- public constructor(container: interfaces.Container) {
+ constructor(container: interfaces.Container) {
this.id = id();
this.container = container;
}
diff --git a/src/planning/metadata.ts b/src/planning/metadata.ts
index b1d5f4ff5..5e504db82 100644
--- a/src/planning/metadata.ts
+++ b/src/planning/metadata.ts
@@ -5,7 +5,7 @@ class Metadata implements interfaces.Metadata {
public key: string | number | symbol;
public value: unknown;
- public constructor(key: string | number | symbol, value: unknown) {
+ constructor(key: string | number | symbol, value: unknown) {
this.key = key;
this.value = value;
}
diff --git a/src/planning/metadata_reader.ts b/src/planning/metadata_reader.ts
index fe36683f9..7c1f9d679 100644
--- a/src/planning/metadata_reader.ts
+++ b/src/planning/metadata_reader.ts
@@ -6,20 +6,20 @@ class MetadataReader implements interfaces.MetadataReader {
constructorFunc: NewableFunction,
): interfaces.ConstructorMetadata {
// TypeScript compiler generated annotations
- const compilerGeneratedMetadata = Reflect.getMetadata(
- METADATA_KEY.PARAM_TYPES,
- constructorFunc,
- );
+ const compilerGeneratedMetadata: NewableFunction[] | undefined =
+ Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc) as
+ | NewableFunction[]
+ | undefined;
// User generated constructor annotations
- const userGeneratedMetadata = Reflect.getMetadata(
- METADATA_KEY.TAGGED,
- constructorFunc,
- );
+ const userGeneratedMetadata: interfaces.MetadataMap | undefined =
+ Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc) as
+ | interfaces.MetadataMap
+ | undefined;
return {
compilerGeneratedMetadata,
- userGeneratedMetadata: userGeneratedMetadata || {},
+ userGeneratedMetadata: userGeneratedMetadata ?? {},
};
}
@@ -27,8 +27,11 @@ class MetadataReader implements interfaces.MetadataReader {
constructorFunc: NewableFunction,
): interfaces.MetadataMap {
// User generated properties annotations
- const userGeneratedMetadata =
- Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || [];
+ const userGeneratedMetadata: interfaces.MetadataMap | undefined =
+ (Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) as
+ | interfaces.MetadataMap
+ | undefined) ?? {};
+
return userGeneratedMetadata;
}
}
diff --git a/src/planning/plan.ts b/src/planning/plan.ts
index af33ed545..421534d47 100644
--- a/src/planning/plan.ts
+++ b/src/planning/plan.ts
@@ -4,7 +4,7 @@ class Plan implements interfaces.Plan {
public parentContext: interfaces.Context;
public rootRequest: interfaces.Request;
- public constructor(
+ constructor(
parentContext: interfaces.Context,
rootRequest: interfaces.Request,
) {
diff --git a/src/planning/planner.ts b/src/planning/planner.ts
index 4d1b48d60..74c15b144 100644
--- a/src/planning/planner.ts
+++ b/src/planning/planner.ts
@@ -39,11 +39,11 @@ function _createTarget(
key?: string | number | symbol,
value?: unknown,
): interfaces.Target {
- const metadataKey = isMultiInject
+ const metadataKey: string = isMultiInject
? METADATA_KEY.MULTI_INJECT_TAG
: METADATA_KEY.INJECT_TAG;
- const injectMetadata = new Metadata(metadataKey, serviceIdentifier);
- const target = new Target(
+ const injectMetadata: Metadata = new Metadata(metadataKey, serviceIdentifier);
+ const target: Target = new Target(
targetType,
name,
serviceIdentifier,
@@ -51,7 +51,7 @@ function _createTarget(
);
if (key !== undefined) {
- const tagMetadata = new Metadata(key, value);
+ const tagMetadata: Metadata = new Metadata(key, value);
target.metadata.push(tagMetadata);
}
@@ -65,13 +65,16 @@ function _getActiveBindings(
parentRequest: interfaces.Request | null,
target: interfaces.Target,
): interfaces.Binding[] {
- let bindings = getBindings(context.container, target.serviceIdentifier);
+ let bindings: interfaces.Binding[] = getBindings(
+ context.container,
+ target.serviceIdentifier,
+ );
let activeBindings: interfaces.Binding[] = [];
// automatic binding
if (
bindings.length === BindingCount.NoBindingsAvailable &&
- context.container.options.autoBindInjectable &&
+ context.container.options.autoBindInjectable === true &&
typeof target.serviceIdentifier === 'function' &&
metadataReader.getConstructorMetadata(target.serviceIdentifier)
.compilerGeneratedMetadata
@@ -83,8 +86,8 @@ function _getActiveBindings(
// multiple bindings available
if (!avoidConstraints) {
// apply constraints if available to reduce the number of active bindings
- activeBindings = bindings.filter((binding) => {
- const request = new Request(
+ activeBindings = bindings.filter((binding: interfaces.Binding) => {
+ const request: Request = new Request(
binding.serviceIdentifier,
context,
parentRequest,
@@ -121,9 +124,9 @@ function _validateActiveBindingCount(
if (target.isOptional()) {
return bindings;
} else {
- const serviceIdentifierString =
+ const serviceIdentifierString: string =
getServiceIdentifierAsString(serviceIdentifier);
- let msg = ERROR_MSGS.NOT_REGISTERED;
+ let msg: string = ERROR_MSGS.NOT_REGISTERED;
msg += listMetadataForTarget(serviceIdentifierString, target);
msg += listRegisteredBindingsForServiceIdentifier(
container,
@@ -138,9 +141,9 @@ function _validateActiveBindingCount(
case BindingCount.MultipleBindingsAvailable:
default:
if (!target.isArray()) {
- const serviceIdentifierString =
+ const serviceIdentifierString: string =
getServiceIdentifierAsString(serviceIdentifier);
- let msg = `${ERROR_MSGS.AMBIGUOUS_MATCH} ${serviceIdentifierString}`;
+ let msg: string = `${ERROR_MSGS.AMBIGUOUS_MATCH} ${serviceIdentifierString}`;
msg += listRegisteredBindingsForServiceIdentifier(
container,
serviceIdentifierString,
@@ -181,7 +184,7 @@ function _createSubRequests(
target,
);
- const thePlan = new Plan(context, childRequest);
+ const thePlan: Plan = new Plan(context, childRequest);
context.addPlan(thePlan);
} else {
activeBindings = _getActiveBindings(
@@ -198,7 +201,7 @@ function _createSubRequests(
);
}
- activeBindings.forEach((binding) => {
+ activeBindings.forEach((binding: interfaces.Binding) => {
let subChildRequest: interfaces.Request | null = null;
if (target.isArray()) {
@@ -208,7 +211,7 @@ function _createSubRequests(
target,
);
} else {
- if (binding.cache) {
+ if (binding.cache !== null) {
return;
}
subChildRequest = childRequest;
@@ -218,22 +221,22 @@ function _createSubRequests(
binding.type === BindingTypeEnum.Instance &&
binding.implementationType !== null
) {
- const dependencies = getDependencies(
+ const dependencies: interfaces.Target[] = getDependencies(
metadataReader,
binding.implementationType as NewableFunction,
);
- if (!context.container.options.skipBaseClassChecks) {
+ if (context.container.options.skipBaseClassChecks !== true) {
// Throw if a derived class does not implement its constructor explicitly
// We do this to prevent errors when a base class (parent) has dependencies
// and one of the derived classes (children) has no dependencies
- const baseClassDependencyCount = getBaseClassDependencyCount(
+ const baseClassDependencyCount: number = getBaseClassDependencyCount(
metadataReader,
binding.implementationType as NewableFunction,
);
if (dependencies.length < baseClassDependencyCount) {
- const error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(
+ const error: string = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(
getFunctionName(binding.implementationType as NewableFunction),
);
throw new Error(error);
@@ -259,7 +262,8 @@ function getBindings(
serviceIdentifier: interfaces.ServiceIdentifier,
): interfaces.Binding[] {
let bindings: interfaces.Binding[] = [];
- const bindingDictionary = getBindingDictionary(container);
+ const bindingDictionary: interfaces.Lookup =
+ getBindingDictionary(container);
if (bindingDictionary.hasKey(serviceIdentifier)) {
bindings = bindingDictionary.get(
@@ -281,10 +285,10 @@ function plan(
serviceIdentifier: interfaces.ServiceIdentifier,
key?: string | number | symbol,
value?: unknown,
- avoidConstraints = false,
+ avoidConstraints: boolean = false,
): interfaces.Context {
- const context = new Context(container);
- const target = _createTarget(
+ const context: Context = new Context(container);
+ const target: interfaces.Target = _createTarget(
isMultiInject,
targetType,
serviceIdentifier,
@@ -317,14 +321,20 @@ function createMockRequest(
key: string | number | symbol,
value: unknown,
): interfaces.Request {
- const target = new Target(
+ const target: Target = new Target(
TargetTypeEnum.Variable,
'',
serviceIdentifier,
new Metadata(key, value),
);
- const context = new Context(container);
- const request = new Request(serviceIdentifier, context, null, [], target);
+ const context: Context = new Context(container);
+ const request: Request = new Request(
+ serviceIdentifier,
+ context,
+ null,
+ [],
+ target,
+ );
return request;
}
diff --git a/src/planning/queryable_string.ts b/src/planning/queryable_string.ts
index 067d25ba4..c9a63ea87 100644
--- a/src/planning/queryable_string.ts
+++ b/src/planning/queryable_string.ts
@@ -1,9 +1,9 @@
import { interfaces } from '../interfaces/interfaces';
class QueryableString implements interfaces.QueryableString {
- private str: string;
+ private readonly str: string;
- public constructor(str: string) {
+ constructor(str: string) {
this.str = str;
}
@@ -12,13 +12,17 @@ class QueryableString implements interfaces.QueryableString {
}
public endsWith(searchString: string): boolean {
- let reverseString = '';
- const reverseSearchString = searchString.split('').reverse().join('');
+ let reverseString: string = '';
+ const reverseSearchString: string = searchString
+ .split('')
+ .reverse()
+ .join('');
reverseString = this.str.split('').reverse().join('');
return this.startsWith.call({ str: reverseString }, reverseSearchString);
}
public contains(searchString: string): boolean {
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
return this.str.indexOf(searchString) !== -1;
}
diff --git a/src/planning/reflection_utils.ts b/src/planning/reflection_utils.ts
index 15dc4d896..7dd45f4be 100644
--- a/src/planning/reflection_utils.ts
+++ b/src/planning/reflection_utils.ts
@@ -11,7 +11,7 @@ function getDependencies(
metadataReader: interfaces.MetadataReader,
func: NewableFunction,
): interfaces.Target[] {
- const constructorName = getFunctionName(func);
+ const constructorName: string = getFunctionName(func);
return getTargets(metadataReader, constructorName, func, false);
}
@@ -21,31 +21,35 @@ function getTargets(
func: NewableFunction,
isBaseClass: boolean,
): interfaces.Target[] {
- const metadata = metadataReader.getConstructorMetadata(func);
+ const metadata: interfaces.ConstructorMetadata =
+ metadataReader.getConstructorMetadata(func);
// TypeScript compiler generated annotations
- const serviceIdentifiers = metadata.compilerGeneratedMetadata;
+ const serviceIdentifiers: NewableFunction[] | undefined =
+ metadata.compilerGeneratedMetadata;
// All types resolved must be annotated with @injectable
if (serviceIdentifiers === undefined) {
- const msg = `${ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION} ${constructorName}.`;
+ const msg: string = `${ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION} ${constructorName}.`;
throw new Error(msg);
}
// User generated annotations
- const constructorArgsMetadata = metadata.userGeneratedMetadata;
+ const constructorArgsMetadata: interfaces.MetadataMap =
+ metadata.userGeneratedMetadata;
- const keys = Object.keys(constructorArgsMetadata);
- const hasUserDeclaredUnknownInjections = func.length === 0 && keys.length > 0;
- const hasOptionalParameters = keys.length > func.length;
+ const keys: string[] = Object.keys(constructorArgsMetadata);
+ const hasUserDeclaredUnknownInjections: boolean =
+ func.length === 0 && keys.length > 0;
+ const hasOptionalParameters: boolean = keys.length > func.length;
- const iterations =
+ const iterations: number =
hasUserDeclaredUnknownInjections || hasOptionalParameters
? keys.length
: func.length;
// Target instances that represent constructor arguments to be injected
- const constructorTargets = getConstructorArgsAsTargets(
+ const constructorTargets: interfaces.Target[] = getConstructorArgsAsTargets(
isBaseClass,
constructorName,
serviceIdentifiers,
@@ -54,13 +58,16 @@ function getTargets(
);
// Target instances that represent properties to be injected
- const propertyTargets = getClassPropsAsTargets(
+ const propertyTargets: interfaces.Target[] = getClassPropsAsTargets(
metadataReader,
func,
constructorName,
);
- const targets = [...constructorTargets, ...propertyTargets];
+ const targets: interfaces.Target[] = [
+ ...constructorTargets,
+ ...propertyTargets,
+ ];
return targets;
}
@@ -72,17 +79,22 @@ function getConstructorArgsAsTarget(
constructorArgsMetadata: interfaces.MetadataMap,
): Target | null {
// Create map from array of metadata for faster access to metadata
- const targetMetadata = constructorArgsMetadata[index.toString()] || [];
+ const targetMetadata: interfaces.Metadata[] =
+ constructorArgsMetadata[index.toString()] || [];
+ // eslint-disable-next-line @typescript-eslint/typedef
const metadata = formatTargetMetadata(targetMetadata);
- const isManaged = metadata.unmanaged !== true;
+ const isManaged: boolean = metadata.unmanaged !== true;
// Take types to be injected from user-generated metadata
// if not available use compiler-generated metadata
- let serviceIdentifier = serviceIdentifiers[index];
- const injectIdentifier = metadata.inject || metadata.multiInject;
- serviceIdentifier = (
- injectIdentifier ? injectIdentifier : serviceIdentifier
- ) as interfaces.ServiceIdentifier | undefined;
+ let serviceIdentifier: interfaces.ServiceIdentifier | undefined =
+ serviceIdentifiers[index];
+ const injectIdentifier: unknown = metadata.inject ?? metadata.multiInject;
+ serviceIdentifier =
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
+ (injectIdentifier ? injectIdentifier : serviceIdentifier) as
+ | interfaces.ServiceIdentifier
+ | undefined;
// we unwrap LazyServiceIdentifier wrappers to allow circular dependencies on symbols
if (serviceIdentifier instanceof LazyServiceIdentifier) {
@@ -92,17 +104,17 @@ function getConstructorArgsAsTarget(
// Types Object and Function are too ambiguous to be resolved
// user needs to generate metadata manually for those
if (isManaged) {
- const isObject = serviceIdentifier === Object;
- const isFunction = serviceIdentifier === Function;
- const isUndefined = serviceIdentifier === undefined;
- const isUnknownType = isObject || isFunction || isUndefined;
+ const isObject: boolean = serviceIdentifier === Object;
+ const isFunction: boolean = serviceIdentifier === Function;
+ const isUndefined: boolean = serviceIdentifier === undefined;
+ const isUnknownType: boolean = isObject || isFunction || isUndefined;
if (!isBaseClass && isUnknownType) {
- const msg = `${ERROR_MSGS.MISSING_INJECT_ANNOTATION} argument ${index} in class ${constructorName}.`;
+ const msg: string = `${ERROR_MSGS.MISSING_INJECT_ANNOTATION} argument ${index.toString()} in class ${constructorName}.`;
throw new Error(msg);
}
- const target = new Target(
+ const target: Target = new Target(
TargetTypeEnum.ConstructorArgument,
metadata.targetName as string | symbol,
serviceIdentifier as interfaces.ServiceIdentifier,
@@ -122,15 +134,15 @@ function getConstructorArgsAsTargets(
iterations: number,
): interfaces.Target[] {
const targets: interfaces.Target[] = [];
- for (let i = 0; i < iterations; i++) {
- const index = i;
- const target = getConstructorArgsAsTarget(
- index,
+ for (let i: number = 0; i < iterations; i++) {
+ const target: Target | null = getConstructorArgsAsTarget(
+ i,
isBaseClass,
constructorName,
serviceIdentifiers,
constructorArgsMetadata,
);
+
if (target !== null) {
targets.push(target);
}
@@ -140,16 +152,19 @@ function getConstructorArgsAsTargets(
}
function _getServiceIdentifierForProperty(
- inject: string | symbol | unknown,
- multiInject: object | unknown,
+ inject: interfaces.ServiceIdentifier | undefined,
+ multiInject: interfaces.ServiceIdentifier | undefined,
propertyName: string | symbol,
className: string,
-) {
- const serviceIdentifier = inject || multiInject;
+): interfaces.ServiceIdentifier {
+ const serviceIdentifier: interfaces.ServiceIdentifier | undefined =
+ inject ?? multiInject;
+
if (serviceIdentifier === undefined) {
- const msg = `${ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION} for property ${String(propertyName)} in class ${className}.`;
+ const msg: string = `${ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION} for property ${String(propertyName)} in class ${className}.`;
throw new Error(msg);
}
+
return serviceIdentifier;
}
@@ -158,47 +173,53 @@ function getClassPropsAsTargets(
constructorFunc: NewableFunction,
constructorName: string,
) {
- const classPropsMetadata =
+ const classPropsMetadata: interfaces.MetadataMap =
metadataReader.getPropertiesMetadata(constructorFunc);
let targets: interfaces.Target[] = [];
- const symbolKeys = Object.getOwnPropertySymbols(classPropsMetadata);
+ const symbolKeys: symbol[] = Object.getOwnPropertySymbols(classPropsMetadata);
const stringKeys: (string | symbol)[] = Object.keys(classPropsMetadata);
const keys: (string | symbol)[] = stringKeys.concat(symbolKeys);
for (const key of keys) {
// the metadata for the property being injected
- const targetMetadata = classPropsMetadata[key] as interfaces.Metadata[];
+ const targetMetadata: interfaces.Metadata[] = classPropsMetadata[
+ key
+ ] as interfaces.Metadata[];
// the metadata formatted for easier access
+ // eslint-disable-next-line @typescript-eslint/typedef
const metadata = formatTargetMetadata(targetMetadata);
- const identifier = metadata.targetName || key;
+ const identifier: unknown = metadata.targetName ?? key;
// Take types to be injected from user-generated metadata
- const serviceIdentifier = _getServiceIdentifierForProperty(
- metadata.inject,
- metadata.multiInject,
- key,
- constructorName,
- );
+ const serviceIdentifier: interfaces.ServiceIdentifier =
+ _getServiceIdentifierForProperty(
+ metadata.inject as interfaces.ServiceIdentifier | undefined,
+ metadata.multiInject as interfaces.ServiceIdentifier | undefined,
+ key,
+ constructorName,
+ );
// The property target
- const target = new Target(
+ const target: Target = new Target(
TargetTypeEnum.ClassProperty,
identifier as string | symbol,
- serviceIdentifier as interfaces.ServiceIdentifier,
+ serviceIdentifier,
);
+
target.metadata = targetMetadata;
targets.push(target);
}
// Check if base class has injected properties
- const baseConstructor = Object.getPrototypeOf(
+ const baseConstructor: NewableFunction = Object.getPrototypeOf(
constructorFunc.prototype,
- ).constructor;
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ ).constructor as NewableFunction;
- if (baseConstructor !== Object) {
- const baseTargets = getClassPropsAsTargets(
+ if (baseConstructor !== (Object as unknown as NewableFunction)) {
+ const baseTargets: interfaces.Target[] = getClassPropsAsTargets(
metadataReader,
baseConstructor,
constructorName,
@@ -214,13 +235,14 @@ function getBaseClassDependencyCount(
metadataReader: interfaces.MetadataReader,
func: NewableFunction,
): number {
- const baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
-
- if (baseConstructor !== Object) {
+ const baseConstructor: NewableFunction =
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ Object.getPrototypeOf(func.prototype).constructor as NewableFunction;
+ if (baseConstructor !== (Object as unknown as NewableFunction)) {
// get targets for base class
- const baseConstructorName = getFunctionName(baseConstructor);
+ const baseConstructorName: string = getFunctionName(baseConstructor);
- const targets = getTargets(
+ const targets: interfaces.Target[] = getTargets(
metadataReader,
baseConstructorName,
baseConstructor,
@@ -228,14 +250,20 @@ function getBaseClassDependencyCount(
);
// get unmanaged metadata
- const metadata = targets.map((t) =>
- t.metadata.filter((m) => m.key === METADATA_KEY.UNMANAGED_TAG),
+ const metadata: interfaces.Metadata[][] = targets.map(
+ (t: interfaces.Target) =>
+ t.metadata.filter(
+ (m: interfaces.Metadata) => m.key === METADATA_KEY.UNMANAGED_TAG,
+ ),
);
// Compare the number of constructor arguments with the number of
// unmanaged dependencies unmanaged dependencies are not required
- const unmanagedCount = ([] as Metadata[]).concat.apply([], metadata).length;
- const dependencyCount = targets.length - unmanagedCount;
+ const unmanagedCount: number = ([] as Metadata[]).concat.apply(
+ [],
+ metadata,
+ ).length;
+ const dependencyCount: number = targets.length - unmanagedCount;
if (dependencyCount > 0) {
return dependencyCount;
diff --git a/src/planning/request.ts b/src/planning/request.ts
index fb5ab7418..1b7fa6abf 100644
--- a/src/planning/request.ts
+++ b/src/planning/request.ts
@@ -11,10 +11,11 @@ class Request implements interfaces.Request {
public target: interfaces.Target;
public requestScope: interfaces.RequestScope | null;
- public constructor(
+ constructor(
serviceIdentifier: interfaces.ServiceIdentifier,
parentContext: interfaces.Context,
parentRequest: interfaces.Request | null,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
bindings: interfaces.Binding | interfaces.Binding[],
target: interfaces.Target,
) {
@@ -35,7 +36,7 @@ class Request implements interfaces.Request {
bindings: interfaces.Binding | interfaces.Binding[],
target: interfaces.Target,
): interfaces.Request {
- const child = new Request(
+ const child: Request = new Request(
serviceIdentifier,
this.parentContext,
this,
diff --git a/src/planning/target.ts b/src/planning/target.ts
index 776a03d37..34a187e01 100644
--- a/src/planning/target.ts
+++ b/src/planning/target.ts
@@ -12,9 +12,9 @@ class Target implements interfaces.Target {
public name: interfaces.QueryableString;
public identifier: string | symbol;
public key!: string | symbol;
- public metadata!: Metadata[];
+ public metadata: Metadata[];
- public constructor(
+ constructor(
type: interfaces.TargetType,
identifier: string | symbol,
serviceIdentifier: interfaces.ServiceIdentifier,
@@ -23,13 +23,13 @@ class Target implements interfaces.Target {
this.id = id();
this.type = type;
this.serviceIdentifier = serviceIdentifier;
- const queryableName =
+ const queryableName: string =
typeof identifier === 'symbol'
? getSymbolDescription(identifier)
: identifier;
this.name = new QueryableString(queryableName || '');
this.identifier = identifier;
- this.metadata = new Array();
+ this.metadata = new Array();
let metadataItem: interfaces.Metadata | null = null;
@@ -69,8 +69,10 @@ class Target implements interfaces.Target {
}
public isTagged(): boolean {
- return this.metadata.some((metadata) =>
- METADATA_KEY.NON_CUSTOM_TAG_KEYS.every((key) => metadata.key !== key),
+ return this.metadata.some((metadata: interfaces.Metadata) =>
+ METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(
+ (key: string) => metadata.key !== key,
+ ),
);
}
@@ -81,7 +83,7 @@ class Target implements interfaces.Target {
public getNamedTag(): interfaces.Metadata | null {
if (this.isNamed()) {
return this.metadata.filter(
- (m) => m.key === METADATA_KEY.NAMED_TAG,
+ (m: interfaces.Metadata) => m.key === METADATA_KEY.NAMED_TAG,
)[0] as interfaces.Metadata;
}
return null;
@@ -89,8 +91,10 @@ class Target implements interfaces.Target {
public getCustomTags(): interfaces.Metadata[] | null {
if (this.isTagged()) {
- return this.metadata.filter((metadata) =>
- METADATA_KEY.NON_CUSTOM_TAG_KEYS.every((key) => metadata.key !== key),
+ return this.metadata.filter((metadata: interfaces.Metadata) =>
+ METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(
+ (key: string) => metadata.key !== key,
+ ),
);
} else {
return null;
diff --git a/src/resolution/instantiation.ts b/src/resolution/instantiation.ts
index 66f9a1d96..a435aa42f 100644
--- a/src/resolution/instantiation.ts
+++ b/src/resolution/instantiation.ts
@@ -29,9 +29,9 @@ function _resolveRequests(
resolveRequest: interfaces.ResolveRequestHandler,
): ResolvedRequests {
return childRequests.reduce(
- (resolvedRequests, childRequest) => {
- const injection = resolveRequest(childRequest);
- const targetType = childRequest.target.type;
+ (resolvedRequests: ResolvedRequests, childRequest: interfaces.Request) => {
+ const injection: unknown = resolveRequest(childRequest);
+ const targetType: interfaces.TargetType = childRequest.target.type;
if (targetType === TargetTypeEnum.ConstructorArgument) {
resolvedRequests.constructorInjections.push(injection);
} else {
@@ -45,9 +45,9 @@ function _resolveRequests(
},
{
constructorInjections: [],
+ isAsync: false,
propertyInjections: [],
propertyRequests: [],
- isAsync: false,
},
);
}
@@ -60,7 +60,10 @@ function _createInstance(
let result: T | Promise;
if (childRequests.length > 0) {
- const resolved = _resolveRequests(childRequests, resolveRequest);
+ const resolved: ResolvedRequests = _resolveRequests(
+ childRequests,
+ resolveRequest,
+ );
const createInstanceWithInjectionsArg: CreateInstanceWithInjectionArg