From 351c57eebb2caf4bcd5ffea969a517a6fdfa9123 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Sat, 22 Jun 2024 11:40:01 -0400 Subject: [PATCH] Fix README wording, comments (#43) --- README.md | 9 +++++---- src/index.ts | 4 ++-- tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f7bd985..37b85ad 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ console.log(magic.detect(pngFile)); // outputs: image/png; charset=binary ``` -[Please refer to the code for the flag definitions](src/index.ts#L5) +[Please refer to the code for the flag definitions](src/index.ts#L8) **Default**: `WASMagicFlags.MIME_TYPE` @@ -263,9 +263,10 @@ to detect, be sure to test example files. ### Detected filetypes -WASMagic includes the default magic file which enables detection any file type -[detected by libmagic](https://github.com/file/file/tree/master/magic/Magdir), -which is over 1500 mime types. For comparison; the +WASMagic includes the default magic file which enables detection of any file +type [detected by +libmagic](https://github.com/file/file/tree/master/magic/Magdir), which (at time +of writing) is over 1500 mime types. For comparison; the [file-type](https://www.npmjs.com/package/file-type) library supports 138 types. Specifically, WASMagic will accurately detect all types of Microsoft Office diff --git a/src/index.ts b/src/index.ts index 33c9071..8d42552 100644 --- a/src/index.ts +++ b/src/index.ts @@ -104,7 +104,7 @@ export class WASMagic { const magicPaths: string[] = []; - // Write each magic file to the interal WASM filesystem + // Write each magic file to the internal WASM filesystem for (let i = 0; i < options.magicFiles.length; i++) { Module.FS.writeFile(`/magic/${i}`, options.magicFiles[i]); magicPaths.push(`${i}`); @@ -125,7 +125,7 @@ export class WASMagic { throw new Error(`WASMagic Load Error: ${loadErr}`); } - // Remove each magic file from the interal WASM filesystem + // Remove each magic file from the internal WASM filesystem // This frees available memory for (let i = 0; i < options.magicFiles.length; i++) { Module.FS.unlink(`/magic/${i}`); diff --git a/tsconfig.json b/tsconfig.json index c77cc49..746ca52 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -69,5 +69,5 @@ "skipLibCheck": true /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["types/*.d.ts", "**/*.ts"] + "include": ["**/*.d.ts", "**/*.ts"] }