-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d8d76e
commit 5f8731c
Showing
8 changed files
with
127 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { promises as fs } from 'node:fs'; | ||
import { listFiles } from 'poku'; | ||
|
||
const ensureNodeCompatibility = async (path: string) => { | ||
const files = await listFiles(path, { | ||
filter: /\.(|m)?(j)?s$/, | ||
}); | ||
|
||
console.log('Ensuring no unnecessary comments for:', files); | ||
|
||
for (const file of files) { | ||
const raw = await fs.readFile(file, 'utf8'); | ||
const content = raw.replace(/(\/\*)((?:|[^1])+?)\//gim, ''); | ||
|
||
await fs.writeFile(file, content, { encoding: 'utf8' }); | ||
} | ||
}; | ||
|
||
ensureNodeCompatibility('./lib'); |