mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 05:38:23 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
475be58aa7
16
packages/core/evaluators/src/utils/__tests__/mathjs.test.ts
Normal file
16
packages/core/evaluators/src/utils/__tests__/mathjs.test.ts
Normal 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]);
|
||||
});
|
||||
});
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user