Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-09-14 10:41:08 +00:00
commit 475be58aa7
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,16 @@
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import mathjs from '../mathjs';
describe('evaluators > mathjs', () => {
it('matrix type should be to array', () => {
expect(mathjs('range(1, 3, 1)')).toEqual([1, 2, 3]);
});
});

View File

@ -20,6 +20,9 @@ export default evaluate.bind(
}
return math.round(result, 9);
}
if (result instanceof math.Matrix) {
return result.toArray();
}
return result;
},
{ replaceKey: true },