@cortex-js/compute-engine 0.4.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +2 -3
  2. package/dist/compute-engine.esm.js +18900 -18332
  3. package/dist/compute-engine.min.esm.js +2 -2
  4. package/dist/compute-engine.min.js +2 -2
  5. package/dist/math-json.esm.js +44 -6141
  6. package/dist/math-json.min.esm.js +2 -2
  7. package/dist/math-json.min.js +2 -2
  8. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  9. package/dist/types/common/signals.d.ts +1 -1
  10. package/dist/types/compute-engine/assume.d.ts +1 -1
  11. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +8 -7
  12. package/dist/types/compute-engine/boxed-expression/box.d.ts +3 -5
  13. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +3 -3
  14. package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +32 -6
  15. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
  16. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +7 -3
  17. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +3 -3
  18. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +3 -3
  19. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +3 -3
  20. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +6 -6
  21. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +5 -5
  22. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  23. package/dist/types/compute-engine/boxed-expression/order.d.ts +2 -1
  24. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/utils.d.ts +3 -3
  26. package/dist/types/compute-engine/compute-engine.d.ts +101 -50
  27. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  28. package/dist/types/compute-engine/dictionary/arithmetic-add.d.ts +2 -2
  29. package/dist/types/compute-engine/dictionary/arithmetic-divide.d.ts +1 -1
  30. package/dist/types/compute-engine/dictionary/arithmetic-multiply.d.ts +1 -1
  31. package/dist/types/compute-engine/dictionary/arithmetic-power.d.ts +1 -1
  32. package/dist/types/compute-engine/dictionary/arithmetic.d.ts +1 -1
  33. package/dist/types/compute-engine/dictionary/collections.d.ts +1 -1
  34. package/dist/types/compute-engine/dictionary/core.d.ts +1 -1
  35. package/dist/types/compute-engine/dictionary/dictionary.d.ts +1 -1
  36. package/dist/types/compute-engine/dictionary/logic.d.ts +1 -1
  37. package/dist/types/compute-engine/dictionary/polynomials.d.ts +1 -1
  38. package/dist/types/compute-engine/dictionary/relational-operator.d.ts +1 -1
  39. package/dist/types/compute-engine/dictionary/sets.d.ts +1 -1
  40. package/dist/types/compute-engine/dictionary/trigonometry.d.ts +1 -1
  41. package/dist/types/compute-engine/domain-utils.d.ts +1 -1
  42. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  43. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  44. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  45. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  46. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.d.ts +1 -1
  47. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  48. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  49. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  50. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  51. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  52. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -2
  53. package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +3 -3
  54. package/dist/types/compute-engine/latex-syntax/parse.d.ts +14 -13
  55. package/dist/types/compute-engine/latex-syntax/public.d.ts +69 -44
  56. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +3 -3
  57. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
  58. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +3 -5
  59. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  60. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  61. package/dist/types/compute-engine/numerics/numeric-decimal.d.ts +1 -1
  62. package/dist/types/compute-engine/numerics/numeric.d.ts +2 -2
  63. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  64. package/dist/types/compute-engine/public.d.ts +551 -228
  65. package/dist/types/compute-engine/rules.d.ts +1 -1
  66. package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
  67. package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
  68. package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
  69. package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
  70. package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
  71. package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
  72. package/dist/types/compute-engine/symbolic/sum.d.ts +1 -1
  73. package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
  74. package/dist/types/compute-engine.d.ts +3 -2
  75. package/dist/types/math-json/math-json-format.d.ts +1 -1
  76. package/dist/types/math-json/utils.d.ts +3 -4
  77. package/dist/types/math-json.d.ts +3 -4
  78. package/package.json +17 -18
  79. package/dist/compute-engine.js +0 -23523
  80. package/dist/math-json.js +0 -6339
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  export declare function boxRules(ce: IComputeEngine, rs: Iterable<Rule>): BoxedRuleSet;
3
3
  /**
4
4
  * Apply the rules in the ruleset and return a modified expression.
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * A set of simplification rules.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * Return the expansion of ['Multiply', lhs, rhs]
4
4
  * - lhs = 'a + b', rhs = '2'
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * Flatten the arguments.
4
4
  * If `expr` was canonical, the result it canonical.
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * Distribute `Negate` (multiply by -1) if expr is a number literal, an
4
4
  * addition or another `Negate`.
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * Coefficient of a univariate (single variable) polynomial.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * Group terms in a product by common term.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  export declare class Sum {
3
3
  private engine;
4
4
  private _literal;
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * If expression is a product or a division, collect all the terms with a
4
4
  * negative exponents in the denominator, and all the terms
@@ -1,3 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  export { ComputeEngine } from './compute-engine/compute-engine';
3
- export declare const version = "0.4.3";
3
+ export declare const version = "0.6.0";
4
+ export { getVars } from './compute-engine/boxed-expression/utils';
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /** A human readable string to annotate an expression, since JSON does not
3
3
  * allow comments in its encoding */
4
4
  comment?: string;
@@ -1,4 +1,4 @@
1
- /* 0.4.3 */
1
+ /* 0.6.0 */
2
2
  /**
3
3
  * These constants are the 'primitive' functions and constants that are used
4
4
  * for some basic manipulations such as parsing, and transforming to canonical
@@ -53,6 +53,8 @@ export declare function headName(expr: Expression | null): string;
53
53
  export declare function op(expr: Expression | null, n: number): Expression | null;
54
54
  export declare function nops(expr: Expression): number;
55
55
  export declare function symbol(expr: Expression | null): string | null;
56
+ export declare function string(expr: Expression | null): string | null;
57
+ export declare function dictionary(expr: Expression | null): null | Record<string, Expression>;
56
58
  export declare function machineValue(expr: Expression | null): number | null;
57
59
  /**
58
60
  * Return a rational (numer over denom) representation of the expression,
@@ -77,9 +79,6 @@ export declare function applyRecursively(expr: Expression, fn: (x: Expression) =
77
79
  * Apply a function to the arguments of a function and return an array of T
78
80
  */
79
81
  export declare function mapArgs<T>(expr: Expression, fn: (x: Expression) => T): T[];
80
- export declare function dictionary(expr: Expression): {
81
- [key: string]: Expression;
82
- } | null;
83
82
  /**
84
83
  * Return num as a number if it's a valid JSON number (that is
85
84
  * a valid JavaScript number but not NaN or +/-Infinity) or
@@ -1,5 +1,4 @@
1
- /* 0.4.3 */
2
- export { LatexSyntax } from './compute-engine/latex-syntax/latex-syntax';
3
- export type { Attributes, Expression, MathJsonNumber, MathJsonSymbol, MathJsonString, MathJsonFunction, MathJsonDictionary, } from './math-json/math-json-format';
1
+ /* 0.6.0 */
4
2
  export { isAtomic, isSymbolObject, isStringObject, isFunctionObject, isDictionaryObject, stringValue as getStringValue, head, headName, symbol, tail, applyRecursively, mapArgs, op, nops, dictionary as getDictionary, asValidJSONNumber, } from './math-json/utils';
5
- export declare const version = "0.4.3";
3
+ export type { LatexToken, ParseHandler, SerializeHandler, LatexDictionaryEntry, LatexDictionary, ParseLatexOptions, SerializeLatexOptions, NumberFormattingOptions, } from './compute-engine/latex-syntax/public';
4
+ export declare const version = "0.6.0";
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.3",
2
+ "version": "0.6.0",
3
3
  "scripts": {
4
4
  "build": "bash ./scripts/build.sh",
5
5
  "clean": "bash ./scripts/clean.sh",
@@ -42,47 +42,46 @@
42
42
  "module": "./dist/compute-engine.min.esm.js",
43
43
  "types": "./dist/types/compute-engine.d.ts",
44
44
  "engines": {
45
- "npm": ">=6.14.8",
46
- "node": ">=12.0.0"
45
+ "npm": ">=8.5.0",
46
+ "node": ">=16.14.2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@cortex-js/prettier-config": "^1.1.1",
50
50
  "@jest/console": "^27.5.1",
51
- "@rollup/plugin-commonjs": "^21.0.2",
51
+ "@rollup/plugin-commonjs": "^21.0.3",
52
52
  "@rollup/plugin-node-resolve": "^13.1.3",
53
53
  "@types/jest": "^27.4.1",
54
- "@types/node": "^17.0.21",
55
- "@typescript-eslint/eslint-plugin": "^5.12.1",
56
- "@typescript-eslint/parser": "^5.12.1",
57
- "@typescript-eslint/typescript-estree": "^5.12.1",
58
- "chalk": "^5.0.0",
54
+ "@types/node": "^17.0.23",
55
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
56
+ "@typescript-eslint/parser": "^5.18.0",
57
+ "@typescript-eslint/typescript-estree": "^5.18.0",
58
+ "chalk": "^5.0.1",
59
59
  "check-node-version": "^4.2.1",
60
60
  "child_process": "^1.0.2",
61
61
  "chokidar": "^3.5.3",
62
- "eslint": "^8.9.0",
63
- "eslint-config-prettier": "^8.4.0",
64
- "eslint-plugin-import": "^2.25.4",
62
+ "eslint": "^8.12.0",
63
+ "eslint-config-prettier": "^8.5.0",
64
+ "eslint-plugin-import": "^2.26.0",
65
65
  "eslint-plugin-no-unsanitized": "^4.0.1",
66
66
  "eslint-plugin-prettier": "^4.0.0",
67
67
  "estrella": "^1.4.1",
68
- "http-server": "^14.1.0",
69
68
  "jest": "^27.5.1",
70
69
  "jest-silent-reporter": "^0.5.0",
71
70
  "open": "^8.4.0",
72
- "prettier": "^2.5.1",
73
- "rollup": "^2.68.0",
71
+ "prettier": "^2.6.2",
72
+ "rollup": "^2.70.1",
74
73
  "rollup-plugin-copy": "^3.4.0",
75
74
  "rollup-plugin-eslint": "^7.0.0",
76
75
  "rollup-plugin-terser": "^7.0.2",
77
76
  "rollup-plugin-typescript2": "latest",
78
77
  "serve-http": "^1.0.6",
79
- "ts-jest": "^27.1.3",
80
- "typescript": "^4.5.5",
78
+ "ts-jest": "^27.1.4",
79
+ "typescript": "^4.6.3",
81
80
  "update-notifier": "^5.1.0"
82
81
  },
83
82
  "prettier": "@cortex-js/prettier-config",
84
83
  "dependencies": {
85
- "complex.js": "^2.0.15",
84
+ "complex.js": "^2.1.0",
86
85
  "decimal.js": "^10.3.1"
87
86
  }
88
87
  }