防止一些比较极端的情况下导致的类型错误

This commit is contained in:
COOL 2024-08-21 10:19:30 +08:00
parent 1654cc3c52
commit 868564e7c2

View File

@ -1,13 +1,14 @@
import { App, Provide } from '@midwayjs/decorator';
import { BaseService } from '@cool-midway/core';
import * as ts from 'typescript';
import { IMidwayApplication } from '@midwayjs/core';
import * as path from 'path';
import * as fs from 'fs';
import { IMidwayApplication, Inject } from '@midwayjs/core';
import { App, Provide } from '@midwayjs/decorator';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { PluginInfoEntity } from '../entity/info';
import * as fs from 'fs';
import * as path from 'path';
import * as prettier from 'prettier';
import { Repository } from 'typeorm';
import * as ts from 'typescript';
import { Utils } from '../../../comm/utils';
import { PluginInfoEntity } from '../entity/info';
/**
*
@ -20,6 +21,9 @@ export class PluginTypesService extends BaseService {
@InjectEntityModel(PluginInfoEntity)
pluginInfoEntity: Repository<PluginInfoEntity>;
@Inject()
utils: Utils;
/**
* d.ts文件
* @param tsContent
@ -238,6 +242,7 @@ export class PluginTypesService extends BaseService {
const tsContent = pluginInfo.tsContent?.data;
if (tsContent) {
await this.generateDtsFile(pluginInfo.keyName, tsContent);
await this.utils.sleep(200);
}
}
}