Skip to content

Commit

Permalink
fix: upgrade native file magic library version
Browse files Browse the repository at this point in the history
  • Loading branch information
abdes committed Nov 13, 2023
1 parent ed821c0 commit f900a9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/binding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('Raw binding to libmagic unit tests', () => {
result.startsWith('magic binary file for file(1) cmd'),
).toBeTruthy();
result = magic.detect(magicPath, binding.MAGIC_MIME);
expect(result).toEqual('application/octet-stream; charset=binary');
expect(result).toEqual('application/x-file; charset=binary');
done();
});
});
Expand Down
6 changes: 3 additions & 3 deletions lib/file-magic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ describe('file magic unit tests', () => {
});
it('detect returns full description of file by default', async () => {
const result = magic.detect(__filename);
expect(result).toEqual('Java source, ASCII text');
expect(result).toEqual('JavaScript source, ASCII text');
});
it('detectMime returns full mime/encoding of file', async () => {
const result = magic.detectMime(__filename);
expect(result).toEqual('text/x-java; charset=us-ascii');
expect(result).toEqual('application/javascript; charset=us-ascii');
});
it('detectMimeType returns mime type of file', async () => {
const result = magic.detectMimeType(__filename);
expect(result).toEqual('text/x-java');
expect(result).toEqual('application/javascript');
});
it('detectMimeEncoding return full description mime encoding of file', async () => {
const result = magic.detectMimeEncoding(__filename);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npcz/magic",
"version": "1.3.14",
"version": "1.3.15",
"description": "Emscripten port of libmagic (https://darwinsys.com/file/) with javascript interface",
"keywords": [
"libmagic",
Expand Down Expand Up @@ -71,6 +71,6 @@
"log-level": "error"
},
"napa": {
"c-libmagic": "git+https://github.com/file/file.git#FILE5_41"
"c-libmagic": "git+https://github.com/file/file.git#FILE5_45"
}
}

0 comments on commit f900a9d

Please sign in to comment.