swagger-to-axios 1.0.8 → 1.0.10

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.
@@ -15,17 +15,17 @@ export const expandAllOf = (object) => {
15
15
  if (Array.isArray(target)) {
16
16
  return target.concat(source).filter((v, i, a) => a.indexOf(v) === i);
17
17
  }
18
- if (typeof target === 'object') {
18
+ if (target && typeof target === 'object') {
19
19
  expandAllOf(target);
20
20
  }
21
- if (typeof source === 'object') {
21
+ if (source && typeof source === 'object') {
22
22
  expandAllOf(source);
23
23
  }
24
24
  });
25
25
  Object.assign(object, override);
26
26
  }
27
27
  Object.keys(object).forEach((key) => {
28
- if (typeof object[key] === 'object') {
28
+ if (object[key] && typeof object[key] === 'object') {
29
29
  expandAllOf(object[key]);
30
30
  }
31
31
  });
@@ -61,7 +61,7 @@ export const getFolderList = async (swaggerList, cliType) => {
61
61
  const result = [];
62
62
  for (const element of swaggerList) {
63
63
  const { url, name = Math.random().toString() } = element;
64
- const json = await getSwaggerJson({ url, });
64
+ const json = await getSwaggerJson({ url });
65
65
  if (json === undefined)
66
66
  continue;
67
67
  const { tags, paths, servers } = json;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swagger-to-axios",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "将swagger转换成axios可用的api文件",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",