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/index.d.ts CHANGED
@@ -177,7 +177,7 @@ export interface InspectOptions extends UtilInspectOptions {
177
177
  export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
178
178
  /** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
179
179
  export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
180
- 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> | IotVectorItemValue | DdbDurationVectorValue | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbArrayVectorValue | DdbDecimal128VectorValue | DdbMatrixValue | DdbChartValue;
180
+ 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> | IotVectorItemValue | DdbDurationVectorValue | DdbDecimal128VectorValue | BigInt128Array | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | DdbArrayVectorValue | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbMatrixValue | DdbChartValue;
181
181
  /** 转换一个向量到 js 原生数组 */
182
182
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
183
183
  /** 构造 void 类型,默认为 `DdbVoidType.undefined` */
package/index.js CHANGED
@@ -1270,7 +1270,7 @@ export class DdbObj {
1270
1270
  case DdbForm.set: {
1271
1271
  const form = this.form;
1272
1272
  function format_array(items, ellipsis) {
1273
- const str_items = items.join(', ') + (ellipsis ? ', ...' : '');
1273
+ const str_items = items.join(', ') + (ellipsis ? ', ··' : '');
1274
1274
  return form === DdbForm.pair ?
1275
1275
  str_items
1276
1276
  :
@@ -1378,6 +1378,15 @@ export class DdbObj {
1378
1378
  items[i] = formati(this, i, options);
1379
1379
  return format_array(items, data.length > limit);
1380
1380
  }
1381
+ case DdbType.char: {
1382
+ const limit = 150;
1383
+ const value = this.value;
1384
+ const ellipsis = value.length > limit;
1385
+ return (seq(ellipsis ? limit : value.length)
1386
+ .map(i => convert(this.type, value[i], this.le))
1387
+ .join('')
1388
+ + (ellipsis ? '··' : '')).quote();
1389
+ }
1381
1390
  default: {
1382
1391
  const limit = this.type === DdbType.compressed ? 5 : 50;
1383
1392
  let items = new Array(Math.min(limit, this.value.length));