mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
chore: add benchmark
This commit is contained in:
@@ -3,19 +3,13 @@ import fs from 'node:fs'
|
||||
const dirs = ['']
|
||||
for await (const dir of dirs) {
|
||||
await Promise.all(
|
||||
fs.readdirSync(`benchDist${dir}`).map(async (file) => {
|
||||
if (!file.endsWith('.js')) {
|
||||
fs.readdirSync(`dist${dir}`).map(async (file) => {
|
||||
if (!file.endsWith('.js') && !file.endsWith('.map') && !file.endsWith('.ts')) {
|
||||
dirs.push(`${dir}/${file}`)
|
||||
return
|
||||
}
|
||||
const content = await fs.promises.readFile(
|
||||
`benchDist${dir}/${file}`,
|
||||
'utf-8'
|
||||
)
|
||||
fs.promises.writeFile(
|
||||
`benchDist${dir}/${file}`,
|
||||
content.replace(/src\//g, 'dist/').replace(/\.ts/g, '.js')
|
||||
)
|
||||
})
|
||||
const content = await fs.promises.readFile(`dist${dir}/${file}`, 'utf-8')
|
||||
fs.promises.writeFile(`dist${dir}/${file}`, content.replace(/src\//g, 'dist/').replace(/\.ts/g, '.js'))
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user