Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ describe("Tests the public API", () => {
});
})

it("detects sqlite (SQLite 3 database file)", () => {
const file = getBytes("a.sqlite")
const result = filetypemime(file);
expect(result).toContain("application/vnd.sqlite3");
});

it("detects pdf (Libreoffice export)", () => {
// File created using libreoffice writter export to pdf
const file = getBytes("a.pdf");
Expand Down
12 changes: 12 additions & 0 deletions src/model/pattern-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,18 @@ add("Mach-O", ["0xFE", "0xED", "0xFA", "0xCF"], {
extension: "elf",
});

add("sqlite", ["0x53","0x51","0x4C","0x69","0x74","0x65","0x20","0x66","0x6F","0x72","0x6D","0x61","0x74","0x20","0x33","0x00"],
{
mime: "application/vnd.sqlite3",
extension: ".sqlite",
});

add("sqlite", ["0x53","0x51","0x4C","0x69","0x74","0x65","0x20","0x66","0x6F","0x72","0x6D","0x61","0x74","0x20","0x33","0x00"],
{
mime: "application/vnd.sqlite3",
extension: ".sqlite3",
});

add(
"EML",
["0x52", "0x65", "0x63", "0x65", "0x69", "0x76", "0x65", "0x64", "0x3A"],
Expand Down
Binary file added src/testfiles/a.sqlite
Binary file not shown.