@khanacademy/kas 0.4.0 → 0.4.1
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/es/index.js +14 -4
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/nodes.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
|
11
11
|
|
|
12
12
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
13
13
|
const libName = "@khanacademy/kas";
|
|
14
|
-
const libVersion = "0.4.
|
|
14
|
+
const libVersion = "0.4.1";
|
|
15
15
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
16
16
|
|
|
17
17
|
// this is a @generated file
|
|
@@ -2879,6 +2879,7 @@ class Expr {
|
|
|
2879
2879
|
|
|
2880
2880
|
// return the child nodes of this node
|
|
2881
2881
|
exprArgs() {
|
|
2882
|
+
// @ts-expect-error: Type 'string | number | Expr | undefined' is not assignable to type 'string | Expr'.
|
|
2882
2883
|
return this.args().filter(isExpr);
|
|
2883
2884
|
}
|
|
2884
2885
|
|
|
@@ -3309,7 +3310,9 @@ class Add extends Seq {
|
|
|
3309
3310
|
return Mul.createOrAppend(left, right).flatten();
|
|
3310
3311
|
}
|
|
3311
3312
|
reduce(options) {
|
|
3312
|
-
return ___default["default"].reduce(this.terms,
|
|
3313
|
+
return ___default["default"].reduce(this.terms,
|
|
3314
|
+
// @ts-expect-error: Type 'Expr' is not assignable to type 'Num'.
|
|
3315
|
+
(memo, term) => {
|
|
3313
3316
|
return memo.add(term, options);
|
|
3314
3317
|
}, this.identity);
|
|
3315
3318
|
}
|
|
@@ -3689,7 +3692,9 @@ class Mul extends Seq {
|
|
|
3689
3692
|
}
|
|
3690
3693
|
}
|
|
3691
3694
|
reduce(options) {
|
|
3692
|
-
return ___default["default"].reduce(this.terms,
|
|
3695
|
+
return ___default["default"].reduce(this.terms,
|
|
3696
|
+
// @ts-expect-error: Type 'Expr' is not assignable to type 'Num'.
|
|
3697
|
+
(memo, term) => {
|
|
3693
3698
|
return memo.mul(term, options);
|
|
3694
3699
|
}, this.identity);
|
|
3695
3700
|
}
|
|
@@ -3890,9 +3895,14 @@ class Mul extends Seq {
|
|
|
3890
3895
|
var posOrNeg = function (num) {
|
|
3891
3896
|
return pos(num) || neg(num);
|
|
3892
3897
|
};
|
|
3898
|
+
|
|
3899
|
+
// @ts-expect-error: Type 'Expr' is not assignable to type 'Num'.
|
|
3893
3900
|
const posNum = numbers.find(pos);
|
|
3901
|
+
// @ts-expect-error: Type 'Expr' is not assignable to type 'Num'.
|
|
3894
3902
|
const negNum = numbers.find(neg);
|
|
3895
|
-
if (numbers.length > 1 && negNum && posNum &&
|
|
3903
|
+
if (numbers.length > 1 && negNum && posNum &&
|
|
3904
|
+
// @ts-expect-error: Type 'Expr' is not assignable to type 'Num'.
|
|
3905
|
+
___default["default"].every(numbers, posOrNeg)) {
|
|
3896
3906
|
var firstNeg = ___default["default"].indexOf(expr.terms, negNum);
|
|
3897
3907
|
var firstNum = ___default["default"].indexOf(expr.terms, posNum);
|
|
3898
3908
|
|