dolphindb 2.0.906 → 2.0.908

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/index.js CHANGED
@@ -1084,13 +1084,13 @@ export class DdbObj {
1084
1084
  // av
1085
1085
  const type_ = this.type - 64;
1086
1086
  const limit = 10;
1087
- let items = new Array(Math.min(limit, this.rows));
1087
+ let array_items = new Array(Math.min(limit, this.rows));
1088
1088
  let i_items = 0;
1089
1089
  for (const { lengths, data } of this.value) {
1090
1090
  let acc_len = 0;
1091
1091
  for (const length of lengths) {
1092
- let _items = new Array(Math.min(limit, length));
1093
- for (let i = 0; i < _items.length; i++)
1092
+ let items = new Array(Math.min(limit, length));
1093
+ for (let i = 0; i < items.length; i++)
1094
1094
  switch (type_) {
1095
1095
  case DdbType.decimal32:
1096
1096
  case DdbType.decimal64:
@@ -1101,25 +1101,32 @@ export class DdbObj {
1101
1101
  const { scale } = this.value;
1102
1102
  const s = String(x < 0 ? -x : x).padStart(scale, '0');
1103
1103
  const str = (x < 0 ? '-' : '') + (scale ? `${s.slice(0, -scale) || '0'}.${s.slice(-scale)}` : s);
1104
- _items[i] = options.colors ? str.green : str;
1104
+ items[i] = options.colors ? str.green : str;
1105
1105
  break;
1106
1106
  case DdbType.complex:
1107
1107
  case DdbType.point: {
1108
1108
  const index = acc_len + i;
1109
- _items[i] = format(type_, data.subarray(2 * index, 2 * (index + 1)), this.le, options);
1109
+ items[i] = format(type_, data.subarray(2 * index, 2 * (index + 1)), this.le, options);
1110
+ break;
1111
+ }
1112
+ case DdbType.uuid:
1113
+ case DdbType.int128:
1114
+ case DdbType.ipaddr: {
1115
+ const index = acc_len + i;
1116
+ items[i] = format(type_, data.subarray(16 * index, 16 * (index + 1)), this.le, options);
1110
1117
  break;
1111
1118
  }
1112
1119
  default:
1113
- _items[i] = format(type_, data[acc_len + i], this.le, options);
1120
+ items[i] = format(type_, data[acc_len + i], this.le, options);
1114
1121
  break;
1115
1122
  }
1116
- items[i_items++] = format_array(_items, length > limit);
1123
+ array_items[i_items++] = format_array(items, length > limit);
1117
1124
  acc_len += length;
1118
1125
  }
1119
1126
  if (i_items >= limit)
1120
1127
  break;
1121
1128
  }
1122
- return format_array(items, this.rows > limit);
1129
+ return format_array(array_items, this.rows > limit);
1123
1130
  }
1124
1131
  switch (this.type) {
1125
1132
  case DdbType.symbol_extended: {
@@ -1527,6 +1534,13 @@ export function formati(obj, index, options = {}) {
1527
1534
  items[i] = format(type_, data.subarray(2 * index, 2 * (index + 1)), obj.le, options);
1528
1535
  break;
1529
1536
  }
1537
+ case DdbType.uuid:
1538
+ case DdbType.int128:
1539
+ case DdbType.ipaddr: {
1540
+ const index = acc_len + i;
1541
+ items[i] = format(type_, data.subarray(16 * index, 16 * (index + 1)), obj.le, options);
1542
+ break;
1543
+ }
1530
1544
  default:
1531
1545
  items[i] = format(type_, data[acc_len + i], obj.le, options);
1532
1546
  break;