Skip to content

Commit c353038

Browse files
committed
feat: 生成头尾部选项修正
1 parent 0a27f89 commit c353038

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/printer/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ export class Printer {
149149
print(configs?: PrinterConfigs) {
150150
Object.assign(this.configs, configs);
151151
const { hideHeaders, hideHelpers, hideFooters, hideInfo, hideComponents, hideImports, hidePaths } = this.configs;
152-
const headers = (this.options?.headers || []).join('\n');
153-
const footers = (this.options?.footers || []).join('\n');
152+
const header = (this.options?.header || '');
153+
const footer = (this.options?.footer || '');
154154

155155
return [
156-
!hideHeaders && headers,
156+
!hideHeaders && header,
157157
!hideInfo && this._printInfo(),
158158
!hideImports && this._printImports(),
159159
!hideHelpers && Printer.helpersCode,
160160
!hideComponents && this._printComponents(),
161161
!hidePaths && this._printPaths(),
162-
!hideFooters && footers,
162+
!hideFooters && footer,
163163
]
164164
.filter(Boolean)
165165
.join('\n\n');

src/printer/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ export interface PrinterOptions {
104104
/**
105105
* 生成文件的头部信息
106106
*/
107-
headers?: string[];
107+
header?: string;
108108

109109
/**
110110
* 生成文件的尾部信息
111111
*/
112-
footers?: string[];
112+
footer?: string;
113113
}
114114

115115
export interface PrinterConfigs {

0 commit comments

Comments
 (0)