mirror of
https://github.com/matheus23/elmjs-inspect.git
synced 2024-08-16 14:50:24 +03:00
Fix ALL the spelling
This commit is contained in:
parent
b07ab48f56
commit
693f02f4ec
@ -70,7 +70,7 @@ function localName(name: string) {
|
|||||||
: name.slice(16, name.lastIndexOf("$")).replaceAll("$", ".");
|
: name.slice(16, name.lastIndexOf("$")).replaceAll("$", ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function analyse(elmOutputJsFilePath: string, opts: any) {
|
export async function analyze(elmOutputJsFilePath: string, opts: any) {
|
||||||
const file = await promisify(FS.readFile)(elmOutputJsFilePath);
|
const file = await promisify(FS.readFile)(elmOutputJsFilePath);
|
||||||
const parsed = Esprima.parseScript(file.toString(), { range: true });
|
const parsed = Esprima.parseScript(file.toString(), { range: true });
|
||||||
const size = parsed.range;
|
const size = parsed.range;
|
||||||
@ -114,7 +114,7 @@ export async function analyse(elmOutputJsFilePath: string, opts: any) {
|
|||||||
.map(({ range }) => rangeSize(range))
|
.map(({ range }) => rangeSize(range))
|
||||||
.reduce((a, b) => a + b, 0);
|
.reduce((a, b) => a + b, 0);
|
||||||
Console.log(
|
Console.log(
|
||||||
`Range sum: ${rangeSum} total: ${rangeSize(size)}, analized ${pct(
|
`Range sum: ${rangeSum} total: ${rangeSize(size)}, analyzed ${pct(
|
||||||
rangeSum,
|
rangeSum,
|
||||||
rangeSize(size)
|
rangeSize(size)
|
||||||
)}`
|
)}`
|
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { program } from "commander";
|
import { program } from "commander";
|
||||||
import { analyse } from "./analyse.js";
|
import { analyze } from "./analyze.js";
|
||||||
|
|
||||||
program
|
program
|
||||||
.name("elmjs-inspector")
|
.name("elmjs-inspect")
|
||||||
.description("Analyse your elm.js file size with this tool.")
|
.description("Analyze your elm.js file size with this tool.")
|
||||||
.version("1.0.0");
|
.version("1.0.0");
|
||||||
|
|
||||||
program
|
program
|
||||||
@ -15,7 +15,7 @@ program
|
|||||||
)
|
)
|
||||||
.argument("<filename>", "The file to analyze")
|
.argument("<filename>", "The file to analyze")
|
||||||
.action((filename, opts) => {
|
.action((filename, opts) => {
|
||||||
analyse(filename, opts);
|
analyze(filename, opts);
|
||||||
});
|
});
|
||||||
|
|
||||||
program.parse();
|
program.parse();
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"outDir": "bin",
|
"outDir": "bin",
|
||||||
"lib": ["ES2021.String"]
|
"lib": ["ES2021.String"]
|
||||||
},
|
},
|
||||||
"files": ["src/analyse.ts", "src/index.ts"]
|
"files": ["src/analyze.ts", "src/index.ts"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user