gen-api-types 1.0.12 → 1.0.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +2 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gen-api-types",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "一个自动生成请求接口返回类型的 cli 小工具",
5
5
  "main": "./src/index.ts",
6
6
  "exports": {
package/src/cli/index.ts CHANGED
@@ -118,12 +118,8 @@ async function executeApiMethods(apiMethodsInfo: ApiMethodInfo[]): Promise<Execu
118
118
  try {
119
119
  // console.log(`🔍 Calling ${fullMethodName} with args:`, args);
120
120
  const result = apiMethod.apply(apiModule, args)
121
- if (result instanceof Promise) {
122
- const data = await result
123
- // console.log(`${fullMethodName} result`)
124
- return { data, typeName, fullMethodName }
125
- }
126
- return { error: 'not Promise method', fullMethodName, typeName }
121
+ const data = await Promise.resolve(result)
122
+ return { data, typeName, fullMethodName }
127
123
  } catch (error) {
128
124
  console.error(`❌ ${fullMethodName} execute error:`, error)
129
125
  return { error, fullMethodName, typeName }