dolphindb 2.0.1025 → 2.0.1026

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/browser.d.ts CHANGED
@@ -2,7 +2,7 @@ import 'xshell/prototype.browser.js';
2
2
  import { Lock } from 'xshell/utils.browser.js';
3
3
  import { type WebSocketConnectionError } from 'xshell/net.browser.js';
4
4
  import { type DdbDecimal128Value, type DdbDecimal128VectorValue } from './data-types/decimal-128.js';
5
- import { BigInt128Array } from './shared/bigint-128-array.js';
5
+ import type { BigInt128Array } from './shared/bigint-128-array.js';
6
6
  import { DdbChartType, DdbDurationUnit, DdbForm, DdbFunctionType, DdbType } from './shared/constants.js';
7
7
  export * from './shared/constants.js';
8
8
  export type { DdbDecimal128Value, DdbDecimal128VectorValue } from './data-types/decimal-128.js';
package/browser.js CHANGED
@@ -1027,14 +1027,14 @@ export class DdbObj {
1027
1027
  case DdbType.decimal64:
1028
1028
  case DdbType.decimal128:
1029
1029
  const x = data[acc_len + i];
1030
- if (is_decimal_null_value(type_, x)) {
1030
+ if (is_decimal_null_value(type_, x))
1031
1031
  items[i] = '';
1032
- break;
1032
+ else {
1033
+ const { scale } = this.value;
1034
+ const s = String(x < 0 ? -x : x).padStart(scale, '0');
1035
+ const str = (x < 0 ? '-' : '') + (scale ? `${s.slice(0, -scale) || '0'}.${s.slice(-scale)}` : s);
1036
+ items[i] = options.colors ? green(str) : str;
1033
1037
  }
1034
- const { scale } = this.value;
1035
- const s = String(x < 0 ? -x : x).padStart(scale, '0');
1036
- const str = (x < 0 ? '-' : '') + (scale ? `${s.slice(0, -scale) || '0'}.${s.slice(-scale)}` : s);
1037
- items[i] = options.colors ? green(str) : str;
1038
1038
  break;
1039
1039
  case DdbType.complex:
1040
1040
  case DdbType.point: {
@@ -1494,6 +1494,8 @@ export function formati(obj, index, options = {}) {
1494
1494
  // av
1495
1495
  const type_ = obj.type - 64;
1496
1496
  let offset = 0;
1497
+ // array vector 中每一项如果为 null 都展示,避免多个逗号堆在一起的情况
1498
+ options = { ...options, nullstr: true };
1497
1499
  for (const { lengths, data, rows } of obj.value) {
1498
1500
  let acc_len = 0;
1499
1501
  if (offset + rows <= index) {
@@ -1514,14 +1516,15 @@ export function formati(obj, index, options = {}) {
1514
1516
  case DdbType.decimal64:
1515
1517
  case DdbType.decimal128:
1516
1518
  const x = data[acc_len + i];
1517
- if (is_decimal_null_value(type_, x)) {
1518
- items[i] = '';
1519
- break;
1519
+ if (is_decimal_null_value(type_, x))
1520
+ items[i] = options.colors ? grey('null') : 'null';
1521
+ else {
1522
+ const { scale } = obj.value;
1523
+ const s = String(x < 0 ? -x : x).padStart(scale, '0');
1524
+ const str = (x < 0 ? '-' : '') + (scale ? `${s.slice(0, -scale) || '0'}.${s.slice(-scale)}` : s);
1525
+ if (options.colors)
1526
+ items[i] = green(str);
1520
1527
  }
1521
- const { scale } = obj.value;
1522
- const s = String(x < 0 ? -x : x).padStart(scale, '0');
1523
- const str = (x < 0 ? '-' : '') + (scale ? `${s.slice(0, -scale) || '0'}.${s.slice(-scale)}` : s);
1524
- items[i] = options.colors ? green(str) : str;
1525
1528
  break;
1526
1529
  case DdbType.complex:
1527
1530
  case DdbType.point: {