Skip to content

Commit

Permalink
Merge pull request #354 from acomagu/main
Browse files Browse the repository at this point in the history
Add newline after hash comment in cache
  • Loading branch information
ryoppippi authored Jan 16, 2025
2 parents 66c0474 + 98bf514 commit 3b05d96
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 3b05d96

Please sign in to comment.