@kevisual/router 0.0.25 → 0.0.26-alpha

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.
@@ -1,3 +0,0 @@
1
- declare const parseXml: (req: any) => Promise<any>;
2
-
3
- export { parseXml };
@@ -1,35 +0,0 @@
1
- import xml2js from 'xml2js';
2
-
3
- const parseXml = async (req) => {
4
- return await new Promise((resolve) => {
5
- // 读取请求数据
6
- let data = '';
7
- req.setEncoding('utf8');
8
- // 监听data事件,接收数据片段
9
- req.on('data', (chunk) => {
10
- data += chunk;
11
- });
12
- // 当请求结束时处理数据
13
- req.on('end', () => {
14
- try {
15
- // 使用xml2js解析XML
16
- xml2js.parseString(data, function (err, result) {
17
- if (err) {
18
- console.error('XML解析错误:', err);
19
- resolve(null);
20
- }
21
- else {
22
- const jsonString = JSON.stringify(result);
23
- resolve(jsonString);
24
- }
25
- });
26
- }
27
- catch (error) {
28
- console.error('处理请求时出错:', error);
29
- resolve(null);
30
- }
31
- });
32
- });
33
- };
34
-
35
- export { parseXml };
package/src/io.ts DELETED
@@ -1,6 +0,0 @@
1
- // TODO: Implement IOApp
2
- export class IOApp {
3
- constructor() {
4
- console.log('IoApp');
5
- }
6
- }