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/CHANGELOG.md +15 -0
- package/CHANGELOG.zh.md +15 -0
- package/README.md +49 -36
- package/README.zh.md +38 -25
- package/browser.js +10 -2
- package/browser.js.map +1 -1
- package/index.js +11 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/shared/utils.d.ts +4 -0
- package/shared/utils.js +17 -0
- package/shared/utils.js.map +1 -0
package/package.json
CHANGED
package/shared/utils.js
ADDED
|
@@ -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"]}
|