dolphindb 3.1.21 → 3.1.23

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
@@ -1,6 +1,6 @@
1
1
  import type { InspectOptions as UtilInspectOptions } from 'util';
2
2
  import type { Dayjs } from 'dayjs';
3
- import { inspect, Lock, type WebSocket, type WebSocketConnectionError } from 'xshell';
3
+ import { inspect, Lock, type WebSocketConnectionError } from 'xshell';
4
4
  import { DdbChartType, DdbForm, DdbFunctionType, DdbType, DdbVoidType, type ConvertOptions, type DdbDecimal32Value, type DdbDecimal32VectorValue, type DdbDecimal64Value, type DdbDecimal64VectorValue, type DdbDurationValue, type DdbDurationVectorValue, type DdbFunctionDefValue, type DdbRpcType, type DdbScalarValue, type DdbSymbolExtendedValue, type DdbTableData, type DdbTensorValue, type IotVectorItemValue, type TensorData, type DdbExtObjValue, type ConvertableDdbTimeValue } from './common.ts';
5
5
  export * from './common.ts';
6
6
  export interface DdbDecimal128VectorValue {
@@ -174,7 +174,7 @@ export interface InspectOptions extends UtilInspectOptions {
174
174
  export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
175
175
  /** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
176
176
  export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
177
- 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;
177
+ export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | Uint8Array<ArrayBufferLike> | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | string[] | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | IotVectorItemValue | DdbSymbolExtendedValue | DdbArrayVectorValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | DdbDurationVectorValue | DdbMatrixValue | DdbChartValue | DdbTensorValue | DdbExtObjValue;
178
178
  /** 转换一个向量到 js 原生数组 */
179
179
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
180
180
  /** 构造 void 类型,默认为 `DdbVoidType.undefined` */
package/index.js CHANGED
@@ -1557,13 +1557,12 @@ export class DdbObj {
1557
1557
  }
1558
1558
  }
1559
1559
  const grey_nullstr = 'null'.grey;
1560
- const nullstr = 'null';
1561
1560
  function format_time(type, value, options) {
1562
1561
  if (value === null ||
1563
1562
  value === ((type === DdbType.timestamp ||
1564
1563
  type === DdbType.nanotime ||
1565
1564
  type === DdbType.nanotimestamp) ? nulls.int64 : nulls.int32))
1566
- return options.colors ? grey_nullstr : nullstr;
1565
+ return options.colors ? grey_nullstr : 'null';
1567
1566
  let str;
1568
1567
  // formatter 可能会在 value 不属于 new Date() 有效值时,调用 抛出错误,这里统一处理
1569
1568
  try {
@@ -1582,7 +1581,7 @@ function format_time(type, value, options) {
1582
1581
  }
1583
1582
  function format_number(type, value, options) {
1584
1583
  return value === null || value === number_nulls.get(type) ?
1585
- options.colors ? grey_nullstr : nullstr
1584
+ options.colors ? grey_nullstr : 'null'
1586
1585
  : colored(get_number_formatter(type === DdbType.int || type === DdbType.long || type === DdbType.short, options.decimals, options.grouping).format(value), 'green', options.colors);
1587
1586
  }
1588
1587
  /** 根据 DdbType 格式化单个元素 (value) 为字符串,空值返回 'null' 字符串 */