@cortex-js/compute-engine 0.55.6 → 0.56.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.
- package/dist/compile.esm.js +776 -139
- package/dist/compile.min.esm.js +277 -78
- package/dist/compile.min.umd.cjs +277 -78
- package/dist/compile.umd.cjs +776 -139
- package/dist/compute-engine.esm.js +1299 -260
- package/dist/compute-engine.min.esm.js +298 -99
- package/dist/compute-engine.min.umd.cjs +298 -99
- package/dist/compute-engine.umd.cjs +1299 -260
- package/dist/core.esm.js +1298 -259
- package/dist/core.min.esm.js +297 -98
- package/dist/core.min.umd.cjs +297 -98
- package/dist/core.umd.cjs +1298 -259
- package/dist/interval.esm.js +134 -5
- package/dist/interval.min.esm.js +6 -6
- package/dist/interval.min.umd.cjs +6 -6
- package/dist/interval.umd.cjs +134 -5
- package/dist/latex-syntax.esm.js +160 -11
- package/dist/latex-syntax.min.esm.js +7 -7
- package/dist/latex-syntax.min.umd.cjs +7 -7
- package/dist/latex-syntax.umd.cjs +160 -11
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.umd.cjs +2 -2
- package/dist/math-json.umd.cjs +2 -2
- package/dist/numerics.esm.js +4 -2
- package/dist/numerics.min.esm.js +3 -3
- package/dist/numerics.min.umd.cjs +3 -3
- package/dist/numerics.umd.cjs +4 -2
- package/dist/types/big-decimal/big-decimal.d.ts +1 -1
- package/dist/types/big-decimal/index.d.ts +1 -1
- package/dist/types/big-decimal/transcendentals.d.ts +1 -1
- package/dist/types/big-decimal/utils.d.ts +1 -1
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/configuration-change.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/reduce.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +2 -2
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compile.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/stochastic-equal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +1 -1
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +1 -1
- package/dist/types/compute-engine/compilation/constant-folding.d.ts +1 -1
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +15 -5
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +25 -3
- package/dist/types/compute-engine/compilation/python-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/types.d.ts +1 -1
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/engine-assumptions.d.ts +1 -1
- package/dist/types/compute-engine/engine-cache.d.ts +1 -1
- package/dist/types/compute-engine/engine-common-symbols.d.ts +1 -1
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +1 -1
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +1 -1
- package/dist/types/compute-engine/engine-declarations.d.ts +1 -1
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +1 -1
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +1 -1
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +1 -1
- package/dist/types/compute-engine/engine-runtime-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-sequences.d.ts +1 -1
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +1 -1
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +1 -1
- package/dist/types/compute-engine/engine-type-resolver.d.ts +1 -1
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/free-functions.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/global-types.d.ts +1 -1
- package/dist/types/compute-engine/index.d.ts +22 -2
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/default-dictionary.d.ts +4 -3
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-colors.d.ts +10 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-units.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +9 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-dms.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/colors.d.ts +1 -1
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/fractals.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/quantity-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/type-handlers.d.ts +1 -1
- package/dist/types/compute-engine/library/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/library/units.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
- package/dist/types/compute-engine/numerics/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/oeis.d.ts +1 -1
- package/dist/types/compute-engine/sequence.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-cost.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-factorial.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
- package/dist/types/compute-engine/types-definitions.d.ts +1 -1
- package/dist/types/compute-engine/types-engine.d.ts +6 -2
- package/dist/types/compute-engine/types-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-expression.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +1 -2
- package/dist/types/core.d.ts +1 -1
- package/dist/types/interval.d.ts +1 -1
- package/dist/types/latex-syntax.d.ts +2 -2
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/dist/types/numerics.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** LatexSyntax 0.
|
|
1
|
+
/** LatexSyntax 0.56.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LatexSyntax = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var LatexSyntax = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1190,6 +1190,7 @@ var LatexSyntax = (() => {
|
|
|
1190
1190
|
];
|
|
1191
1191
|
var VALUE_TYPES = [
|
|
1192
1192
|
"value",
|
|
1193
|
+
"color",
|
|
1193
1194
|
...COLLECTION_TYPES,
|
|
1194
1195
|
...SCALAR_TYPES
|
|
1195
1196
|
];
|
|
@@ -2841,6 +2842,7 @@ var LatexSyntax = (() => {
|
|
|
2841
2842
|
symbol: [],
|
|
2842
2843
|
boolean: [],
|
|
2843
2844
|
string: [],
|
|
2845
|
+
color: [],
|
|
2844
2846
|
expression: EXPRESSION_TYPES
|
|
2845
2847
|
};
|
|
2846
2848
|
function isPrimitiveSubtype(lhs, rhs) {
|
|
@@ -7370,6 +7372,8 @@ var LatexSyntax = (() => {
|
|
|
7370
7372
|
precedence: DIVISION_PRECEDENCE,
|
|
7371
7373
|
parse: "Mod"
|
|
7372
7374
|
},
|
|
7375
|
+
// Function-style alias: `\operatorname{mod}(a, b)`
|
|
7376
|
+
{ latexTrigger: "\\operatorname{mod}", parse: "Mod" },
|
|
7373
7377
|
{
|
|
7374
7378
|
latexTrigger: "\\pmod",
|
|
7375
7379
|
kind: "prefix",
|
|
@@ -7610,6 +7614,13 @@ var LatexSyntax = (() => {
|
|
|
7610
7614
|
const rhs = serializer.wrap(operand(expr, 2), ADDITION_PRECEDENCE + 3);
|
|
7611
7615
|
return joinLatex([lhs, "-", rhs]);
|
|
7612
7616
|
}
|
|
7617
|
+
},
|
|
7618
|
+
// Euclidean distance between two points (tuples of numbers).
|
|
7619
|
+
{
|
|
7620
|
+
name: "Distance",
|
|
7621
|
+
latexTrigger: ["\\operatorname{distance}"],
|
|
7622
|
+
kind: "function",
|
|
7623
|
+
serialize: (serializer, expr) => "\\operatorname{distance}" + serializer.wrapArguments(expr)
|
|
7613
7624
|
}
|
|
7614
7625
|
];
|
|
7615
7626
|
function getIndexAssignment(expr, upper) {
|
|
@@ -9034,7 +9045,9 @@ var LatexSyntax = (() => {
|
|
|
9034
9045
|
if (!expr || !symbol(expr)) return null;
|
|
9035
9046
|
return ["Mean", expr];
|
|
9036
9047
|
}
|
|
9037
|
-
}
|
|
9048
|
+
},
|
|
9049
|
+
// Function-style alias: `\operatorname{var}(...)`
|
|
9050
|
+
{ latexTrigger: "\\operatorname{var}", parse: "Variance" }
|
|
9038
9051
|
];
|
|
9039
9052
|
|
|
9040
9053
|
// src/compute-engine/numerics/unit-data.ts
|
|
@@ -10042,7 +10055,7 @@ var LatexSyntax = (() => {
|
|
|
10042
10055
|
36: "\\qquad"
|
|
10043
10056
|
}[v] ?? "";
|
|
10044
10057
|
}
|
|
10045
|
-
}
|
|
10058
|
+
},
|
|
10046
10059
|
// if (
|
|
10047
10060
|
// [
|
|
10048
10061
|
// '\\!',
|
|
@@ -10066,6 +10079,121 @@ var LatexSyntax = (() => {
|
|
|
10066
10079
|
// name: '',
|
|
10067
10080
|
// trigger: '\\check',
|
|
10068
10081
|
// },
|
|
10082
|
+
// ---------------------------------------------------------------------------
|
|
10083
|
+
// Function-style aliases for collection / random operators that some
|
|
10084
|
+
// notations write in lowercase (e.g. `\operatorname{shuffle}(L)`).
|
|
10085
|
+
// The capitalized library entries already exist; these are pure parse
|
|
10086
|
+
// aliases so the lowercase names don't land in `unsupported-operator`.
|
|
10087
|
+
// ---------------------------------------------------------------------------
|
|
10088
|
+
{ latexTrigger: "\\operatorname{random}", parse: "Random" },
|
|
10089
|
+
{ latexTrigger: "\\operatorname{shuffle}", parse: "Shuffle" },
|
|
10090
|
+
{ latexTrigger: "\\operatorname{repeat}", parse: "Repeat" },
|
|
10091
|
+
{ latexTrigger: "\\operatorname{join}", parse: "Join" },
|
|
10092
|
+
// ---------------------------------------------------------------------------
|
|
10093
|
+
// Geometric primitive heads. Registered as known typed heads so consumers
|
|
10094
|
+
// can branch on the operator name; CE itself doesn't render them. The
|
|
10095
|
+
// library entries (with no evaluator) live in `library/core.ts`.
|
|
10096
|
+
// ---------------------------------------------------------------------------
|
|
10097
|
+
{
|
|
10098
|
+
name: "Triangle",
|
|
10099
|
+
latexTrigger: ["\\operatorname{triangle}"],
|
|
10100
|
+
kind: "function",
|
|
10101
|
+
serialize: (serializer, expr) => "\\operatorname{triangle}" + serializer.wrapArguments(expr)
|
|
10102
|
+
},
|
|
10103
|
+
// Desmos's geometric `vector(p1, p2)` — a directed segment between two
|
|
10104
|
+
// points. Routed to a dedicated head (not the existing column-vector
|
|
10105
|
+
// `Vector`, which has a narrower `(number+) -> vector` signature).
|
|
10106
|
+
{
|
|
10107
|
+
name: "GeometricVector",
|
|
10108
|
+
latexTrigger: ["\\operatorname{vector}"],
|
|
10109
|
+
kind: "function",
|
|
10110
|
+
serialize: (serializer, expr) => "\\operatorname{vector}" + serializer.wrapArguments(expr)
|
|
10111
|
+
},
|
|
10112
|
+
{
|
|
10113
|
+
name: "Sphere",
|
|
10114
|
+
latexTrigger: ["\\operatorname{sphere}"],
|
|
10115
|
+
kind: "function",
|
|
10116
|
+
serialize: (serializer, expr) => "\\operatorname{sphere}" + serializer.wrapArguments(expr)
|
|
10117
|
+
},
|
|
10118
|
+
{
|
|
10119
|
+
name: "Segment",
|
|
10120
|
+
latexTrigger: ["\\operatorname{segment}"],
|
|
10121
|
+
kind: "function",
|
|
10122
|
+
serialize: (serializer, expr) => "\\operatorname{segment}" + serializer.wrapArguments(expr)
|
|
10123
|
+
}
|
|
10124
|
+
];
|
|
10125
|
+
|
|
10126
|
+
// src/compute-engine/latex-syntax/dictionary/definitions-colors.ts
|
|
10127
|
+
var DEFINITIONS_COLORS = [
|
|
10128
|
+
// Color constructors (one per colorspace, preserves space on evaluation)
|
|
10129
|
+
{
|
|
10130
|
+
name: "Rgb",
|
|
10131
|
+
latexTrigger: ["\\operatorname{rgb}"],
|
|
10132
|
+
kind: "function",
|
|
10133
|
+
serialize: (serializer, expr) => "\\operatorname{rgb}" + serializer.wrapArguments(expr)
|
|
10134
|
+
},
|
|
10135
|
+
{
|
|
10136
|
+
name: "Hsv",
|
|
10137
|
+
latexTrigger: ["\\operatorname{hsv}"],
|
|
10138
|
+
kind: "function",
|
|
10139
|
+
serialize: (serializer, expr) => "\\operatorname{hsv}" + serializer.wrapArguments(expr)
|
|
10140
|
+
},
|
|
10141
|
+
{
|
|
10142
|
+
name: "Hsl",
|
|
10143
|
+
latexTrigger: ["\\operatorname{hsl}"],
|
|
10144
|
+
kind: "function",
|
|
10145
|
+
serialize: (serializer, expr) => "\\operatorname{hsl}" + serializer.wrapArguments(expr)
|
|
10146
|
+
},
|
|
10147
|
+
{
|
|
10148
|
+
name: "Oklab",
|
|
10149
|
+
latexTrigger: ["\\operatorname{oklab}"],
|
|
10150
|
+
kind: "function",
|
|
10151
|
+
serialize: (serializer, expr) => "\\operatorname{oklab}" + serializer.wrapArguments(expr)
|
|
10152
|
+
},
|
|
10153
|
+
{
|
|
10154
|
+
name: "Oklch",
|
|
10155
|
+
latexTrigger: ["\\operatorname{oklch}"],
|
|
10156
|
+
kind: "function",
|
|
10157
|
+
serialize: (serializer, expr) => "\\operatorname{oklch}" + serializer.wrapArguments(expr)
|
|
10158
|
+
},
|
|
10159
|
+
// Conversion functions (color → color in the named space)
|
|
10160
|
+
{
|
|
10161
|
+
name: "AsRgb",
|
|
10162
|
+
latexTrigger: ["\\operatorname{asRgb}"],
|
|
10163
|
+
kind: "function",
|
|
10164
|
+
serialize: (serializer, expr) => "\\operatorname{asRgb}" + serializer.wrapArguments(expr)
|
|
10165
|
+
},
|
|
10166
|
+
{
|
|
10167
|
+
name: "AsHsv",
|
|
10168
|
+
latexTrigger: ["\\operatorname{asHsv}"],
|
|
10169
|
+
kind: "function",
|
|
10170
|
+
serialize: (serializer, expr) => "\\operatorname{asHsv}" + serializer.wrapArguments(expr)
|
|
10171
|
+
},
|
|
10172
|
+
{
|
|
10173
|
+
name: "AsHsl",
|
|
10174
|
+
latexTrigger: ["\\operatorname{asHsl}"],
|
|
10175
|
+
kind: "function",
|
|
10176
|
+
serialize: (serializer, expr) => "\\operatorname{asHsl}" + serializer.wrapArguments(expr)
|
|
10177
|
+
},
|
|
10178
|
+
{
|
|
10179
|
+
name: "AsOklab",
|
|
10180
|
+
latexTrigger: ["\\operatorname{asOklab}"],
|
|
10181
|
+
kind: "function",
|
|
10182
|
+
serialize: (serializer, expr) => "\\operatorname{asOklab}" + serializer.wrapArguments(expr)
|
|
10183
|
+
},
|
|
10184
|
+
{
|
|
10185
|
+
name: "AsOklch",
|
|
10186
|
+
latexTrigger: ["\\operatorname{asOklch}"],
|
|
10187
|
+
kind: "function",
|
|
10188
|
+
serialize: (serializer, expr) => "\\operatorname{asOklch}" + serializer.wrapArguments(expr)
|
|
10189
|
+
},
|
|
10190
|
+
// Perceptual difference (returns a scalar in [0, ~1])
|
|
10191
|
+
{
|
|
10192
|
+
name: "ColorDelta",
|
|
10193
|
+
latexTrigger: ["\\operatorname{colorDelta}"],
|
|
10194
|
+
kind: "function",
|
|
10195
|
+
serialize: (serializer, expr) => "\\operatorname{colorDelta}" + serializer.wrapArguments(expr)
|
|
10196
|
+
}
|
|
10069
10197
|
];
|
|
10070
10198
|
|
|
10071
10199
|
// src/compute-engine/latex-syntax/dictionary/default-dictionary.ts
|
|
@@ -10096,7 +10224,8 @@ var LatexSyntax = (() => {
|
|
|
10096
10224
|
...DEFINITIONS_STATISTICS,
|
|
10097
10225
|
...DEFINITIONS_UNITS,
|
|
10098
10226
|
...DEFINITIONS_OTHERS,
|
|
10099
|
-
...DEFINITIONS_PHYSICS
|
|
10227
|
+
...DEFINITIONS_PHYSICS,
|
|
10228
|
+
...DEFINITIONS_COLORS
|
|
10100
10229
|
];
|
|
10101
10230
|
|
|
10102
10231
|
// src/math-json/symbols.ts
|
|
@@ -10261,6 +10390,17 @@ var LatexSyntax = (() => {
|
|
|
10261
10390
|
} else if (Array.isArray(openTrigger) && openTrigger.length > 0) {
|
|
10262
10391
|
openTokens.push(openTrigger[0]);
|
|
10263
10392
|
}
|
|
10393
|
+
const closeTrigger = indexedEntry.closeTrigger;
|
|
10394
|
+
const closeTokens = /* @__PURE__ */ new Set();
|
|
10395
|
+
if (typeof closeTrigger === "string") {
|
|
10396
|
+
const variants = DELIMITER_SHORTHAND[closeTrigger];
|
|
10397
|
+
if (variants) for (const v of variants) closeTokens.add(v);
|
|
10398
|
+
else closeTokens.add(closeTrigger);
|
|
10399
|
+
if (closeTrigger === "||") closeTokens.add("|");
|
|
10400
|
+
} else if (Array.isArray(closeTrigger) && closeTrigger.length > 0) {
|
|
10401
|
+
closeTokens.add(closeTrigger[0]);
|
|
10402
|
+
}
|
|
10403
|
+
indexedEntry.closeTokens = closeTokens;
|
|
10264
10404
|
for (const token of openTokens) {
|
|
10265
10405
|
const existing = result.matchfixByOpen.get(token);
|
|
10266
10406
|
if (existing) {
|
|
@@ -10452,11 +10592,7 @@ var LatexSyntax = (() => {
|
|
|
10452
10592
|
if (style === "scaled")
|
|
10453
10593
|
return joinLatex([`\\left${openDelim}`, inner, `\\right${closeDelim}`]);
|
|
10454
10594
|
if (style === "big")
|
|
10455
|
-
return joinLatex([
|
|
10456
|
-
`\\Bigl${openDelim}`,
|
|
10457
|
-
inner,
|
|
10458
|
-
`\\Bigr${closeDelim}`
|
|
10459
|
-
]);
|
|
10595
|
+
return joinLatex([`\\Bigl${openDelim}`, inner, `\\Bigr${closeDelim}`]);
|
|
10460
10596
|
return joinLatex([openDelim, inner, closeDelim]);
|
|
10461
10597
|
};
|
|
10462
10598
|
}
|
|
@@ -13185,7 +13321,7 @@ var LatexSyntax = (() => {
|
|
|
13185
13321
|
}
|
|
13186
13322
|
if (this.match("\\hskip") || this.match("\\kern")) {
|
|
13187
13323
|
this.skipSpace();
|
|
13188
|
-
this.match("-")
|
|
13324
|
+
if (!this.match("-")) this.match("+");
|
|
13189
13325
|
while (/^[\d.]$/.test(this.peek)) this.nextToken();
|
|
13190
13326
|
for (const unit of [
|
|
13191
13327
|
"pt",
|
|
@@ -13699,6 +13835,19 @@ var LatexSyntax = (() => {
|
|
|
13699
13835
|
}
|
|
13700
13836
|
for (const def of defs) {
|
|
13701
13837
|
this.index = start;
|
|
13838
|
+
if (def.closeTokens.size > 0) {
|
|
13839
|
+
let found = false;
|
|
13840
|
+
const tokens = this._tokens;
|
|
13841
|
+
for (let i = start; i < tokens.length; i++) {
|
|
13842
|
+
if (def.closeTokens.has(tokens[i])) {
|
|
13843
|
+
found = true;
|
|
13844
|
+
break;
|
|
13845
|
+
}
|
|
13846
|
+
}
|
|
13847
|
+
if (!found) continue;
|
|
13848
|
+
}
|
|
13849
|
+
if (typeof def.openTrigger === "string" && def.openTrigger === "." && !OPEN_DELIMITER_PREFIX[currentToken])
|
|
13850
|
+
continue;
|
|
13702
13851
|
const matched = this.matchDelimiter(def.openTrigger, def.closeTrigger);
|
|
13703
13852
|
if (!matched) continue;
|
|
13704
13853
|
const bodyStart = this.index;
|
|
@@ -15352,7 +15501,7 @@ var LatexSyntax = (() => {
|
|
|
15352
15501
|
}
|
|
15353
15502
|
|
|
15354
15503
|
// src/latex-syntax.ts
|
|
15355
|
-
var version = "0.
|
|
15504
|
+
var version = "0.56.0";
|
|
15356
15505
|
return __toCommonJS(latex_syntax_exports);
|
|
15357
15506
|
})();
|
|
15358
15507
|
Object.assign(exports, LatexSyntax); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/math-json.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.
|
|
1
|
+
/** Compute Engine 0.56.0 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isNumberObject(expr) {
|
|
@@ -115,7 +115,7 @@ function expressionToDictionaryValue(expr) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// src/math-json.ts
|
|
118
|
-
var version = "0.
|
|
118
|
+
var version = "0.56.0";
|
|
119
119
|
export {
|
|
120
120
|
dictionaryFromExpression,
|
|
121
121
|
isFunctionObject,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Compute Engine 0.
|
|
2
|
-
function b(n){return n!==null&&typeof n=="object"&&"num"in n}function s(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):j(n)||y(n)?null:n}function l(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function h(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function d(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function J(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function m(n){return typeof n=="string"&&y(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:s(n)?n.sym:null}function a(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=h(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function E(n){if(n===null)return null;if(M(n))return n;let t=a(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},o=h(n);for(let e=1;e<J(n);e++){let u=a(o[e]);u&&(i[u[0]]=O(u[1])??"Nothing")}return{dict:i}}return null}function g(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function j(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function y(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function O(n){return n==null?null:f(n)?n.str:b(n)?parseFloat(n.num):s(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var S="0.
|
|
1
|
+
/** Compute Engine 0.56.0 */
|
|
2
|
+
function b(n){return n!==null&&typeof n=="object"&&"num"in n}function s(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):j(n)||y(n)?null:n}function l(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function h(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function d(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function J(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function m(n){return typeof n=="string"&&y(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:s(n)?n.sym:null}function a(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=h(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function E(n){if(n===null)return null;if(M(n))return n;let t=a(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},o=h(n);for(let e=1;e<J(n);e++){let u=a(o[e]);u&&(i[u[0]]=O(u[1])??"Nothing")}return{dict:i}}return null}function g(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function j(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function y(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function O(n){return n==null?null:f(n)?n.str:b(n)?parseFloat(n.num):s(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var S="0.56.0";export{E as dictionaryFromExpression,r as isFunctionObject,f as isStringObject,s as isSymbolObject,g as mapArgs,d as operand,l as operator,c as stringValue,m as symbol,S as version};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** MathJSON 0.
|
|
1
|
+
/** MathJSON 0.56.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
|
-
var MathJson=(()=>{var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var O=(n,t)=>{for(var i in t)a(n,i,{get:t[i],enumerable:!0})},A=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!j.call(n,e)&&e!==i&&a(n,e,{get:()=>t[e],enumerable:!(o=E(t,e))||o.enumerable});return n};var S=n=>A(a({},"__esModule",{value:!0}),n);var T={};O(T,{dictionaryFromExpression:()=>d,isFunctionObject:()=>r,isStringObject:()=>f,isSymbolObject:()=>u,mapArgs:()=>J,operand:()=>b,operator:()=>s,stringValue:()=>c,symbol:()=>M,version:()=>V});function N(n){return n!==null&&typeof n=="object"&&"num"in n}function u(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function p(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):k(n)||m(n)?null:n}function s(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function y(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function D(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function M(n){return typeof n=="string"&&m(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:u(n)?n.sym:null}function h(n){let t=s(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=y(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function d(n){if(n===null)return null;if(p(n))return n;let t=h(n);if(t)return{[t[0]]:t[1]};if(s(n)==="Dictionary"){let i={},o=y(n);for(let e=1;e<D(n);e++){let l=h(o[e]);l&&(i[l[0]]=F(l[1])??"Nothing")}return{dict:i}}return null}function J(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function k(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function m(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function F(n){return n==null?null:f(n)?n.str:N(n)?parseFloat(n.num):u(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var V="0.
|
|
3
|
+
var MathJson=(()=>{var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var O=(n,t)=>{for(var i in t)a(n,i,{get:t[i],enumerable:!0})},A=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!j.call(n,e)&&e!==i&&a(n,e,{get:()=>t[e],enumerable:!(o=E(t,e))||o.enumerable});return n};var S=n=>A(a({},"__esModule",{value:!0}),n);var T={};O(T,{dictionaryFromExpression:()=>d,isFunctionObject:()=>r,isStringObject:()=>f,isSymbolObject:()=>u,mapArgs:()=>J,operand:()=>b,operator:()=>s,stringValue:()=>c,symbol:()=>M,version:()=>V});function N(n){return n!==null&&typeof n=="object"&&"num"in n}function u(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function p(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):k(n)||m(n)?null:n}function s(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function y(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function D(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function M(n){return typeof n=="string"&&m(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:u(n)?n.sym:null}function h(n){let t=s(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=y(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function d(n){if(n===null)return null;if(p(n))return n;let t=h(n);if(t)return{[t[0]]:t[1]};if(s(n)==="Dictionary"){let i={},o=y(n);for(let e=1;e<D(n);e++){let l=h(o[e]);l&&(i[l[0]]=F(l[1])??"Nothing")}return{dict:i}}return null}function J(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function k(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function m(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function F(n){return n==null?null:f(n)?n.str:N(n)?parseFloat(n.num):u(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var V="0.56.0";return S(T);})();
|
|
4
4
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/math-json.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** MathJSON 0.
|
|
1
|
+
/** MathJSON 0.56.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var MathJson = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -149,7 +149,7 @@ var MathJson = (() => {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/math-json.ts
|
|
152
|
-
var version = "0.
|
|
152
|
+
var version = "0.56.0";
|
|
153
153
|
return __toCommonJS(math_json_exports);
|
|
154
154
|
})();
|
|
155
155
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/numerics.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.
|
|
1
|
+
/** Compute Engine 0.56.0 */
|
|
2
2
|
|
|
3
3
|
// src/compute-engine/numeric-value/types.ts
|
|
4
4
|
var NumericValue = class {
|
|
@@ -3317,6 +3317,7 @@ var SCALAR_TYPES = [
|
|
|
3317
3317
|
];
|
|
3318
3318
|
var VALUE_TYPES = [
|
|
3319
3319
|
"value",
|
|
3320
|
+
"color",
|
|
3320
3321
|
...COLLECTION_TYPES,
|
|
3321
3322
|
...SCALAR_TYPES
|
|
3322
3323
|
];
|
|
@@ -4808,6 +4809,7 @@ var PRIMITIVE_SUBTYPES = {
|
|
|
4808
4809
|
symbol: [],
|
|
4809
4810
|
boolean: [],
|
|
4810
4811
|
string: [],
|
|
4812
|
+
color: [],
|
|
4811
4813
|
expression: EXPRESSION_TYPES
|
|
4812
4814
|
};
|
|
4813
4815
|
function isPrimitiveSubtype(lhs, rhs) {
|
|
@@ -8473,7 +8475,7 @@ function gammaln2(c) {
|
|
|
8473
8475
|
}
|
|
8474
8476
|
|
|
8475
8477
|
// src/numerics.ts
|
|
8476
|
-
var version = "0.
|
|
8478
|
+
var version = "0.56.0";
|
|
8477
8479
|
export {
|
|
8478
8480
|
BigNumericValue,
|
|
8479
8481
|
DEFAULT_PRECISION,
|