Skip to content

Commit

Permalink
Add newline after hash comment in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
acomagu committed Dec 14, 2024
1 parent 04fac5c commit 98bf514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/unplugin-typia/src/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Cache {
}

private get hashComment() {
return `/* unplugin-typia-${typiaVersion ?? ''}-${this.#hashKey} */`;
return `/* unplugin-typia-${typiaVersion ?? ''}-${this.#hashKey} */\n`;
}

private isWritable(filename: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin-typia/tests/cache.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function removeComments(data: string | undefined) {
}

// eslint-disable-next-line regexp/no-unused-capturing-group
return data.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '');
return data.replace(/\/\*[\s\S]*?\*\/\n?|([^\\:]|^)\/\/.*$/gm, '');
}

it('return null if cache is not found', async () => {
Expand Down

0 comments on commit 98bf514

Please sign in to comment.