dolphindb 3.1.43 → 3.1.45

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
@@ -187,7 +187,7 @@ export interface InspectOptions {
187
187
  export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
188
188
  /** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
189
189
  export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
190
- export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | string[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbSymbolExtendedValue | DdbExtObjValue | DdbTensorValue | Uint8Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | IotVectorItemValue | DdbArrayVectorValue | DdbDecimal128VectorValue | DdbDurationVectorValue | DdbMatrixValue | DdbChartValue;
190
+ export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbSymbolExtendedValue | string[] | DdbExtObjValue | DdbTensorValue | Uint8Array<ArrayBufferLike> | DdbDecimal128VectorValue | BigInt128Array | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | IotVectorItemValue | DdbArrayVectorValue | DdbDurationVectorValue | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbMatrixValue | DdbChartValue;
191
191
  /** 转换一个向量到 js 原生数组 */
192
192
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
193
193
  /** 构造 void 类型,默认为 `DdbVoidType.undefined` */
package/browser.js CHANGED
@@ -1264,7 +1264,7 @@ export class DdbObj {
1264
1264
  case DdbForm.set: {
1265
1265
  const form = this.form;
1266
1266
  function format_array(items, ellipsis) {
1267
- const str_items = items.join(', ') + (ellipsis ? ', ...' : '');
1267
+ const str_items = items.join(', ') + (ellipsis ? ', ··' : '');
1268
1268
  return form === DdbForm.pair ?
1269
1269
  str_items
1270
1270
  :
@@ -1371,6 +1371,15 @@ export class DdbObj {
1371
1371
  items[i] = formati(this, i, options);
1372
1372
  return format_array(items, data.length > limit);
1373
1373
  }
1374
+ case DdbType.char: {
1375
+ const limit = 150;
1376
+ const value = this.value;
1377
+ const ellipsis = value.length > limit;
1378
+ return (seq(ellipsis ? limit : value.length)
1379
+ .map(i => convert(this.type, value[i], this.le))
1380
+ .join('')
1381
+ + (ellipsis ? '··' : '')).quote();
1382
+ }
1374
1383
  default: {
1375
1384
  const limit = this.type === DdbType.compressed ? 5 : 50;
1376
1385
  let items = new Array(Math.min(limit, this.value.length));