diff --git a/LICENSE b/LICENSE index f37143a9..eb8ddae5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2021-2023 uid11 +Copyright (c) 2021-2023 SIA Joom Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/package-lock.json b/package-lock.json index 8038a140..71295f1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "bin-v8-flags-filter": "1.2.0", "create-locator": "0.0.17", - "get-modules-graph": "0.0.8", + "get-modules-graph": "0.0.9", "globby": "11.1.0", "pngjs": "7.0.0", "testcafe-without-typecheck": "3.3.0-rc.1" @@ -21,12 +21,12 @@ "e2ed-init": "bin/init.js" }, "devDependencies": { - "@types/node": "20.6.3", - "@typescript-eslint/eslint-plugin": "6.7.2", - "@typescript-eslint/parser": "6.7.2", + "@types/node": "20.8.4", + "@typescript-eslint/eslint-plugin": "6.7.5", + "@typescript-eslint/parser": "6.7.5", "assert-modules-support-case-insensitive-fs": "1.0.1", "assert-package-lock-is-consistent": "1.0.0", - "eslint": "8.50.0", + "eslint": "8.51.0", "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-import": "2.28.1", @@ -1983,9 +1983,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1998,9 +1998,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2159,27 +2159,30 @@ "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" }, "node_modules/@types/node": { - "version": "20.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", - "integrity": "sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==" + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dependencies": { + "undici-types": "~5.25.1" + } }, "node_modules/@types/semver": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", - "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", - "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz", + "integrity": "sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/type-utils": "6.7.2", - "@typescript-eslint/utils": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/type-utils": "6.7.5", + "@typescript-eslint/utils": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2205,15 +2208,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", - "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.5.tgz", + "integrity": "sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/typescript-estree": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4" }, "engines": { @@ -2233,13 +2236,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", - "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2250,13 +2253,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", - "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz", + "integrity": "sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.2", - "@typescript-eslint/utils": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/utils": "6.7.5", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2277,9 +2280,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", - "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2290,13 +2293,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", - "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2338,17 +2341,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", - "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.5.tgz", + "integrity": "sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", "semver": "^7.5.4" }, "engines": { @@ -2363,12 +2366,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", - "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3416,15 +3419,15 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3764,9 +3767,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -4168,9 +4171,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "engines": { "node": "*" } @@ -4191,11 +4194,11 @@ } }, "node_modules/get-modules-graph": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/get-modules-graph/-/get-modules-graph-0.0.8.tgz", - "integrity": "sha512-kZlBKdGL1H6tpSQQZ/LW1bGtDda5MWfmXLqpe1zkpfEIZjI2gFg/0ioq0Oyn0XGmxFFqBnB2aEurwJkurlQ6Sw==", + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/get-modules-graph/-/get-modules-graph-0.0.9.tgz", + "integrity": "sha512-zZCHo4c5bVTq/2ZiqH12u/3Jkky4tE0pt4A0kvdYVkJEUNyB8MYwDVKWzSG4A2dm69yn6rroi0PB9jlzbf9p7A==", "dependencies": { - "parse-imports-exports": "0.0.7" + "parse-imports-exports": "0.0.9" } }, "node_modules/get-os-info": { @@ -5544,17 +5547,17 @@ } }, "node_modules/parse-imports-exports": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.0.7.tgz", - "integrity": "sha512-kl10hJnO4F31n1o2kEFXhABCgWz0TR8SmBNoFSKxZDp/RJ40fxTrjukv6y59+lV1HKgGI8jJYI2B29fsoonn4A==", + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.0.9.tgz", + "integrity": "sha512-P2fgFpx+V4op0ouqsvVh8WyF0f9qfHgiDX2Rl59HMeegiqTT0NjceD4RTcce/OHll5jWnIpEmIadrtDjtaMDmA==", "dependencies": { - "parse-statements": "0.0.10" + "parse-statements": "1.0.3" } }, "node_modules/parse-statements": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-0.0.10.tgz", - "integrity": "sha512-jl7vmWl2xh+7Ri8qATOjiryONNCyk3LxyxqYc+Nb9xL2MnrRhBkLlDAyYHqVwwtFYW+Qy0xs+vc39XXN7uTb8w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.3.tgz", + "integrity": "sha512-Vhjj+k5vdcqizTe2YTTWROCWtZdU9koyET8dpsdxgNh8ohENBaPuivN6TV0VhsIw0tOPf/EU5mbD3YHqn2VBHQ==" }, "node_modules/parse5": { "version": "1.5.1", @@ -7229,6 +7232,11 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -8879,9 +8887,9 @@ }, "dependencies": { "globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -8890,9 +8898,9 @@ } }, "@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true }, "@humanwhocodes/config-array": { @@ -9017,27 +9025,30 @@ "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" }, "@types/node": { - "version": "20.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", - "integrity": "sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==" + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "requires": { + "undici-types": "~5.25.1" + } }, "@types/semver": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", - "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", - "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz", + "integrity": "sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/type-utils": "6.7.2", - "@typescript-eslint/utils": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/type-utils": "6.7.5", + "@typescript-eslint/utils": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -9047,54 +9058,54 @@ } }, "@typescript-eslint/parser": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", - "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.5.tgz", + "integrity": "sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/typescript-estree": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", - "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "requires": { - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" } }, "@typescript-eslint/type-utils": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", - "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz", + "integrity": "sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.7.2", - "@typescript-eslint/utils": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/utils": "6.7.5", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", - "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", - "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "requires": { - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/visitor-keys": "6.7.2", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -9120,27 +9131,27 @@ } }, "@typescript-eslint/utils": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", - "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.5.tgz", + "integrity": "sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.2", - "@typescript-eslint/types": "6.7.2", - "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", - "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "requires": { - "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" } }, @@ -9910,15 +9921,15 @@ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -10024,9 +10035,9 @@ } }, "globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -10474,9 +10485,9 @@ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" }, "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==" }, "get-intrinsic": { "version": "1.2.1", @@ -10491,11 +10502,11 @@ } }, "get-modules-graph": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/get-modules-graph/-/get-modules-graph-0.0.8.tgz", - "integrity": "sha512-kZlBKdGL1H6tpSQQZ/LW1bGtDda5MWfmXLqpe1zkpfEIZjI2gFg/0ioq0Oyn0XGmxFFqBnB2aEurwJkurlQ6Sw==", + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/get-modules-graph/-/get-modules-graph-0.0.9.tgz", + "integrity": "sha512-zZCHo4c5bVTq/2ZiqH12u/3Jkky4tE0pt4A0kvdYVkJEUNyB8MYwDVKWzSG4A2dm69yn6rroi0PB9jlzbf9p7A==", "requires": { - "parse-imports-exports": "0.0.7" + "parse-imports-exports": "0.0.9" } }, "get-os-info": { @@ -11450,17 +11461,17 @@ } }, "parse-imports-exports": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.0.7.tgz", - "integrity": "sha512-kl10hJnO4F31n1o2kEFXhABCgWz0TR8SmBNoFSKxZDp/RJ40fxTrjukv6y59+lV1HKgGI8jJYI2B29fsoonn4A==", + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.0.9.tgz", + "integrity": "sha512-P2fgFpx+V4op0ouqsvVh8WyF0f9qfHgiDX2Rl59HMeegiqTT0NjceD4RTcce/OHll5jWnIpEmIadrtDjtaMDmA==", "requires": { - "parse-statements": "0.0.10" + "parse-statements": "1.0.3" } }, "parse-statements": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-0.0.10.tgz", - "integrity": "sha512-jl7vmWl2xh+7Ri8qATOjiryONNCyk3LxyxqYc+Nb9xL2MnrRhBkLlDAyYHqVwwtFYW+Qy0xs+vc39XXN7uTb8w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.3.tgz", + "integrity": "sha512-Vhjj+k5vdcqizTe2YTTWROCWtZdU9koyET8dpsdxgNh8ohENBaPuivN6TV0VhsIw0tOPf/EU5mbD3YHqn2VBHQ==" }, "parse5": { "version": "1.5.1", @@ -12774,6 +12785,11 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" }, + "undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index 285f8e29..660afa9a 100644 --- a/package.json +++ b/package.json @@ -26,18 +26,18 @@ "dependencies": { "bin-v8-flags-filter": "1.2.0", "create-locator": "0.0.17", - "get-modules-graph": "0.0.8", + "get-modules-graph": "0.0.9", "globby": "11.1.0", "pngjs": "7.0.0", "testcafe-without-typecheck": "3.3.0-rc.1" }, "devDependencies": { - "@types/node": "20.6.3", - "@typescript-eslint/eslint-plugin": "6.7.2", - "@typescript-eslint/parser": "6.7.2", + "@types/node": "20.8.4", + "@typescript-eslint/eslint-plugin": "6.7.5", + "@typescript-eslint/parser": "6.7.5", "assert-modules-support-case-insensitive-fs": "1.0.1", "assert-package-lock-is-consistent": "1.0.0", - "eslint": "8.50.0", + "eslint": "8.51.0", "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-import": "2.28.1", diff --git a/src/getModulesGraph.ts b/src/getModulesGraph.ts index 1d243ecb..ccebdd92 100644 --- a/src/getModulesGraph.ts +++ b/src/getModulesGraph.ts @@ -1,2 +1,2 @@ -export type {Graph, Module, Package} from 'get-modules-graph'; +export type {Graph, Module, Options, Package} from 'get-modules-graph'; export {getModulesGraph, resolveImports, resolveReexports} from 'get-modules-graph'; diff --git a/src/types/index.ts b/src/types/index.ts index f237e154..2b46ecc5 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -27,7 +27,7 @@ export type { PageClassType, PageClassTypeArgs, } from './pages'; -export type {TestFilePath} from './paths'; +export type {FilePathFromRoot, TestFilePath} from './paths'; export type {AsyncVoid, MaybePromise, UnwrapPromise} from './promise'; export type {LiteReport, LiteRetry} from './report'; export type { diff --git a/src/types/utils.ts b/src/types/utils.ts index 05a0b284..252692be 100644 --- a/src/types/utils.ts +++ b/src/types/utils.ts @@ -7,9 +7,9 @@ import type {IsIncludeUndefined} from './undefined'; declare const PARAMS_KEY: unique symbol; /** - * Entry pair that Object.entries(T) returns. + * Entry pair that `Object.entries` returns. */ -type EntryPair = [keyof T, Values | undefined]; +type EntryPair = [key: keyof Type, value: Values | undefined]; /** * Alias for type any (to suppress the @typescript-eslint/no-explicit-any rule). @@ -20,48 +20,48 @@ export type Any = any; /** * Returns the type of instance params. */ -export type GetParamsType = C extends {[PARAMS_KEY]: unknown} - ? Normalize +export type GetParamsType = Class extends {[PARAMS_KEY]: unknown} + ? Normalize : never; /** * Returns `true` if type is an array (or tuple) of given element's type, and `false` otherwise. - * IsArray<[]> = true. - * IsArray<[true, false]> = true. - * IsArray = true. - * IsArray<[1, 2], string> = false. - * IsArray = true. + * `IsArray<[]>` = `true`. + * `IsArray<[true, false]>` = `true`. + * `IsArray` = `true`. + * `IsArray<[1, 2], string>` = `false`. + * `IsArray` = `true`. */ -export type IsArray = T extends readonly E[] ? true : false; +export type IsArray = Type extends readonly Element[] ? true : false; /** * Returns a copy of the object type with mutable properties. - * Mutable<{readonly foo: string}> = {foo: string}. + * `Mutable<{readonly foo: string}>` = `{foo: string}`. */ -export type Mutable = { - -readonly [K in keyof T]: T[K]; +export type Mutable = { + -readonly [Key in keyof Type]: Type[Key]; }; /** * Normalizes intersection of types. - * Normalize<{foo: string} & {bar: number}> = {foo: string, bar: number}. + * `Normalize<{foo: string} & {bar: number}>` = `{foo: string, bar: number}`. */ -export type Normalize = keyof T extends never - ? T - : IsBrand extends true - ? T - : {[K in keyof T]: Normalize}; +export type Normalize = keyof Type extends never + ? Type + : IsBrand extends true + ? Type + : {[Key in keyof Type]: Normalize}; /** - * List of pairs that Object.entries(T) returns. + * List of pairs that `Object.entries` returns. */ -export type ObjectEntries = EntryPair[]; +export type ObjectEntries = EntryPair[]; /** * Returns a tuple of two elements. If the second element includes `undefined`, * then it becomes optional in the tuple. - * OneOrTwoArgs<'foo', string> = [arg1: 'foo', arg2: string]. - * OneOrTwoArgs<'foo', undefined | number> = [arg1: 'foo', arg2?: number]. + * `OneOrTwoArgs<'foo', string>` = `[arg1: 'foo', arg2: string]`. + * `OneOrTwoArgs<'foo', undefined | number>` = `[arg1: 'foo', arg2?: number]`. */ export type OneOrTwoArgs = IsIncludeUndefined extends true ? [arg1: Arg1, arg2?: Arg2] @@ -70,10 +70,10 @@ export type OneOrTwoArgs = IsIncludeUndefined extends true /** * The property value will be optional if its default value * is included in the set of possible values. - * OptionalIfValueIncludeDefault<'foo', 1 | 2, 2> = {foo?: 1 | 2}. - * OptionalIfValueIncludeDefault<'foo', 1 | 2, 3> = {foo: 1 | 2}. - * OptionalIfValueIncludeDefault<'foo', {bar?: string}, {}> = {foo?: {bar?: string}}. - * OptionalIfValueIncludeDefault<'foo', {bar: string}, {}> = {foo: {bar: string}}. + * `OptionalIfValueIncludeDefault<'foo', 1 | 2, 2>` = `{foo?: 1 | 2}`. + * `OptionalIfValueIncludeDefault<'foo', 1 | 2, 3>` = `{foo: 1 | 2}`. + * `OptionalIfValueIncludeDefault<'foo', {bar?: string}, {}>` = `{foo?: {bar?: string}}`. + * `OptionalIfValueIncludeDefault<'foo', {bar: string}, {}>` = `{foo: {bar: string}}`. */ export type OptionalIfValueIncludeDefault< Key extends string, @@ -88,37 +88,37 @@ export type PARAMS_KEY_TYPE = typeof PARAMS_KEY; /** * Takes a union, and returns the intersection of the elements of the union. - * UnionToIntersection<((x: string) => number) | ((x: number) => string)> = - * ((x: string) => number) & ((x: number) => string) + * `UnionToIntersection<((x: string) => number) | ((x: number) => string)>` = + * `((x: string) => number) & ((x: number) => string)` */ -export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends ( - k: infer I, -) => void - ? I +export type UnionToIntersection = ( + Union extends unknown ? (arg: Union) => void : never +) extends (arg: infer Intersection) => void + ? Intersection : never; /** * If the type is a set, unwraps it and returns the set value type. - * UnwrapSet = number. - * UnwrapSet> = string. + * `UnwrapSet` = `number`. + * `UnwrapSet>` = `string`. */ -export type UnwrapSet = T extends Set ? V : T; +export type UnwrapSet = Type extends Set ? Value : Type; /** - * Values of all properties of type T. - * Values<{foo: 1, bar: 2}> = 1 | 2. - * Values<[1, 2], true> = 1 | 2. + * Values of all properties of type `Type`. + * `Values<{foo: 1, bar: 2}>` = `1 | 2`. + * `Values<[1, 2], true>` = `1 | 2`. */ -export type Values = WithArrays extends true - ? T extends readonly unknown[] - ? T[number] - : T[keyof T] - : T[keyof T]; +export type Values = WithArrays extends true + ? Type extends readonly unknown[] + ? Type[number] + : Type[keyof Type] + : Type[keyof Type]; /** * Returns a tuple of one element. If the element includes `undefined`, * then it becomes optional in the tuple. - * ZeroOrOneArg = [arg: string]. - * ZeroOrOneArg = [arg?: number]. + * `ZeroOrOneArg` = `[arg: string]`. + * `ZeroOrOneArg` = `[arg?: number]`. */ export type ZeroOrOneArg = IsIncludeUndefined extends true ? [arg?: Arg] : [arg: Arg]; diff --git a/src/utils/deepMerge.ts b/src/utils/deepMerge.ts index 850655c4..417177ae 100644 --- a/src/utils/deepMerge.ts +++ b/src/utils/deepMerge.ts @@ -5,10 +5,10 @@ import type {DeepPartial, ObjectEntries, Values} from '../types/internal'; /** * Deep merge two objects (arrays does not merge). - * y overwrites x; x and y are immutable. + * `y` overwrites `x`; `x` and `y` are immutable. */ -export const deepMerge = (x: T, y: DeepPartial): T => { - const result = {} as T; +export const deepMerge = (x: Type, y: DeepPartial): Type => { + const result = {} as Type; for (const key of Object.keys(x)) { const descriptor = Object.getOwnPropertyDescriptor(x, key); @@ -18,9 +18,9 @@ export const deepMerge = (x: T, y: DeepPartial): T => { Object.defineProperty(result, key, descriptor); } - for (const [key, value] of Object.entries(y) as ObjectEntries) { + for (const [key, value] of Object.entries(y) as ObjectEntries) { if (isObjectAndNotAnArray(x[key]) && isObjectAndNotAnArray(value)) { - result[key] = deepMerge(x[key] as object, value) as Values; + result[key] = deepMerge(x[key] as object, value) as Values; } else { const descriptor = Object.getOwnPropertyDescriptor(y, key); diff --git a/src/utils/report/client/render/renderDuration.ts b/src/utils/report/client/render/renderDuration.ts index ae42a45e..9759d1f4 100644 --- a/src/utils/report/client/render/renderDuration.ts +++ b/src/utils/report/client/render/renderDuration.ts @@ -1,19 +1,35 @@ -import {sanitizeHtml as clientSanitizeHtml} from '../sanitizeHtml'; +import {createSafeHtmlWithoutSanitize as clientCreateSafeHtmlWithoutSanitize} from '../sanitizeHtml'; import type {SafeHtml} from '../../../../types/internal'; -const sanitizeHtml = clientSanitizeHtml; +const createSafeHtmlWithoutSanitize = clientCreateSafeHtmlWithoutSanitize; /** - * Renders the duration of time interval in minutes and seconds. + * Renders the duration of time interval in hours, minutes, seconds and milliseconds. * This base client function should not use scope variables (except other base functions). * @internal */ -export function renderDuration(durationMs: number): SafeHtml { - const durationInSeconds = Math.round(durationMs / 1000); - const minutes = Math.floor(durationInSeconds / 60); - const minutesString = minutes === 0 ? '' : `${minutes}m `; - const secondsString = `${durationInSeconds % 60}s`; +export function renderDuration(durationInMs: number): SafeHtml { + const remainderInMs = durationInMs % 1000; + const durationInSeconds = Math.round((durationInMs - remainderInMs) / 1000); + const remainderInSeconds = durationInSeconds % 60; + const durationInMinutes = Math.round((durationInSeconds - remainderInSeconds) / 60); + const remainderInMinutes = durationInMinutes % 60; + const durationInHours = Math.round((durationInMinutes - remainderInMinutes) / 60); - return sanitizeHtml`${minutesString}${secondsString}`; + const parts: string[] = [`${remainderInMs}ms`]; + + if (remainderInSeconds > 0) { + parts.unshift(`${remainderInSeconds}s`); + } + + if (remainderInMinutes > 0) { + parts.unshift(`${remainderInMinutes}m`); + } + + if (durationInHours > 0) { + parts.unshift(`${durationInHours}h`); + } + + return createSafeHtmlWithoutSanitize`${parts.slice(-2).join(' ')}`; } diff --git a/src/utils/report/client/render/renderStep.ts b/src/utils/report/client/render/renderStep.ts index 70638882..2855f358 100644 --- a/src/utils/report/client/render/renderStep.ts +++ b/src/utils/report/client/render/renderStep.ts @@ -2,10 +2,12 @@ import {LogEventStatus, LogEventType} from '../../../../constants/internal'; import {sanitizeHtml as clientSanitizeHtml} from '../sanitizeHtml'; +import {renderDuration as clientRenderDuration} from './renderDuration'; import {renderStepContent as clientRenderStepContent} from './renderStepContent'; import type {LogEvent, ReportClientState, SafeHtml, UtcTimeInMs} from '../../../../types/internal'; +const renderDuration = clientRenderDuration; const renderStepContent = clientRenderStepContent; const sanitizeHtml = clientSanitizeHtml; @@ -23,7 +25,7 @@ type Options = Readonly<{ */ export function renderStep({logEvent, nextLogEventTime}: Options): SafeHtml { const {message, payload, time, type} = logEvent; - const durationMs = nextLogEventTime - time; + const durationInMs = nextLogEventTime - time; const status = payload?.logEventStatus ?? LogEventStatus.Passed; let pathToScreenshotFromReportPage: string | undefined; @@ -46,7 +48,7 @@ export function renderStep({logEvent, nextLogEventTime}: Options): SafeHtml { return sanitizeHtml` ${content} `; diff --git a/src/utils/report/client/render/renderTestRunDescription.ts b/src/utils/report/client/render/renderTestRunDescription.ts index 3ffdd311..a3d69042 100644 --- a/src/utils/report/client/render/renderTestRunDescription.ts +++ b/src/utils/report/client/render/renderTestRunDescription.ts @@ -23,7 +23,7 @@ const sanitizeHtml = clientSanitizeHtml; */ export function renderTestRunDescription(fullTestRun: FullTestRun): SafeHtml { const {endTimeInMs, startTimeInMs} = fullTestRun; - const durationMs = endTimeInMs - startTimeInMs; + const durationInMs = endTimeInMs - startTimeInMs; const {meta} = fullTestRun.options; const metaHtmls: SafeHtml[] = []; @@ -47,7 +47,7 @@ export function renderTestRunDescription(fullTestRun: FullTestRun): SafeHtml {
Duration
- ${renderDuration(durationMs)} + ${renderDuration(durationInMs)}
`; } diff --git a/src/utils/report/render/renderRetryHeader.ts b/src/utils/report/render/renderRetryHeader.ts index 52cacaca..064e4c84 100644 --- a/src/utils/report/render/renderRetryHeader.ts +++ b/src/utils/report/render/renderRetryHeader.ts @@ -11,12 +11,12 @@ export const renderRetryHeader = ({ retryIndex, startTimeInMs, }: RetryProps): SafeHtml => { - const durationMs = endTimeInMs - startTimeInMs; + const durationInMs = endTimeInMs - startTimeInMs; return sanitizeHtml`

Retry ${retryIndex}

${renderDatesInterval({endTimeInMs, startTimeInMs})} - (${renderDuration(durationMs)}) + (${renderDuration(durationInMs)})

`; }; diff --git a/src/utils/report/render/renderTestRunButton.ts b/src/utils/report/render/renderTestRunButton.ts index f0f379b5..4cd4c16a 100644 --- a/src/utils/report/render/renderTestRunButton.ts +++ b/src/utils/report/render/renderTestRunButton.ts @@ -1,4 +1,4 @@ -import {sanitizeHtml} from '../client'; +import {renderDuration, sanitizeHtml} from '../client'; import type {SafeHtml, TestRunButtonProps} from '../../../types/internal'; @@ -20,6 +20,6 @@ export const renderTestRunButton = ( > #${index + 1} ${name}${mainParams} - ${durationInMs}ms + ${renderDuration(durationInMs)} `; };