dolphindb 3.0.210 → 3.0.211
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 +5 -5
- package/browser.js +4 -4
- package/browser.js.map +1 -1
- package/docs.js.map +1 -1
- package/index.d.ts +5 -5
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +3 -3
package/browser.d.ts
CHANGED
|
@@ -281,7 +281,7 @@ export interface DdbMatrixData {
|
|
|
281
281
|
}
|
|
282
282
|
export type IotVectorItemValue = [number | string | bigint | boolean][];
|
|
283
283
|
export type DdbIotAnyVector = DdbObj<IotVectorItemValue>;
|
|
284
|
-
export type
|
|
284
|
+
export type Convertable = DdbObj | string | boolean | null | undefined;
|
|
285
285
|
/** 可以表示所有 DolphinDB 数据库中的数据类型 Can represent data types in all DolphinDB databases */
|
|
286
286
|
export declare class DdbObj<TValue extends DdbValue = DdbValue> {
|
|
287
287
|
static dec: TextDecoder;
|
|
@@ -358,10 +358,10 @@ export declare class DdbObj<TValue extends DdbValue = DdbValue> {
|
|
|
358
358
|
}, limit?: number): TensorData;
|
|
359
359
|
toString(options?: InspectOptions): string;
|
|
360
360
|
inspect_type(): string;
|
|
361
|
-
/** 自动转换
|
|
362
|
-
static to_ddbobj(value:
|
|
361
|
+
/** 自动转换 Convertable 为 DdbObj */
|
|
362
|
+
static to_ddbobj(value: Convertable): DdbObj;
|
|
363
363
|
/** 转换 js 数组为 DdbObj[] */
|
|
364
|
-
static to_ddbobjs(values:
|
|
364
|
+
static to_ddbobjs(values: Convertable[]): DdbObj<DdbValue>[];
|
|
365
365
|
/** @deprecated 用 data() */
|
|
366
366
|
to_cols(): {
|
|
367
367
|
title: string;
|
|
@@ -419,7 +419,7 @@ export interface ConvertOptions {
|
|
|
419
419
|
/** `'ms'` timestamp 类型转换为字符串表示时显示到秒还是毫秒 */
|
|
420
420
|
timestamp?: 's' | 'ms';
|
|
421
421
|
}
|
|
422
|
-
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean |
|
|
422
|
+
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDecimal128VectorValue | BigInt128Array | DdbSymbolExtendedValue | string[] | DdbArrayVectorValue | DdbMatrixValue | Uint8Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | IotVectorItemValue | DdbDurationVectorValue | number[] | DdbTensorValue | DdbChartValue;
|
|
423
423
|
/** 转换一个向量到 js 原生数组 */
|
|
424
424
|
export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
|
|
425
425
|
/** 构造 void 类型,默认为 `DdbVoidType.undefined` */
|
package/browser.js
CHANGED
|
@@ -1549,7 +1549,7 @@ export class DdbObj {
|
|
|
1549
1549
|
return `${DdbForm[this.form]} ${tname}`;
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
|
-
/** 自动转换
|
|
1552
|
+
/** 自动转换 Convertable 为 DdbObj */
|
|
1553
1553
|
static to_ddbobj(value) {
|
|
1554
1554
|
if (value && value instanceof DdbObj)
|
|
1555
1555
|
return value;
|
|
@@ -3300,7 +3300,7 @@ export class DDB {
|
|
|
3300
3300
|
async invoke(func, args, options) {
|
|
3301
3301
|
// 检查 args 是否全部为简单参数,是则直接调用 call,避免 invoke 间接调用
|
|
3302
3302
|
// 逻辑类似 DdbObj.to_ddbobjs, 需要同步修改
|
|
3303
|
-
let
|
|
3303
|
+
let convertable = true;
|
|
3304
3304
|
let has_ddbobj = false;
|
|
3305
3305
|
if (args)
|
|
3306
3306
|
for (const arg of args)
|
|
@@ -3313,10 +3313,10 @@ export class DDB {
|
|
|
3313
3313
|
const type = typeof arg;
|
|
3314
3314
|
if (type === 'string' || type === 'boolean') { } // simple
|
|
3315
3315
|
else
|
|
3316
|
-
|
|
3316
|
+
convertable = false;
|
|
3317
3317
|
}
|
|
3318
3318
|
let result;
|
|
3319
|
-
if (
|
|
3319
|
+
if (convertable)
|
|
3320
3320
|
result = await this.call(func, args, options);
|
|
3321
3321
|
else {
|
|
3322
3322
|
if (has_ddbobj)
|