Lots of formula changes

Many tests fail and inverting integrals is basically non-functional because it just chains stuff
Will need to implement integration by parts and/or integration by substitution for that
This commit is contained in:
thepaperpilot 2023-02-04 17:56:05 -06:00
parent 3bc88dd3c2
commit 59347c7db4
4 changed files with 2148 additions and 392 deletions

774
package-lock.json generated
View file

@ -60,7 +60,7 @@
"jsdom": "^20.0.0",
"prettier": "^2.5.1",
"typescript": "4.8.4",
"vitest": "^0.26.3",
"vitest": "^0.27.3",
"vue-tsc": "^0.38.1"
},
"engines": {
@ -3339,6 +3339,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cac": {
"version": "6.7.14",
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
"integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
@ -5786,21 +5795,21 @@
}
},
"node_modules/mlly": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.0.0.tgz",
"integrity": "sha512-QL108Hwt+u9bXdWgOI0dhzZfACovn5Aen4Xvc8Jasd9ouRH4NjnrXEiyP3nVvJo91zPlYjVRckta0Nt2zfoR6g==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.1.0.tgz",
"integrity": "sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==",
"dev": true,
"dependencies": {
"acorn": "^8.8.1",
"pathe": "^1.0.0",
"pkg-types": "^1.0.0",
"ufo": "^1.0.0"
"pkg-types": "^1.0.1",
"ufo": "^1.0.1"
}
},
"node_modules/mlly/node_modules/pathe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz",
"integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz",
"integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==",
"dev": true
},
"node_modules/ms": {
@ -6079,9 +6088,9 @@
}
},
"node_modules/pkg-types/node_modules/pathe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz",
"integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz",
"integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==",
"dev": true
},
"node_modules/postcss": {
@ -6527,6 +6536,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/siginfo": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
"dev": true
},
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@ -6571,6 +6586,18 @@
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"deprecated": "Please use @jridgewell/sourcemap-codec instead"
},
"node_modules/stackback": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
"integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
"dev": true
},
"node_modules/std-env": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.1.tgz",
"integrity": "sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==",
"dev": true
},
"node_modules/string.prototype.matchall": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz",
@ -7152,14 +7179,16 @@
}
},
"node_modules/vite-node": {
"version": "0.26.3",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.26.3.tgz",
"integrity": "sha512-Te2bq0Bfvq6XiO718I+1EinMjpNYKws6SNHKOmVbILAQimKoZKDd+IZLlkaYcBXPpK3HFe2U80k8Zw+m3w/a2w==",
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.27.3.tgz",
"integrity": "sha512-eyJYOO64o5HIp8poc4bJX+ZNBwMZeI3f6/JdiUmJgW02Mt7LnoCtDMRVmLaY9S05SIsjGe339ZK4uo2wQ+bF9g==",
"dev": true,
"dependencies": {
"cac": "^6.7.14",
"debug": "^4.3.4",
"mlly": "^1.0.0",
"mlly": "^1.1.0",
"pathe": "^0.2.0",
"picocolors": "^1.0.0",
"source-map": "^0.6.1",
"source-map-support": "^0.5.21",
"vite": "^3.0.0 || ^4.0.0"
@ -7174,10 +7203,170 @@
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/vite-node/node_modules/@esbuild/android-arm": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
"integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/android-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
"integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/android-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
"integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/darwin-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
"integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/darwin-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
"integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
"integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/freebsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
"integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-arm": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
"integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
"integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-ia32": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
"integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-loong64": {
"version": "0.16.14",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.14.tgz",
"integrity": "sha512-udz/aEHTcuHP+xdWOJmZ5C9RQXHfZd/EhCnTi1Hfay37zH3lBxn/fNs85LA9HlsniFw2zccgcbrrTMKk7Cn1Qg==",
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
"integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
"cpu": [
"loong64"
],
@ -7190,10 +7379,186 @@
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-mips64el": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
"integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-ppc64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
"integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-riscv64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
"integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-s390x": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
"integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/linux-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
"integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/netbsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
"integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/openbsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
"integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/sunos-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
"integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/win32-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
"integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/win32-ia32": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
"integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/@esbuild/win32-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
"integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/vite-node/node_modules/esbuild": {
"version": "0.16.14",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.14.tgz",
"integrity": "sha512-6xAn3O6ZZyoxZAEkwfI9hw4cEqSr/o1ViJtnkvImVkblmUN65Md04o0S/7H1WNu1XGf1Cjij/on7VO4psIYjkw==",
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz",
"integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==",
"dev": true,
"hasInstallScript": true,
"bin": {
@ -7203,34 +7568,34 @@
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.16.14",
"@esbuild/android-arm64": "0.16.14",
"@esbuild/android-x64": "0.16.14",
"@esbuild/darwin-arm64": "0.16.14",
"@esbuild/darwin-x64": "0.16.14",
"@esbuild/freebsd-arm64": "0.16.14",
"@esbuild/freebsd-x64": "0.16.14",
"@esbuild/linux-arm": "0.16.14",
"@esbuild/linux-arm64": "0.16.14",
"@esbuild/linux-ia32": "0.16.14",
"@esbuild/linux-loong64": "0.16.14",
"@esbuild/linux-mips64el": "0.16.14",
"@esbuild/linux-ppc64": "0.16.14",
"@esbuild/linux-riscv64": "0.16.14",
"@esbuild/linux-s390x": "0.16.14",
"@esbuild/linux-x64": "0.16.14",
"@esbuild/netbsd-x64": "0.16.14",
"@esbuild/openbsd-x64": "0.16.14",
"@esbuild/sunos-x64": "0.16.14",
"@esbuild/win32-arm64": "0.16.14",
"@esbuild/win32-ia32": "0.16.14",
"@esbuild/win32-x64": "0.16.14"
"@esbuild/android-arm": "0.16.17",
"@esbuild/android-arm64": "0.16.17",
"@esbuild/android-x64": "0.16.17",
"@esbuild/darwin-arm64": "0.16.17",
"@esbuild/darwin-x64": "0.16.17",
"@esbuild/freebsd-arm64": "0.16.17",
"@esbuild/freebsd-x64": "0.16.17",
"@esbuild/linux-arm": "0.16.17",
"@esbuild/linux-arm64": "0.16.17",
"@esbuild/linux-ia32": "0.16.17",
"@esbuild/linux-loong64": "0.16.17",
"@esbuild/linux-mips64el": "0.16.17",
"@esbuild/linux-ppc64": "0.16.17",
"@esbuild/linux-riscv64": "0.16.17",
"@esbuild/linux-s390x": "0.16.17",
"@esbuild/linux-x64": "0.16.17",
"@esbuild/netbsd-x64": "0.16.17",
"@esbuild/openbsd-x64": "0.16.17",
"@esbuild/sunos-x64": "0.16.17",
"@esbuild/win32-arm64": "0.16.17",
"@esbuild/win32-ia32": "0.16.17",
"@esbuild/win32-x64": "0.16.17"
}
},
"node_modules/vite-node/node_modules/rollup": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.9.1.tgz",
"integrity": "sha512-GswCYHXftN8ZKGVgQhTFUJB/NBXxrRGgO2NCy6E8s1rwEJ4Q9/VttNqcYfEvx4dTo4j58YqdC3OVztPzlKSX8w==",
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.1.tgz",
"integrity": "sha512-3Er+yel3bZbZX1g2kjVM+FW+RUWDxbG87fcqFM5/9HbPCTpbVp6JOLn7jlxnNlbu7s/N/uDA4EV/91E2gWnxzw==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
@ -7328,9 +7693,9 @@
}
},
"node_modules/vitest": {
"version": "0.26.3",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.26.3.tgz",
"integrity": "sha512-FmHxU9aUCxTi23keF3vxb/Qp0lYXaaJ+jRLGOUmMS3qVTOJvgGE+f1VArupA6pEhaG2Ans4X+zV9dqM5WISMbg==",
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.27.3.tgz",
"integrity": "sha512-Ld3UVgRVhJUtqvQ3dW89GxiApFAgBsWJZBCWzK+gA3w2yG68csXlGZZ4WDJURf+8ecNfgrScga6xY+8YSOpiMg==",
"dev": true,
"dependencies": {
"@types/chai": "^4.3.4",
@ -7338,16 +7703,20 @@
"@types/node": "*",
"acorn": "^8.8.1",
"acorn-walk": "^8.2.0",
"cac": "^6.7.14",
"chai": "^4.3.7",
"debug": "^4.3.4",
"local-pkg": "^0.4.2",
"picocolors": "^1.0.0",
"source-map": "^0.6.1",
"std-env": "^3.3.1",
"strip-literal": "^1.0.0",
"tinybench": "^2.3.1",
"tinypool": "^0.3.0",
"tinyspy": "^1.0.2",
"vite": "^3.0.0 || ^4.0.0",
"vite-node": "0.26.3"
"vite-node": "0.27.3",
"why-is-node-running": "^2.2.2"
},
"bin": {
"vitest": "vitest.mjs"
@ -7760,6 +8129,22 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/why-is-node-running": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
"integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==",
"dev": true,
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
},
"bin": {
"why-is-node-running": "cli.js"
},
"engines": {
"node": ">=8"
}
},
"node_modules/word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
@ -10264,6 +10649,12 @@
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw=="
},
"cac": {
"version": "6.7.14",
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
"integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
"dev": true
},
"call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
@ -11926,21 +12317,21 @@
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
},
"mlly": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.0.0.tgz",
"integrity": "sha512-QL108Hwt+u9bXdWgOI0dhzZfACovn5Aen4Xvc8Jasd9ouRH4NjnrXEiyP3nVvJo91zPlYjVRckta0Nt2zfoR6g==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.1.0.tgz",
"integrity": "sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==",
"dev": true,
"requires": {
"acorn": "^8.8.1",
"pathe": "^1.0.0",
"pkg-types": "^1.0.0",
"ufo": "^1.0.0"
"pkg-types": "^1.0.1",
"ufo": "^1.0.1"
},
"dependencies": {
"pathe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz",
"integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz",
"integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==",
"dev": true
}
}
@ -12152,9 +12543,9 @@
},
"dependencies": {
"pathe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz",
"integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz",
"integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==",
"dev": true
}
}
@ -12447,6 +12838,12 @@
"object-inspect": "^1.9.0"
}
},
"siginfo": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
"dev": true
},
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@ -12481,6 +12878,18 @@
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
},
"stackback": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
"integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
"dev": true
},
"std-env": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.1.tgz",
"integrity": "sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==",
"dev": true
},
"string.prototype.matchall": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz",
@ -12887,60 +13296,209 @@
}
},
"vite-node": {
"version": "0.26.3",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.26.3.tgz",
"integrity": "sha512-Te2bq0Bfvq6XiO718I+1EinMjpNYKws6SNHKOmVbILAQimKoZKDd+IZLlkaYcBXPpK3HFe2U80k8Zw+m3w/a2w==",
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.27.3.tgz",
"integrity": "sha512-eyJYOO64o5HIp8poc4bJX+ZNBwMZeI3f6/JdiUmJgW02Mt7LnoCtDMRVmLaY9S05SIsjGe339ZK4uo2wQ+bF9g==",
"dev": true,
"requires": {
"cac": "^6.7.14",
"debug": "^4.3.4",
"mlly": "^1.0.0",
"mlly": "^1.1.0",
"pathe": "^0.2.0",
"picocolors": "^1.0.0",
"source-map": "^0.6.1",
"source-map-support": "^0.5.21",
"vite": "^3.0.0 || ^4.0.0"
},
"dependencies": {
"@esbuild/android-arm": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
"integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
"dev": true,
"optional": true
},
"@esbuild/android-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
"integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
"dev": true,
"optional": true
},
"@esbuild/android-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
"integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
"dev": true,
"optional": true
},
"@esbuild/darwin-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
"integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
"dev": true,
"optional": true
},
"@esbuild/darwin-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
"integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
"dev": true,
"optional": true
},
"@esbuild/freebsd-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
"integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
"dev": true,
"optional": true
},
"@esbuild/freebsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
"integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
"dev": true,
"optional": true
},
"@esbuild/linux-arm": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
"integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
"dev": true,
"optional": true
},
"@esbuild/linux-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
"integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
"dev": true,
"optional": true
},
"@esbuild/linux-ia32": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
"integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
"dev": true,
"optional": true
},
"@esbuild/linux-loong64": {
"version": "0.16.14",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.14.tgz",
"integrity": "sha512-udz/aEHTcuHP+xdWOJmZ5C9RQXHfZd/EhCnTi1Hfay37zH3lBxn/fNs85LA9HlsniFw2zccgcbrrTMKk7Cn1Qg==",
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
"integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
"dev": true,
"optional": true
},
"@esbuild/linux-mips64el": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
"integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
"dev": true,
"optional": true
},
"@esbuild/linux-ppc64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
"integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
"dev": true,
"optional": true
},
"@esbuild/linux-riscv64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
"integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
"dev": true,
"optional": true
},
"@esbuild/linux-s390x": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
"integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
"dev": true,
"optional": true
},
"@esbuild/linux-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
"integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
"dev": true,
"optional": true
},
"@esbuild/netbsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
"integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
"dev": true,
"optional": true
},
"@esbuild/openbsd-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
"integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
"dev": true,
"optional": true
},
"@esbuild/sunos-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
"integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
"dev": true,
"optional": true
},
"@esbuild/win32-arm64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
"integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
"dev": true,
"optional": true
},
"@esbuild/win32-ia32": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
"integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
"dev": true,
"optional": true
},
"@esbuild/win32-x64": {
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
"integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
"dev": true,
"optional": true
},
"esbuild": {
"version": "0.16.14",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.14.tgz",
"integrity": "sha512-6xAn3O6ZZyoxZAEkwfI9hw4cEqSr/o1ViJtnkvImVkblmUN65Md04o0S/7H1WNu1XGf1Cjij/on7VO4psIYjkw==",
"version": "0.16.17",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz",
"integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==",
"dev": true,
"requires": {
"@esbuild/android-arm": "0.16.14",
"@esbuild/android-arm64": "0.16.14",
"@esbuild/android-x64": "0.16.14",
"@esbuild/darwin-arm64": "0.16.14",
"@esbuild/darwin-x64": "0.16.14",
"@esbuild/freebsd-arm64": "0.16.14",
"@esbuild/freebsd-x64": "0.16.14",
"@esbuild/linux-arm": "0.16.14",
"@esbuild/linux-arm64": "0.16.14",
"@esbuild/linux-ia32": "0.16.14",
"@esbuild/linux-loong64": "0.16.14",
"@esbuild/linux-mips64el": "0.16.14",
"@esbuild/linux-ppc64": "0.16.14",
"@esbuild/linux-riscv64": "0.16.14",
"@esbuild/linux-s390x": "0.16.14",
"@esbuild/linux-x64": "0.16.14",
"@esbuild/netbsd-x64": "0.16.14",
"@esbuild/openbsd-x64": "0.16.14",
"@esbuild/sunos-x64": "0.16.14",
"@esbuild/win32-arm64": "0.16.14",
"@esbuild/win32-ia32": "0.16.14",
"@esbuild/win32-x64": "0.16.14"
"@esbuild/android-arm": "0.16.17",
"@esbuild/android-arm64": "0.16.17",
"@esbuild/android-x64": "0.16.17",
"@esbuild/darwin-arm64": "0.16.17",
"@esbuild/darwin-x64": "0.16.17",
"@esbuild/freebsd-arm64": "0.16.17",
"@esbuild/freebsd-x64": "0.16.17",
"@esbuild/linux-arm": "0.16.17",
"@esbuild/linux-arm64": "0.16.17",
"@esbuild/linux-ia32": "0.16.17",
"@esbuild/linux-loong64": "0.16.17",
"@esbuild/linux-mips64el": "0.16.17",
"@esbuild/linux-ppc64": "0.16.17",
"@esbuild/linux-riscv64": "0.16.17",
"@esbuild/linux-s390x": "0.16.17",
"@esbuild/linux-x64": "0.16.17",
"@esbuild/netbsd-x64": "0.16.17",
"@esbuild/openbsd-x64": "0.16.17",
"@esbuild/sunos-x64": "0.16.17",
"@esbuild/win32-arm64": "0.16.17",
"@esbuild/win32-ia32": "0.16.17",
"@esbuild/win32-x64": "0.16.17"
}
},
"rollup": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.9.1.tgz",
"integrity": "sha512-GswCYHXftN8ZKGVgQhTFUJB/NBXxrRGgO2NCy6E8s1rwEJ4Q9/VttNqcYfEvx4dTo4j58YqdC3OVztPzlKSX8w==",
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.10.1.tgz",
"integrity": "sha512-3Er+yel3bZbZX1g2kjVM+FW+RUWDxbG87fcqFM5/9HbPCTpbVp6JOLn7jlxnNlbu7s/N/uDA4EV/91E2gWnxzw==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
@ -12986,9 +13544,9 @@
}
},
"vitest": {
"version": "0.26.3",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.26.3.tgz",
"integrity": "sha512-FmHxU9aUCxTi23keF3vxb/Qp0lYXaaJ+jRLGOUmMS3qVTOJvgGE+f1VArupA6pEhaG2Ans4X+zV9dqM5WISMbg==",
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.27.3.tgz",
"integrity": "sha512-Ld3UVgRVhJUtqvQ3dW89GxiApFAgBsWJZBCWzK+gA3w2yG68csXlGZZ4WDJURf+8ecNfgrScga6xY+8YSOpiMg==",
"dev": true,
"requires": {
"@types/chai": "^4.3.4",
@ -12996,16 +13554,20 @@
"@types/node": "*",
"acorn": "^8.8.1",
"acorn-walk": "^8.2.0",
"cac": "^6.7.14",
"chai": "^4.3.7",
"debug": "^4.3.4",
"local-pkg": "^0.4.2",
"picocolors": "^1.0.0",
"source-map": "^0.6.1",
"std-env": "^3.3.1",
"strip-literal": "^1.0.0",
"tinybench": "^2.3.1",
"tinypool": "^0.3.0",
"tinyspy": "^1.0.2",
"vite": "^3.0.0 || ^4.0.0",
"vite-node": "0.26.3"
"vite-node": "0.27.3",
"why-is-node-running": "^2.2.2"
},
"dependencies": {
"@esbuild/linux-loong64": {
@ -13270,6 +13832,16 @@
"is-symbol": "^1.0.3"
}
},
"why-is-node-running": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
"integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==",
"dev": true,
"requires": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
}
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",

View file

@ -66,7 +66,7 @@
"jsdom": "^20.0.0",
"prettier": "^2.5.1",
"typescript": "4.8.4",
"vitest": "^0.26.3",
"vitest": "^0.27.3",
"vue-tsc": "^0.38.1"
},
"engines": {

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,13 @@
import Formula, { GenericFormula, InvertibleFormula, unrefFormulaSource } from "game/formulas";
import { createResource, Resource } from "features/resources/resource";
import Formula, {
calculateMaxAffordable,
GenericFormula,
InvertibleFormula,
unrefFormulaSource
} from "game/formulas";
import Decimal, { DecimalSource, format } from "util/bignum";
import { beforeAll, describe, expect, test } from "vitest";
import { Ref, ref } from "vue";
import { ref } from "vue";
type FormulaFunctions = keyof GenericFormula & keyof typeof Formula & keyof typeof Decimal;
@ -43,98 +49,6 @@ declare global {
}
}
function testConstant(
desc: string,
formulaFunc: () => InvertibleFormula,
expectedValue: DecimalSource = 10
) {
describe(desc, () => {
let formula: GenericFormula;
beforeAll(() => {
formula = formulaFunc();
});
test("Evaluates correctly", () =>
expect(formula.evaluate()).compare_tolerance(expectedValue));
test("Invert is pass-through", () => expect(formula.invert(25)).compare_tolerance(25));
test("Is not marked as having a variable", () => expect(formula.hasVariable()).toBe(false));
});
}
function testFormula<T extends FormulaFunctions>(
functionName: T,
args: Readonly<Parameters<typeof Formula[T]>>,
invertible = true
) {
let formula: GenericFormula;
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
formula = Formula[functionName](...args);
});
test("Formula is not marked as having a variable", () =>
expect(formula.hasVariable()).toBe(false));
test(`Formula is${invertible ? "" : " not"} invertible`, () =>
expect(formula.isInvertible()).toBe(invertible));
if (invertible) {
test(`Formula throws if inverting without any variables`, () =>
expect(() => formula.invert(10)).toThrow());
}
}
// Utility function that will test all the different
// It's a lot of tests, but I'd rather be exhaustive
function testFormulaCall<T extends FormulaFunctions>(
functionName: T,
args: Readonly<Parameters<typeof Formula[T]>>
) {
let testName = functionName + "(";
for (let i = 0; i < args.length; i++) {
if (i !== 0) {
testName += ", ";
}
testName += args[i];
}
testName += ") evaluates correctly";
test(testName, () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const formula = Formula[functionName](...args);
try {
const expectedEvaluation = Decimal[functionName](
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...args.map(i => unrefFormulaSource(i))
);
if (expectedEvaluation != null) {
expect(formula.evaluate()).compare_tolerance(expectedEvaluation);
}
} catch {
// If this is an invalid Decimal operation, then ignore this test case
}
});
}
function testAliases<T extends FormulaFunctions>(
aliases: T[],
args: Parameters<typeof Formula[T]>
) {
describe(aliases[0], () => {
let formula: GenericFormula;
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
formula = Formula[aliases[0]](...args);
});
aliases.slice(1).forEach(alias => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
test(alias, () => expect(Formula[alias](...args).equals(formula)).toBe(true));
});
});
}
const testValues = ["-1e400", 0, 0.25] as const;
const invertibleZeroParamFunctionNames = [
@ -164,7 +78,6 @@ const invertibleZeroParamFunctionNames = [
"acosh",
"atanh"
] as const;
const nonInvertibleZeroParamFunctionNames = [
"abs",
"sign",
@ -178,6 +91,64 @@ const nonInvertibleZeroParamFunctionNames = [
"gamma",
"lngamma"
] as const;
const integrableZeroParamFunctionNames = [
"neg",
"recip",
"log10",
"log2",
"ln",
"pow10",
"exp",
"sqr",
"sqrt",
"cube",
"cbrt",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"sinh",
"cosh",
"tanh",
"asinh",
"acosh",
"atanh"
] as const;
const nonIntegrableZeroParamFunctionNames = [
...nonInvertibleZeroParamFunctionNames,
"lambertw",
"ssqrt"
] as const;
const invertibleIntegralZeroPramFunctionNames = [
"recip",
"log10",
"log2",
"ln",
"pow10",
"sqr",
"sqrt",
"cube",
"cbrt"
] as const;
const nonInvertibleIntegralZeroPramFunctionNames = [
...nonIntegrableZeroParamFunctionNames,
"neg",
"exp",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"sinh",
"cosh",
"tanh",
"asinh",
"acosh",
"atanh"
] as const;
const invertibleOneParamFunctionNames = [
"add",
@ -189,7 +160,6 @@ const invertibleOneParamFunctionNames = [
"root",
"slog"
] as const;
const nonInvertibleOneParamFunctionNames = [
"max",
"min",
@ -199,10 +169,18 @@ const nonInvertibleOneParamFunctionNames = [
"clampMax",
"layeradd10"
] as const;
const integrableOneParamFunctionNames = ["add", "sub", "mul", "div", "log", "pow", "root"] as const;
const nonIntegrableOneParamFunctionNames = [...nonInvertibleOneParamFunctionNames, "slog"] as const;
const invertibleIntegralOneParamFunctionNames = integrableOneParamFunctionNames;
const nonInvertibleIntegralOneParamFunctionNames = nonIntegrableOneParamFunctionNames;
const invertibleTwoParamFunctionNames = ["tetrate", "layeradd", "iteratedexp"] as const;
const nonInvertibleTwoParamFunctionNames = ["clamp", "iteratedlog", "pentate"] as const;
const nonIntegrableTwoParamFunctionNames = [
...invertibleTwoParamFunctionNames,
...nonInvertibleZeroParamFunctionNames
];
const nonInvertibleIntegralTwoParamFunctionNames = nonIntegrableTwoParamFunctionNames;
describe("Formula Equality Checking", () => {
describe("Equality Checks", () => {
@ -214,6 +192,25 @@ describe("Formula Equality Checking", () => {
});
describe("Formula aliases", () => {
function testAliases<T extends FormulaFunctions>(
aliases: T[],
args: Parameters<typeof Formula[T]>
) {
describe(aliases[0], () => {
let formula: GenericFormula;
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
formula = Formula[aliases[0]](...args);
});
aliases.slice(1).forEach(alias => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
test(alias, () => expect(Formula[alias](...args).equals(formula)).toBe(true));
});
});
}
testAliases(["neg", "negate", "negated"], [1]);
testAliases(["recip", "reciprocal", "reciprocate"], [1]);
testAliases(["sign", "sgn"], [1]);
@ -263,6 +260,30 @@ describe("Formula Equality Checking", () => {
describe("Creating Formulas", () => {
describe("Constants", () => {
function testConstant(
desc: string,
formulaFunc: () => InvertibleFormula,
expectedValue: DecimalSource = 10
) {
describe(desc, () => {
let formula: GenericFormula;
beforeAll(() => {
formula = formulaFunc();
});
test("Is not invertible", () => expect(formula.isInvertible()).toBe(false));
test("Is not integrable", () => expect(formula.isIntegrable()).toBe(false));
test("Integral is not invertible", () =>
expect(formula.isIntegralInvertible()).toBe(false));
test("Is not marked as having a variable", () =>
expect(formula.hasVariable()).toBe(false));
test("Evaluates correctly", () =>
expect(formula.evaluate()).compare_tolerance(expectedValue));
test("Invert throws", () => expect(() => formula.invert(25)).toThrow());
test("Integrate throws", () => expect(() => formula.evaluateIntegral()).toThrow());
test("Invert integral throws", () =>
expect(() => formula.invertIntegral(25)).toThrow());
});
}
testConstant("number", () => Formula.constant(10));
testConstant("string", () => Formula.constant("10"));
testConstant("formula", () => Formula.constant(Formula.constant(10)));
@ -270,10 +291,64 @@ describe("Creating Formulas", () => {
testConstant("ref", () => Formula.constant(ref(10)));
});
function checkFormula<T extends FormulaFunctions>(
functionName: T,
args: Readonly<Parameters<typeof Formula[T]>>
) {
let formula: GenericFormula;
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
formula = Formula[functionName](...args);
});
// None of these formulas have variables, so they should all behave the same
test("Is not marked as having a variable", () => expect(formula.hasVariable()).toBe(false));
test("Is not invertible", () => expect(formula.isInvertible()).toBe(false));
test(`Formula throws if trying to invert`, () =>
expect(() => formula.invert(10)).toThrow());
test("Is not integrable", () => expect(formula.isIntegrable()).toBe(false));
test("Has a non-invertible integral", () =>
expect(formula.isIntegralInvertible()).toBe(false));
}
// Utility function that will test all the different
// It's a lot of tests, but I'd rather be exhaustive
function testFormulaCall<T extends FormulaFunctions>(
functionName: T,
args: Readonly<Parameters<typeof Formula[T]>>
) {
let testName = functionName + "(";
for (let i = 0; i < args.length; i++) {
if (i !== 0) {
testName += ", ";
}
testName += args[i];
}
testName += ") evaluates correctly";
test(testName, () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const formula = Formula[functionName](...args);
try {
const expectedEvaluation = Decimal[functionName](
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...args.map(i => unrefFormulaSource(i))
);
if (expectedEvaluation != null) {
expect(formula.evaluate()).compare_tolerance(expectedEvaluation);
}
} catch {
// If this is an invalid Decimal operation, then ignore this test case
}
});
}
describe("Invertible 0-param", () => {
invertibleZeroParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0] as const);
checkFormula(names, [0] as const);
testValues.forEach(i => testFormulaCall(names, [i] as const));
})
);
@ -281,7 +356,7 @@ describe("Creating Formulas", () => {
describe("Non-Invertible 0-param", () => {
nonInvertibleZeroParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0] as const, false);
checkFormula(names, [0] as const);
testValues.forEach(i => testFormulaCall(names, [i] as const));
})
);
@ -289,7 +364,7 @@ describe("Creating Formulas", () => {
describe("Invertible 1-param", () => {
invertibleOneParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0, 0] as const);
checkFormula(names, [0, 0] as const);
testValues.forEach(i =>
testValues.forEach(j => testFormulaCall(names, [i, j] as const))
);
@ -299,7 +374,7 @@ describe("Creating Formulas", () => {
describe("Non-Invertible 1-param", () => {
nonInvertibleOneParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0, 0] as const, false);
checkFormula(names, [0, 0] as const);
testValues.forEach(i =>
testValues.forEach(j => testFormulaCall(names, [i, j] as const))
);
@ -309,7 +384,7 @@ describe("Creating Formulas", () => {
describe("Invertible 2-param", () => {
invertibleTwoParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0, 0, 0] as const);
checkFormula(names, [0, 0, 0] as const);
testValues.forEach(i =>
testValues.forEach(j =>
testValues.forEach(k => testFormulaCall(names, [i, j, k] as const))
@ -321,7 +396,7 @@ describe("Creating Formulas", () => {
describe("Non-Invertible 2-param", () => {
nonInvertibleTwoParamFunctionNames.forEach(names =>
describe(names, () => {
testFormula(names, [0, 0, 0] as const, false);
checkFormula(names, [0, 0, 0] as const);
testValues.forEach(i =>
testValues.forEach(j =>
testValues.forEach(k => testFormulaCall(names, [i, j, k] as const))
@ -342,14 +417,27 @@ describe("Variables", () => {
test("Created variable is marked as a variable", () =>
expect(variable.hasVariable()).toBe(true));
test("Evaluate() returns variable's value", () =>
test("evaluate() returns variable's value", () =>
expect(variable.evaluate()).compare_tolerance(10));
test("Invert() is pass-through", () => expect(variable.invert(100)).compare_tolerance(100));
test("evaluate(variable) overrides variable value", () =>
expect(variable.add(10).evaluate(20)).compare_tolerance(30));
test("Nested variable is marked as having a variable", () =>
expect(variable.add(10).div(3).pow(2).hasVariable()).toBe(true));
test("Nested non-variable is marked as not having a variable", () =>
expect(constant.add(10).div(3).pow(2).hasVariable()).toBe(false));
});
describe("Inverting", () => {
let variable: GenericFormula;
let constant: GenericFormula;
beforeAll(() => {
variable = Formula.variable(10);
constant = Formula.constant(10);
});
test("variable.invert() is pass-through", () =>
expect(variable.invert(100)).compare_tolerance(100));
describe("Invertible Formulas correctly calculate when they contain a variable", () => {
function checkFormula(formula: GenericFormula, expectedBool = true) {
@ -392,42 +480,43 @@ describe("Variables", () => {
});
});
describe("Non-Invertible Formulas never marked as having a variable", () => {
describe("Non-invertible formulas marked as such", () => {
function checkFormula(formula: GenericFormula) {
expect(formula.isInvertible()).toBe(false);
expect(formula.hasVariable()).toBe(false);
expect(formula.isIntegrable()).toBe(false);
expect(formula.isIntegralInvertible()).toBe(false);
}
nonInvertibleZeroParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var) is marked as not invertible and not having a variable`, () =>
test(`${name}(var) is marked as not invertible`, () =>
checkFormula(Formula[name](variable)));
});
});
nonInvertibleOneParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, const) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, constant)));
test(`${name}(const, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(const, var) is marked as not invertible`, () =>
checkFormula(Formula[name](constant, variable)));
test(`${name}(var, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, var) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, variable)));
});
});
nonInvertibleTwoParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const, const) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, const, const) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, constant, constant)));
test(`${name}(const, var, const) is marked as not invertible and not having a variable`, () =>
test(`${name}(const, var, const) is marked as not invertible`, () =>
checkFormula(Formula[name](constant, variable, constant)));
test(`${name}(const, const, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(const, const, var) is marked as not invertible`, () =>
checkFormula(Formula[name](constant, constant, variable)));
test(`${name}(var, var, const) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, var, const) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, variable, constant)));
test(`${name}(var, const, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, const, var) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, constant, variable)));
test(`${name}(const, var, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(const, var, var) is marked as not invertible`, () =>
checkFormula(Formula[name](constant, variable, variable)));
test(`${name}(var, var, var) is marked as not invertible and not having a variable`, () =>
test(`${name}(var, var, var) is marked as not invertible`, () =>
checkFormula(Formula[name](variable, variable, variable)));
});
});
@ -476,6 +565,164 @@ describe("Variables", () => {
});
});
describe("Integrating", () => {
let variable: GenericFormula;
let constant: GenericFormula;
beforeAll(() => {
variable = Formula.variable(10);
constant = Formula.constant(10);
});
test("evaluateIntegral() returns variable's value", () =>
expect(variable.evaluate()).compare_tolerance(10));
test("evaluateIntegral(variable) overrides variable value", () =>
expect(variable.add(10).evaluateIntegral(20)).compare_tolerance(400));
describe("Integrable functions marked as such", () => {
function checkFormula(formula: GenericFormula) {
expect(formula.isIntegrable()).toBe(true);
expect(() => formula.evaluateIntegral()).to.not.throw();
}
integrableZeroParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var) is marked as integrable`, () =>
checkFormula(Formula[name](variable)));
});
});
integrableOneParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const) is marked as integrable`, () =>
checkFormula(Formula[name](variable, constant)));
test(`${name}(const, var) is marked as integrable`, () =>
checkFormula(Formula[name](constant, variable)));
test(`${name}(var, var) is marked as integrable`, () =>
checkFormula(Formula[name](variable, variable)));
});
});
});
describe("Non-Integrable functions marked as such", () => {
function checkFormula(formula: GenericFormula) {
expect(formula.isIntegrable()).toBe(false);
}
nonIntegrableZeroParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable)));
});
});
nonIntegrableOneParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant)));
test(`${name}(const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable)));
test(`${name}(var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable)));
});
});
nonIntegrableTwoParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant, constant)));
test(`${name}(const, var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable, constant)));
test(`${name}(const, const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, constant, variable)));
test(`${name}(var, var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable, constant)));
test(`${name}(var, const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant, variable)));
test(`${name}(const, var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable, variable)));
test(`${name}(var, var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable, variable)));
});
});
});
// TODO I think these tests will require writing at least one known example for every function
describe.todo("Integrable formulas integrate correctly");
});
describe("Inverting integrals", () => {
let variable: GenericFormula;
let constant: GenericFormula;
beforeAll(() => {
variable = Formula.variable(10);
constant = Formula.constant(10);
});
test("variable.invertIntegral() is pass-through", () =>
expect(variable.invertIntegral(20)).compare_tolerance(20));
describe("Invertible Integral functions marked as such", () => {
function checkFormula(formula: GenericFormula) {
expect(formula.isIntegralInvertible()).toBe(true);
expect(() => formula.invertIntegral(10)).to.not.throw();
}
invertibleIntegralZeroPramFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var) is marked as having an invertible integral`, () =>
checkFormula(Formula[name](variable)));
});
});
invertibleIntegralOneParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const) is marked as having an invertible integral`, () =>
checkFormula(Formula[name](variable, constant)));
test(`${name}(const, var) is marked as having an invertible integral`, () =>
checkFormula(Formula[name](constant, variable)));
test(`${name}(var, var) is marked as having an invertible integral`, () =>
checkFormula(Formula[name](variable, variable)));
});
});
});
describe("Non-Invertible integral functions marked as such", () => {
function checkFormula(formula: GenericFormula) {
expect(formula.isIntegralInvertible()).toBe(false);
}
nonInvertibleIntegralZeroPramFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable)));
});
});
nonInvertibleIntegralOneParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant)));
test(`${name}(const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable)));
test(`${name}(var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable)));
});
});
nonInvertibleIntegralTwoParamFunctionNames.forEach(name => {
describe(name, () => {
test(`${name}(var, const, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant, constant)));
test(`${name}(const, var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable, constant)));
test(`${name}(const, const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, constant, variable)));
test(`${name}(var, var, const) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable, constant)));
test(`${name}(var, const, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, constant, variable)));
test(`${name}(const, var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](constant, variable, variable)));
test(`${name}(var, var, var) is marked as not integrable`, () =>
checkFormula(Formula[name](variable, variable, variable)));
});
});
});
// TODO I think these tests will require writing at least one known example for every function
describe.todo("Invertible Integral formulas invert correctly");
});
describe("Step-wise", () => {
let variable: GenericFormula;
let constant: GenericFormula;
@ -485,7 +732,7 @@ describe("Step-wise", () => {
});
test("Formula without variable is marked as such", () => {
expect(Formula.step(constant, 10, value => Formula.sqrt(value)).isInvertible()).toBe(true);
expect(Formula.step(constant, 10, value => Formula.sqrt(value)).isInvertible()).toBe(false);
expect(Formula.step(constant, 10, value => Formula.sqrt(value)).hasVariable()).toBe(false);
});
@ -499,6 +746,24 @@ describe("Step-wise", () => {
expect(Formula.step(constant, 10, value => Formula.abs(value)).hasVariable()).toBe(false);
});
test("Formula never marked integrable", () => {
expect(Formula.step(constant, 10, value => Formula.add(value, 10)).isIntegrable()).toBe(
false
);
expect(() =>
Formula.step(constant, 10, value => Formula.add(value, 10)).evaluateIntegral()
).toThrow();
});
test("Formula never marked as having an invertible integral", () => {
expect(
Formula.step(constant, 10, value => Formula.add(value, 10)).isIntegralInvertible()
).toBe(false);
expect(() =>
Formula.step(constant, 10, value => Formula.add(value, 10)).invertIntegral(10)
).toThrow();
});
test("Formula modifiers with variables mark formula as non-invertible", () => {
expect(
Formula.step(constant, 10, value => Formula.add(value, variable)).isInvertible()
@ -540,7 +805,7 @@ describe("Conditionals", () => {
});
test("Formula without variable is marked as such", () => {
expect(Formula.if(constant, true, value => Formula.sqrt(value)).isInvertible()).toBe(true);
expect(Formula.if(constant, true, value => Formula.sqrt(value)).isInvertible()).toBe(false);
expect(Formula.if(constant, true, value => Formula.sqrt(value)).hasVariable()).toBe(false);
});
@ -554,6 +819,24 @@ describe("Conditionals", () => {
expect(Formula.if(constant, true, value => Formula.abs(value)).hasVariable()).toBe(false);
});
test("Formula never marked integrable", () => {
expect(Formula.if(constant, true, value => Formula.add(value, 10)).isIntegrable()).toBe(
false
);
expect(() =>
Formula.if(constant, true, value => Formula.add(value, 10)).evaluateIntegral()
).toThrow();
});
test("Formula never marked as having an invertible integral", () => {
expect(
Formula.if(constant, true, value => Formula.add(value, 10)).isIntegralInvertible()
).toBe(false);
expect(() =>
Formula.if(constant, true, value => Formula.add(value, 10)).invertIntegral(10)
).toThrow();
});
test("Formula modifiers with variables mark formula as non-invertible", () => {
expect(
Formula.if(constant, true, value => Formula.add(value, variable)).isInvertible()
@ -587,53 +870,143 @@ describe("Conditionals", () => {
});
describe("Custom Formulas", () => {
describe("Formula with just one input", () => {
let formula: GenericFormula;
beforeAll(() => {
formula = new Formula([10]);
});
test("Is not invertible", () => expect(formula.isInvertible()).toBe(false));
test("Is not marked as having a variable", () => expect(formula.hasVariable()).toBe(false));
test("Evaluates correctly", () => expect(formula.evaluate()).compare_tolerance(10));
test("Invert is pass-through", () => expect(formula.invert(20)).compare_tolerance(20));
});
describe("Formula with non-one inputs without required other params", () => {
test("Zero inputs throws", () => expect(() => new Formula([])).toThrow());
test("Two inputs throws", () => expect(() => new Formula([1, 2])).toThrow());
test("Zero inputs and invert throws", () =>
expect(() => new Formula([], undefined, value => value)).toThrow());
test("Two inputs and invert throws", () =>
expect(() => new Formula([1, 2], undefined, value => value)).toThrow());
test("Zero inputs and evaluate and hasVariable throws", () =>
expect(() => new Formula([], () => 10, undefined, true)).toThrow());
test("Two inputs and evaluate and hasVariable throws", () =>
expect(() => new Formula([1, 2], () => 10, undefined, true)).toThrow());
});
describe("Formula with evaluate", () => {
test("Zero input evaluates correctly", () =>
expect(new Formula([], () => 10).evaluate()).compare_tolerance(10));
expect(new Formula({ inputs: [], evaluate: () => 10 }).evaluate()).compare_tolerance(
10
));
test("One input evaluates correctly", () =>
expect(new Formula([1], value => value).evaluate()).compare_tolerance(1));
expect(
new Formula({ inputs: [1], evaluate: value => value }).evaluate()
).compare_tolerance(1));
test("Two inputs evaluates correctly", () =>
expect(new Formula([1, 2], (v1, v2) => v1).evaluate()).compare_tolerance(1));
expect(
new Formula({ inputs: [1, 2], evaluate: (v1, v2) => v1 }).evaluate()
).compare_tolerance(1));
});
describe("Formula with invert", () => {
test("Zero input inverts correctly", () =>
expect(new Formula([], undefined, value => value).invert(10)).compare_tolerance(10));
expect(
new Formula({ inputs: [], evaluate: () => 6, invert: value => value }).invert(10)
).compare_tolerance(10));
test("One input inverts correctly", () =>
expect(new Formula([1], undefined, (value, v1) => v1).invert(10)).compare_tolerance(1));
expect(
new Formula({ inputs: [1], evaluate: () => 10, invert: (value, v1) => v1 }).invert(
10
)
).compare_tolerance(1));
test("Two inputs inverts correctly", () =>
expect(
new Formula([1, 2], undefined, (value, v1, v2) => v2).invert(10)
new Formula({
inputs: [1, 2],
evaluate: () => 10,
invert: (value, v1, v2) => v2
}).invert(10)
).compare_tolerance(2));
});
test("Formula with hasVariable", () => {
const formula = new Formula([], undefined, value => value, true);
expect(formula.isInvertible()).toBe(true);
expect(formula.hasVariable()).toBe(true);
describe("Formula with integrate", () => {
test("Zero input integrates correctly", () =>
expect(
new Formula({
inputs: [],
evaluate: () => 10,
integrate: () => 20
}).evaluateIntegral()
).compare_tolerance(20));
test("One input integrates correctly", () =>
expect(
new Formula({
inputs: [1],
evaluate: () => 10,
integrate: val => val ?? 20
}).evaluateIntegral()
).compare_tolerance(20));
test("Two inputs integrates correctly", () =>
expect(
new Formula({
inputs: [1, 2],
evaluate: (v1, v2) => 10,
integrate: (v1, v2) => 3
}).evaluateIntegral()
).compare_tolerance(3));
});
describe("Formula with invertIntegral", () => {
test("Zero input inverts integral correctly", () =>
expect(
new Formula({
inputs: [],
evaluate: () => 10,
invertIntegral: () => 1
}).invertIntegral(8)
).compare_tolerance(1));
test("One input inverts integral correctly", () =>
expect(
new Formula({
inputs: [1],
evaluate: () => 10,
invertIntegral: val => 1
}).invertIntegral(8)
).compare_tolerance(1));
test("Two inputs inverts integral correctly", () =>
expect(
new Formula({
inputs: [1, 2],
evaluate: (v1, v2) => 10,
invertIntegral: (v1, v2) => 1
}).invertIntegral(8)
).compare_tolerance(1));
});
});
describe("Buy Max", () => {
let resource: Resource;
beforeAll(() => {
resource = createResource(10);
});
describe("With spending", () => {
test("Throws on formula with non-invertible integral", () => {
const { maxAffordable, cost } = calculateMaxAffordable(
Formula.neg(10),
resource,
false
);
expect(() => maxAffordable.value).toThrow();
expect(() => cost.value).toThrow();
});
// https://www.desmos.com/calculator/5vgletdc1p
test("Calculates max affordable and cost correctly", () => {
const variable = Formula.variable(10);
const { maxAffordable, cost } = calculateMaxAffordable(
Formula.pow(1.05, variable),
resource,
false
);
expect(maxAffordable.value).compare_tolerance(47);
expect(cost.value).compare_tolerance(Decimal.pow(1.05, 47));
});
});
describe("Without spending", () => {
test("Throws on non-invertible formula", () => {
const { maxAffordable, cost } = calculateMaxAffordable(
Formula.abs(10),
resource,
false
);
expect(() => maxAffordable.value).toThrow();
expect(() => cost.value).toThrow();
});
// https://www.desmos.com/calculator/5vgletdc1p
test("Calculates max affordable and cost correctly", () => {
const variable = Formula.variable(10);
const { maxAffordable, cost } = calculateMaxAffordable(
Formula.pow(1.05, variable),
resource
);
expect(maxAffordable.value).compare_tolerance(7);
expect(cost.value).compare_tolerance(7.35);
});
});
});