@cpzxrobot/sdk 1.2.68 → 1.2.70
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/device_filter.ts +2 -3
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/device_filter.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Cpzxrobot, type DataQueryArgs } from ".";
|
|
2
|
-
import type { AxiosResponse } from "axios";
|
|
3
2
|
import { FieldDatas, SensorDatas } from "./sensor_datas";
|
|
4
3
|
|
|
5
4
|
export abstract class DeviceFilter<T extends { id: number }> {
|
|
@@ -153,7 +152,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
153
152
|
}
|
|
154
153
|
);
|
|
155
154
|
if (args.type == "raw") {
|
|
156
|
-
return p1.then((res:
|
|
155
|
+
return p1.then((res: any) => {
|
|
157
156
|
var string = res.data.data as string;
|
|
158
157
|
string = string.replace(/\r/g, "");
|
|
159
158
|
var arr = string.split("\n");
|
|
@@ -205,7 +204,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
205
204
|
return this.wrapData(id, args, p1);
|
|
206
205
|
}
|
|
207
206
|
})
|
|
208
|
-
.then((res:
|
|
207
|
+
.then((res: any) => {
|
|
209
208
|
if (args.type == "raw") {
|
|
210
209
|
return res;
|
|
211
210
|
} else {
|
package/dist/index.js
CHANGED
package/index.ts
CHANGED
|
@@ -137,7 +137,7 @@ export class Cpzxrobot {
|
|
|
137
137
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
138
138
|
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
139
139
|
Object.assign(result, flattenParams(value, fullKey));
|
|
140
|
-
} else {
|
|
140
|
+
} else if(value){
|
|
141
141
|
result[fullKey] = value.toString();
|
|
142
142
|
}
|
|
143
143
|
});
|