@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 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: AxiosResponse) => {
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: AxiosResponse) => {
207
+ .then((res: any) => {
209
208
  if (args.type == "raw") {
210
209
  return res;
211
210
  } else {
package/dist/index.js CHANGED
@@ -119,7 +119,7 @@ class Cpzxrobot {
119
119
  if (value && typeof value === 'object' && !Array.isArray(value)) {
120
120
  Object.assign(result, flattenParams(value, fullKey));
121
121
  }
122
- else {
122
+ else if (value) {
123
123
  result[fullKey] = value.toString();
124
124
  }
125
125
  });
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.68",
3
+ "version": "1.2.70",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {