Skip to content

Commit f7b801a

Browse files
committed
fix: remove the js
1 parent d58d68f commit f7b801a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+30
-34616
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
"lint": "eslint src/**/*.ts",
112112
"pregenerate-docs": "node deletedocs.js",
113113
"generate-docs": "jsdoc -c jsdoc.json --readme README.md",
114-
"find-untyped": "ts-node scripts/findUntyped.ts"
114+
"find-untyped": "ts-node scripts/findUntyped.ts",
115+
"delete-js": "ts-node scripts/deleteJsFiles.ts"
115116
},
116117
"browserslist": [
117118
"last 2 versions",

scripts/deleteJsFiles.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import fs from 'fs';
2+
import path from 'path';
3+
4+
function deleteJsFile(tsFilePath: string): void {
5+
const jsFilePath = tsFilePath.replace(/\.ts$/, '.js');
6+
if (fs.existsSync(jsFilePath)) {
7+
fs.unlinkSync(jsFilePath);
8+
console.log(`Deleted: ${jsFilePath}`);
9+
}
10+
}
11+
12+
function walkDir(dir: string): void {
13+
const files = fs.readdirSync(dir);
14+
15+
for (const file of files) {
16+
const filePath = path.join(dir, file);
17+
const stat = fs.statSync(filePath);
18+
19+
if (stat.isDirectory()) {
20+
walkDir(filePath);
21+
} else if (path.extname(file) === '.ts') {
22+
deleteJsFile(filePath);
23+
}
24+
}
25+
}
26+
27+
// Start the deletion process from the src directory
28+
walkDir('./src');

src/index.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)