Skip to content

Commit

Permalink
Fix README wording, comments (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
moshen committed Jun 22, 2024
1 parent 5620884 commit 351c57e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

0 comments on commit 351c57e

Please sign in to comment.