dolphindb 3.1.38 → 3.1.39
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 +1 -1
- package/browser.js +7 -7
- package/browser.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ export interface InspectOptions extends UtilInspectOptions {
|
|
|
175
175
|
export declare function format(type: DdbType, value: DdbValue, le: boolean, options?: InspectOptions): string;
|
|
176
176
|
/** 格式化向量、集合中的第 index 项为字符串,空值返回 'null' 字符串 formatted vector, the index-th item in the collection is a string, a null value returns a 'null' string */
|
|
177
177
|
export declare function formati(obj: DdbVectorObj, index: number, options?: InspectOptions): string;
|
|
178
|
-
export declare function convert(type: DdbType, value: DdbValue, le: boolean, { blob, char, timestamp }?: ConvertOptions): string | number | bigint | boolean | number[] | DdbFunctionDefValue | DdbDurationValue | DdbDecimal32Value | DdbDecimal64Value |
|
|
178
|
+
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 | string[] | IotVectorItemValue | DdbSymbolExtendedValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue | DdbDurationVectorValue | DdbTensorValue | DdbExtObjValue | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigInt128Array | Uint8Array<ArrayBufferLike>[] | DdbObj<DdbValue>[] | DdbArrayVectorValue | DdbDecimal128VectorValue | DdbMatrixValue | DdbChartValue;
|
|
179
179
|
/** 转换一个向量到 js 原生数组 */
|
|
180
180
|
export declare function converts(type: DdbType, value: DdbVectorValue, rows: number, le: boolean, options?: ConvertOptions): any[] | Uint8Array;
|
|
181
181
|
/** 构造 void 类型,默认为 `DdbVoidType.undefined` */
|
package/index.js
CHANGED
|
@@ -1563,13 +1563,13 @@ export class DdbObj {
|
|
|
1563
1563
|
return obj;
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
const
|
|
1566
|
+
const gray_nullstr = 'null'.gray;
|
|
1567
1567
|
function format_time(type, value, options) {
|
|
1568
1568
|
if (value === null ||
|
|
1569
1569
|
value === ((type === DdbType.timestamp ||
|
|
1570
1570
|
type === DdbType.nanotime ||
|
|
1571
1571
|
type === DdbType.nanotimestamp) ? nulls.int64 : nulls.int32))
|
|
1572
|
-
return options.colors ?
|
|
1572
|
+
return options.colors ? gray_nullstr : 'null';
|
|
1573
1573
|
let str;
|
|
1574
1574
|
// formatter 可能会在 value 不属于 new Date() 有效值时,调用 抛出错误,这里统一处理
|
|
1575
1575
|
try {
|
|
@@ -1588,7 +1588,7 @@ function format_time(type, value, options) {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
function format_number(type, value, options) {
|
|
1590
1590
|
return value === null || value === number_nulls.get(type) ?
|
|
1591
|
-
options.colors ?
|
|
1591
|
+
options.colors ? gray_nullstr : 'null'
|
|
1592
1592
|
: colored(get_number_formatter(type === DdbType.int || type === DdbType.long || type === DdbType.short, options.decimals, options.grouping).format(value), 'green', options.colors);
|
|
1593
1593
|
}
|
|
1594
1594
|
/** 根据 DdbType 格式化单个元素 (value) 为字符串,空值返回 'null' 字符串 */
|
|
@@ -1596,7 +1596,7 @@ export function format(type, value, le, options = {}) {
|
|
|
1596
1596
|
switch (type) {
|
|
1597
1597
|
case DdbType.void: {
|
|
1598
1598
|
const str = value === DdbVoidType.default ? 'default' : 'null';
|
|
1599
|
-
return options.colors ? str.
|
|
1599
|
+
return options.colors ? str.gray : str;
|
|
1600
1600
|
}
|
|
1601
1601
|
case DdbType.bool:
|
|
1602
1602
|
return inspect((value === null || value === nulls.int8) ?
|