From 63f63612fab40c3def72d9ed50d0ac042a078677 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Wed, 4 May 2022 12:50:58 +0200 Subject: refactor!: target es2020 (#848) --- scripts/copyMimeTypes.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/copyMimeTypes.ts b/scripts/copyMimeTypes.ts index 9691070c..f56acff9 100644 --- a/scripts/copyMimeTypes.ts +++ b/scripts/copyMimeTypes.ts @@ -6,7 +6,7 @@ import options from '../.prettierrc.cjs'; const rootPath = path.resolve(__dirname, '..'); const mimeDbPath = path.resolve(rootPath, 'node_modules/mime-db/db.json'); -const mimeDbLicencePath = path.resolve( +const mimeDbLicensePath = path.resolve( rootPath, 'node_modules/mime-db/LICENSE' ); @@ -20,10 +20,8 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - const licence = fs.readFileSync(mimeDbLicencePath, { encoding: 'utf8' }); - const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${ - licence as string - }*/\n\nexport default ${data as string};\n`; + const license = fs.readFileSync(mimeDbLicensePath, { encoding: 'utf8' }); + const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${license}*/\n\nexport default ${data};\n`; fs.writeFile( mimeTypesTsPath, @@ -33,7 +31,7 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - console.log(`Mime types copied to ${mimeTypesTsPath as string}`); + console.log(`Mime types copied to ${mimeTypesTsPath}`); } ); }); -- cgit v1.2.3