diff --git a/src/analyse.ts b/src/analyze.ts similarity index 96% rename from src/analyse.ts rename to src/analyze.ts index 0f48ec2..b3c4551 100644 --- a/src/analyse.ts +++ b/src/analyze.ts @@ -70,7 +70,7 @@ function localName(name: string) { : 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 parsed = Esprima.parseScript(file.toString(), { range: true }); const size = parsed.range; @@ -114,7 +114,7 @@ export async function analyse(elmOutputJsFilePath: string, opts: any) { .map(({ range }) => rangeSize(range)) .reduce((a, b) => a + b, 0); Console.log( - `Range sum: ${rangeSum} total: ${rangeSize(size)}, analized ${pct( + `Range sum: ${rangeSum} total: ${rangeSize(size)}, analyzed ${pct( rangeSum, rangeSize(size) )}` diff --git a/src/index.ts b/src/index.ts index 79dc1a9..a994dc0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,11 @@ #!/usr/bin/env node import { program } from "commander"; -import { analyse } from "./analyse.js"; +import { analyze } from "./analyze.js"; program - .name("elmjs-inspector") - .description("Analyse your elm.js file size with this tool.") + .name("elmjs-inspect") + .description("Analyze your elm.js file size with this tool.") .version("1.0.0"); program @@ -15,7 +15,7 @@ program ) .argument("", "The file to analyze") .action((filename, opts) => { - analyse(filename, opts); + analyze(filename, opts); }); program.parse(); diff --git a/tsconfig.json b/tsconfig.json index a1b9fdf..a046112 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,5 @@ "outDir": "bin", "lib": ["ES2021.String"] }, - "files": ["src/analyse.ts", "src/index.ts"] + "files": ["src/analyze.ts", "src/index.ts"] }