dolphindb 3.0.23 → 3.0.24

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
@@ -347,7 +347,7 @@ export interface ConvertOptions {
347
347
  /** `'string'` blob 类型数据的格式 */
348
348
  blob?: 'string' | 'binary';
349
349
  }
350
- export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob }?: ConvertOptions): string | number | bigint | boolean | Uint8Array | Int32Array | BigInt64Array | string[] | Int8Array | Int16Array | Float32Array | Float64Array | Uint8Array[] | number[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | BigInt128Array | DdbSymbolExtendedValue | DdbArrayVectorValue | DdbMatrixValue | DdbObj<DdbValue>[] | DdbDurationVectorValue | DdbChartValue;
350
+ export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob }?: ConvertOptions): string | number | bigint | boolean | Uint8Array | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | Int32Array | DdbDecimal64VectorValue | BigInt64Array | DdbDecimal128VectorValue | BigInt128Array | DdbSymbolExtendedValue | string[] | Int8Array | Int16Array | Float32Array | Float64Array | DdbArrayVectorValue | DdbMatrixValue | Uint8Array[] | DdbObj<DdbValue>[] | DdbDurationVectorValue | DdbChartValue | number[];
351
351
  /** 转换一个向量到 js 原生数组 */
352
352
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[];
353
353
  export declare class DdbVoid extends DdbObj<undefined> {
package/index.js CHANGED
@@ -1842,7 +1842,11 @@ export function converts(type, value, rows, le, options) {
1842
1842
  }
1843
1843
  case DdbType.complex:
1844
1844
  case DdbType.point:
1845
- return seq(rows, i => [value[2 * i], value[2 * (i + 1)]]);
1845
+ return seq(rows, i => {
1846
+ const x = value[2 * i];
1847
+ const y = value[2 * i + 1];
1848
+ return [x === nulls.double ? null : x, y === nulls.double ? null : y];
1849
+ });
1846
1850
  case DdbType.uuid:
1847
1851
  case DdbType.ipaddr:
1848
1852
  case DdbType.int128:
@@ -1868,25 +1872,21 @@ export function converts(type, value, rows, le, options) {
1868
1872
  return value.map(({ lengths, data, rows }) => {
1869
1873
  let acc_len = 0;
1870
1874
  return Array.prototype.map.call(lengths, (length) => {
1871
- const result = (() => {
1872
- switch (type_) {
1873
- case DdbType.decimal32:
1874
- case DdbType.decimal64:
1875
- case DdbType.decimal128:
1876
- return converts(type_, { scale: value.scale, data: data.subarray(acc_len, acc_len + length) }, length, le, options);
1877
- case DdbType.complex:
1878
- case DdbType.point:
1879
- return converts(type_, data.subarray(acc_len, acc_len + 2 * length), length, le, options);
1880
- case DdbType.uuid:
1881
- case DdbType.int128:
1882
- case DdbType.ipaddr:
1883
- return converts(type_, data.subarray(acc_len, acc_len + 16 * length), length, le, options);
1884
- default:
1885
- return converts(type_, data.subarray(acc_len, acc_len + length), length, le, options);
1886
- }
1887
- })();
1888
- acc_len += length;
1889
- return result;
1875
+ switch (type_) {
1876
+ case DdbType.decimal32:
1877
+ case DdbType.decimal64:
1878
+ case DdbType.decimal128:
1879
+ return converts(type_, { scale: value.scale, data: data.subarray(acc_len, acc_len += length) }, length, le, options);
1880
+ case DdbType.complex:
1881
+ case DdbType.point:
1882
+ return converts(type_, data.subarray(acc_len, acc_len += 2 * length), length, le, options);
1883
+ case DdbType.uuid:
1884
+ case DdbType.int128:
1885
+ case DdbType.ipaddr:
1886
+ return converts(type_, data.subarray(acc_len, acc_len += 16 * length), length, le, options);
1887
+ default:
1888
+ return converts(type_, data.subarray(acc_len, acc_len += length), length, le, options);
1889
+ }
1890
1890
  });
1891
1891
  }).flat();
1892
1892
  }