dolphindb 2.0.1036 → 2.0.1101

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dolphindb",
3
3
  "description": "DolphinDB JavaScript API",
4
- "version": "2.0.1036",
4
+ "version": "2.0.1101",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "browser": "./browser.js",
@@ -0,0 +1,4 @@
1
+ import { DdbType } from './constants.js';
2
+ export declare function is_decimal_type(type: DdbType): boolean;
3
+ export declare function is_decimal_null_value(type: DdbType, value: number | bigint): boolean;
4
+ export declare function get_duration_unit(code: number): string;
@@ -0,0 +1,17 @@
1
+ import { nulls, DdbType } from './constants.js';
2
+ export function is_decimal_type(type) {
3
+ return type === DdbType.decimal32 || type === DdbType.decimal64 || type === DdbType.decimal128;
4
+ }
5
+ export function is_decimal_null_value(type, value) {
6
+ return ((value === nulls.int128 && type === DdbType.decimal128) ||
7
+ (value === nulls.int64 && type === DdbType.decimal64) ||
8
+ (value === nulls.int32 && type === DdbType.decimal32));
9
+ }
10
+ export function get_duration_unit(code) {
11
+ let str = String.fromCharCode((code >> 24) & 255);
12
+ str += String.fromCharCode((code >> 16) & 255);
13
+ str += String.fromCharCode((code >> 8) & 255);
14
+ str += String.fromCharCode(code & 255);
15
+ return str;
16
+ }
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG/C,MAAM,UAAU,eAAe,CAAE,IAAa;IAC1C,OAAO,IAAI,KAAK,OAAO,CAAC,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,UAAU,CAAA;AAClG,CAAC;AAGD,MAAM,UAAU,qBAAqB,CAAE,IAAa,EAAE,KAAsB;IACxE,OAAO,CACH,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,IAAI,IAAI,KAAK,OAAO,CAAC,UAAU,CAAC;QACvD,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC;QACrD,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC,CACxD,CAAA;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,IAAY;IAC3C,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IACjD,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAC9C,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAA;IAC7C,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,GAAG,GAAG,CAAC,CAAA;IACtC,OAAO,GAAG,CAAA;AACd,CAAC","sourcesContent":["import { nulls, DdbType } from './constants.js'\n\n\nexport function is_decimal_type (type: DdbType) {\n return type === DdbType.decimal32 || type === DdbType.decimal64 || type === DdbType.decimal128\n}\n\n\nexport function is_decimal_null_value (type: DdbType, value: number | bigint) {\n return (\n (value === nulls.int128 && type === DdbType.decimal128) ||\n (value === nulls.int64 && type === DdbType.decimal64) ||\n (value === nulls.int32 && type === DdbType.decimal32)\n )\n}\n\nexport function get_duration_unit (code: number) {\n let str = String.fromCharCode((code >> 24) & 255)\n str += String.fromCharCode((code >> 16) & 255)\n str += String.fromCharCode((code >> 8) & 255)\n str += String.fromCharCode(code & 255)\n return str\n}\n\n"]}