Skip to content

Commit 30bf85d

Browse files
committed
Some code cleanup.
1 parent 7524932 commit 30bf85d

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

webpack/localization-plugin/src/LocFilePreprocessor.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ export class LocFilePreprocessor {
5858
FileSystem.ensureEmptyFolder(this._options.generatedTsFolder);
5959

6060
const filesToIgnore: Set<string> = new Set<string>((this._options.filesToIgnore!).map((fileToIgnore) => {
61-
if (path.isAbsolute(fileToIgnore)) {
62-
return fileToIgnore;
63-
} else {
64-
return path.resolve(this._options.srcFolder, fileToIgnore);
65-
}
61+
return path.resolve(this._options.srcFolder, fileToIgnore);
6662
}));
6763

6864
const locJsonFilePaths: string[] = glob.sync(
@@ -113,7 +109,7 @@ export class LocFilePreprocessor {
113109
for (const stringName in locFileData) { // eslint-disable-line guard-for-in
114110
const { comment } = locFileData[stringName];
115111

116-
if (comment.trim()) {
112+
if (comment && comment.trim() !== '') {
117113
outputLines.push(...[
118114
'/**',
119115
` * ${comment.replace(/\*\//g, '*\\/')}`,

webpack/localization-plugin/src/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface ILocFile {
3434

3535
export interface ILocalizedString {
3636
value: string;
37-
comment: string;
37+
comment?: string;
3838
}
3939

4040
/**

webpack/localization-plugin/src/utilities/ResxReader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class ResxReader {
195195

196196
return {
197197
value,
198-
comment: comment || ''
198+
comment
199199
};
200200
}
201201
}

0 commit comments

Comments
 (0)