@mathigon/hilbert
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -19,2 +19,8 @@ import { Interval } from './eval'; | ||
substitute(_vars?: ExprMap): ExprElement; | ||
/** | ||
* Recursively substitutes a new expression for a variable. | ||
* NOTE: This function does not test for cyclical dependencies, which could | ||
* lead to an infinite loop. You have to manually validate expressions first! | ||
*/ | ||
recursiveSubstitute(vars: ExprMap): ExprElement; | ||
/** Returns the simplest mathematically equivalent expression. */ | ||
@@ -21,0 +27,0 @@ get simplified(): ExprElement; |
@@ -271,2 +271,8 @@ var __create = Object.create; | ||
} | ||
recursiveSubstitute(vars) { | ||
const varList = Object.keys(vars); | ||
if (!this.unknowns.filter((v) => varList.includes(v)).length) | ||
return this; | ||
return this.substitute(vars).recursiveSubstitute(vars); | ||
} | ||
get simplified() { | ||
@@ -273,0 +279,0 @@ return this; |
@@ -235,2 +235,8 @@ // src/errors.ts | ||
} | ||
recursiveSubstitute(vars) { | ||
const varList = Object.keys(vars); | ||
if (!this.unknowns.filter((v) => varList.includes(v)).length) | ||
return this; | ||
return this.substitute(vars).recursiveSubstitute(vars); | ||
} | ||
get simplified() { | ||
@@ -237,0 +243,0 @@ return this; |
{ | ||
"name": "@mathigon/hilbert", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -30,17 +30,17 @@ "homepage": "https://mathigon.io/hilbert", | ||
"dependencies": { | ||
"@mathigon/core": "1.0.3", | ||
"@mathigon/fermat": "1.0.3" | ||
"@mathigon/core": "1.0.4", | ||
"@mathigon/fermat": "1.0.5" | ||
}, | ||
"devDependencies": { | ||
"@types/tape": "4.13.2", | ||
"@typescript-eslint/eslint-plugin": "4.30.0", | ||
"@typescript-eslint/parser": "4.30.0", | ||
"esbuild": "0.12.24", | ||
"eslint": "7.32.0", | ||
"eslint-plugin-import": "2.24.2", | ||
"@typescript-eslint/eslint-plugin": "5.3.0", | ||
"@typescript-eslint/parser": "5.3.0", | ||
"esbuild": "0.13.12", | ||
"eslint": "8.1.0", | ||
"eslint-plugin-import": "2.25.2", | ||
"tape": "5.3.1", | ||
"ts-node": "10.2.1", | ||
"ts-node": "10.4.0", | ||
"tslib": "2.3.1", | ||
"typescript": "4.4.2" | ||
"typescript": "4.4.4" | ||
} | ||
} |
@@ -46,2 +46,13 @@ // ============================================================================= | ||
/** | ||
* Recursively substitutes a new expression for a variable. | ||
* NOTE: This function does not test for cyclical dependencies, which could | ||
* lead to an infinite loop. You have to manually validate expressions first! | ||
*/ | ||
recursiveSubstitute(vars: ExprMap): ExprElement { | ||
const varList = Object.keys(vars); | ||
if (!this.unknowns.filter(v => varList.includes(v)).length) return this; | ||
return this.substitute(vars).recursiveSubstitute(vars); | ||
} | ||
/** Returns the simplest mathematically equivalent expression. */ | ||
@@ -48,0 +59,0 @@ get simplified(): ExprElement { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273554
38
3928
+ Added@mathigon/core@1.0.4(transitive)
+ Added@mathigon/fermat@1.0.5(transitive)
- Removed@mathigon/core@1.0.3(transitive)
- Removed@mathigon/fermat@1.0.3(transitive)
Updated@mathigon/core@1.0.4
Updated@mathigon/fermat@1.0.5