dolphindb 2.0.500 → 2.0.503
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/README.md +13 -3
- package/README.zh.md +13 -3
- package/browser.d.ts +51 -21
- package/browser.js +114 -60
- package/browser.js.map +1 -1
- package/index.d.ts +48 -20
- package/index.js +111 -59
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/test.d.ts +0 -1
- package/test.js +0 -38
- package/test.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dolphindb",
|
|
3
3
|
"description": "DolphinDB JavaScript API",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.0.503",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"browser": "./browser.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "tsc && node ./test.js"
|
|
9
|
+
"test": "tsc && node ./test/index.js"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=17.3.1"
|
package/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/test.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const strict_1 = tslib_1.__importDefault(require("assert/strict"));
|
|
5
|
-
const index_js_1 = require("./index.js");
|
|
6
|
-
(async function test() {
|
|
7
|
-
console.log('--- 测试开始 ---');
|
|
8
|
-
console.log('连接到 ws://127.0.0.1:8848');
|
|
9
|
-
let ddb = new index_js_1.DDB('ws://127.0.0.1:8848');
|
|
10
|
-
await ddb.connect();
|
|
11
|
-
console.log('测试通过 ddb.call 调用 getNodeAlias 函数');
|
|
12
|
-
console.log(await ddb.call('getNodeAlias'));
|
|
13
|
-
console.log('测试 ddb.call 上传不同类型的变量');
|
|
14
|
-
const result0 = await ddb.call('typestr', [new index_js_1.DdbInt(1)]);
|
|
15
|
-
console.log(result0);
|
|
16
|
-
(0, strict_1.default)(result0.form === index_js_1.DdbForm.scalar);
|
|
17
|
-
(0, strict_1.default)(result0.type === index_js_1.DdbType.string);
|
|
18
|
-
(0, strict_1.default)(result0.value === 'INT');
|
|
19
|
-
console.log('测试 ddb.call 上传不同类型的变量');
|
|
20
|
-
const result1 = await ddb.call('typestr', [new index_js_1.DdbVectorDouble([0.1, 0.2, 0.3])]);
|
|
21
|
-
console.log(result1);
|
|
22
|
-
(0, strict_1.default)(result1.form === index_js_1.DdbForm.scalar);
|
|
23
|
-
(0, strict_1.default)(result1.type === index_js_1.DdbType.string);
|
|
24
|
-
(0, strict_1.default)(result1.value === 'FAST DOUBLE VECTOR');
|
|
25
|
-
console.log('测试 array vector 和 print message');
|
|
26
|
-
const av = await ddb.eval('print("test print message 中文")\n' +
|
|
27
|
-
'av = array(INT[], 0, 3)\n' +
|
|
28
|
-
'append!(av, [1..4])\n' +
|
|
29
|
-
'append!(av, [1..70000])\n' +
|
|
30
|
-
'av\n');
|
|
31
|
-
console.log(av);
|
|
32
|
-
(0, strict_1.default)(av.form === index_js_1.DdbForm.vector);
|
|
33
|
-
(0, strict_1.default)(av.type === index_js_1.DdbType.int + 64); // array vector 的 type 比较特殊,需要偏移 64
|
|
34
|
-
(0, strict_1.default)(av.rows === 2);
|
|
35
|
-
ddb.disconnect();
|
|
36
|
-
console.log('--- 测试通过 ---');
|
|
37
|
-
})();
|
|
38
|
-
//# sourceMappingURL=test.js.map
|
package/test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;AAAA,mEAAkC;AAElC,yCAEC;AAAA,CAAC,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAE3B,OAAO,CAAC,GAAG,CA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,iCAAiC,CAAC,CAAA;IAC9C,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,IAAI,CACrB,kCAAkC;QAClC,2BAA2B;QAC3B,uBAAuB;QACvB,2BAA2B;QAC3B,MAAM,CACT,CAAA;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACf,IAAA,gBAAM,EAAC,EAAE,CAAC,IAAI,KAAK,kBAAO,CAAC,MAAM,CAAC,CAAA;IAClC,IAAA,gBAAM,EAAC,EAAE,CAAC,IAAI,KAAK,kBAAO,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA,CAAE,mCAAmC;IACzE,IAAA,gBAAM,EAAC,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAA;IAGrB,GAAG,CAAC,UAAU,EAAE,CAAA;IAEhB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAC/B,CAAC,CAAC,EAAE,CAAA","sourcesContent":["import assert from 'assert/strict'\n\nimport { DDB, DdbForm, DdbInt, DdbType, DdbVectorDouble } from './index.js'\n\n;(async function test () {\n console.log('--- 测试开始 ---')\n \n console.log('连接到 ws://127.0.0.1:8848')\n let ddb = new DDB('ws://127.0.0.1:8848')\n await ddb.connect()\n \n console.log('测试通过 ddb.call 调用 getNodeAlias 函数')\n console.log(\n await ddb.call('getNodeAlias')\n )\n \n console.log('测试 ddb.call 上传不同类型的变量')\n const result0 = await ddb.call('typestr', [new DdbInt(1)])\n console.log(result0)\n assert(result0.form === DdbForm.scalar)\n assert(result0.type === DdbType.string)\n assert(result0.value === 'INT')\n \n \n console.log('测试 ddb.call 上传不同类型的变量')\n const result1 = await ddb.call('typestr', [new DdbVectorDouble([0.1, 0.2, 0.3])])\n console.log(result1)\n assert(result1.form === DdbForm.scalar)\n assert(result1.type === DdbType.string)\n assert(result1.value === 'FAST DOUBLE VECTOR')\n \n \n console.log('测试 array vector 和 print message')\n const av = await ddb.eval(\n 'print(\"test print message 中文\")\\n' +\n 'av = array(INT[], 0, 3)\\n' +\n 'append!(av, [1..4])\\n' +\n 'append!(av, [1..70000])\\n' +\n 'av\\n'\n )\n console.log(av)\n assert(av.form === DdbForm.vector)\n assert(av.type === DdbType.int + 64) // array vector 的 type 比较特殊,需要偏移 64\n assert(av.rows === 2)\n \n \n ddb.disconnect()\n \n console.log('--- 测试通过 ---')\n})()\n"]}
|