script: more efficient language identification
This commit is contained in:
parent
23fc29bd2c
commit
c19bf3d96b
1 changed files with 1 additions and 4 deletions
5
index.js
5
index.js
|
|
@ -16,10 +16,7 @@ const give = (data) =>
|
|||
|
||||
const init = async () => {
|
||||
const [path, filetype] = process.argv.slice(2);
|
||||
const lang =
|
||||
filetype.substring(0, "typescript".length) === "typescript"
|
||||
? Lang.TYPESCRIPT
|
||||
: Lang.JAVASCRIPT;
|
||||
const lang = filetype[0] === "t" ? Lang.TYPESCRIPT : Lang.JAVASCRIPT;
|
||||
const contents = await receive();
|
||||
|
||||
const emitter = importCost(path, contents, lang);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue