dolphindb 3.0.105 → 3.0.106

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
@@ -400,7 +400,7 @@ export interface ConvertOptions {
400
400
  /** timestamp 类型转换为字符串表示时显示到秒还是毫秒 */
401
401
  timestamp?: 's' | 'ms';
402
402
  }
403
- export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, timestamp }?: ConvertOptions): string | number | bigint | boolean | Uint8Array | number[] | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array | BigInt64Array | string[] | Uint8Array[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | BigInt128Array | DdbObj<DdbValue>[] | DdbSymbolExtendedValue | DdbArrayVectorValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | DdbDurationVectorValue | DdbMatrixValue | DdbChartValue | DdbTensorValue;
403
+ export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, timestamp }?: ConvertOptions): string | number | bigint | boolean | Uint8Array | number[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array | BigInt64Array | BigInt128Array | string[] | Uint8Array[] | DdbObj<DdbValue>[] | DdbSymbolExtendedValue | DdbArrayVectorValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | DdbDurationVectorValue | DdbMatrixValue | DdbChartValue | DdbTensorValue;
404
404
  /** 转换一个向量到 js 原生数组 */
405
405
  export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[];
406
406
  export declare class DdbVoid extends DdbObj<undefined> {
package/index.js CHANGED
@@ -2974,12 +2974,12 @@ export class DDB {
2974
2974
  if (this.error)
2975
2975
  throw this.error;
2976
2976
  const args = DdbObj.to_ddbobjs(_args);
2977
- const rpc_id = ` (id = ${id})`;
2977
+ const rpc_id = `(id = ${id})`;
2978
2978
  const command = this.enc.encode((() => {
2979
2979
  switch (type) {
2980
2980
  case 'function':
2981
2981
  if (this.verbose)
2982
- console.log(func + inspect(args, { colors: false }) + rpc_id);
2982
+ console.log(func, args.map(arg => arg.data()), rpc_id);
2983
2983
  assert(!func.includes('\0'), t('发送至 DolphinDB 执行的脚本中间不能含有 \\0'));
2984
2984
  return 'function\n' +
2985
2985
  `${func}\n` +
@@ -2987,14 +2987,15 @@ export class DDB {
2987
2987
  `${Number(DDB.le_client)}\n`;
2988
2988
  case 'script':
2989
2989
  if (this.verbose)
2990
- console.log(script + rpc_id);
2990
+ console.log(script, rpc_id);
2991
2991
  assert(!script.includes('\0'), t('发送至 DolphinDB 执行的脚本中间不能含有 \\0'));
2992
2992
  return 'script\n' +
2993
2993
  script;
2994
2994
  case 'variable':
2995
2995
  if (this.verbose)
2996
- for (let i = 0; i < vars.length; i++)
2997
- console.log(`${vars[i]} = ${inspect(args[i], { colors: false })}`);
2996
+ vars.forEach((v, i) => {
2997
+ console.log(v, '=', args[i].data());
2998
+ });
2998
2999
  return 'variable\n' +
2999
3000
  `${vars.join(',')}\n` +
3000
3001
  `${vars.length}\n` +
@@ -3007,7 +3008,7 @@ export class DDB {
3007
3008
  `login(${this.username.quote()}, ${this.password.quote()})`
3008
3009
  :
3009
3010
  '') +
3010
- rpc_id);
3011
+ ` ${rpc_id}`);
3011
3012
  return 'connect\n' +
3012
3013
  // 详见 InterProcessIO.cpp#APISocketConsole::parseScript 中的
3013
3014
  // Util::startWith "connect"
@@ -3065,7 +3066,7 @@ export class DDB {
3065
3066
  ]));
3066
3067
  });
3067
3068
  if (this.verbose)
3068
- console.log(inspect(result) + rpc_id);
3069
+ console.log(result.data(), rpc_id);
3069
3070
  return result;
3070
3071
  });
3071
3072
  }