Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Apache Parquet #576

Merged
merged 5 commits into from Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions core.d.ts
Expand Up @@ -143,7 +143,8 @@ export type FileExtension =
| 'vcf'
| 'jls'
| 'pst'
| 'dwg';
| 'dwg'
| 'parquet';

export type MimeType =
| 'image/jpeg'
Expand Down Expand Up @@ -282,7 +283,8 @@ export type MimeType =
| 'application/zstd'
| 'image/jls'
| 'application/vnd.ms-outlook'
| 'image/vnd.dwg';
| 'image/vnd.dwg'
| 'application/x-parquet';

export type FileTypeResult = {
/**
Expand Down
7 changes: 7 additions & 0 deletions core.js
Expand Up @@ -815,6 +815,13 @@ class FileTypeParser {
};
}

if (this.checkString('PAR1')) {
return {
ext: 'parquet',
mime: 'application/x-parquet',
};
}

// -- 5-byte signatures --

if (this.check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {
Expand Down
Binary file added fixture/fixture.parquet
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -196,7 +196,8 @@
"vcf",
"jls",
"pst",
"dwg"
"dwg",
"parquet"
],
"dependencies": {
"readable-web-to-node-stream": "^3.0.2",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -440,6 +440,7 @@ Returns a `Set<string>` of supported MIME types.
- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
- [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font
- [`parquet`](https://en.wikipedia.org/wiki/Apache_Parquet) - Apache Parquet
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format
- [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Expand Up @@ -141,6 +141,7 @@ export const extensions = [
'jls',
'pst',
'dwg',
'parquet',
];

export const mimeTypes = [
Expand Down Expand Up @@ -281,4 +282,5 @@ export const mimeTypes = [
'image/jls',
'application/vnd.ms-outlook',
'image/vnd.dwg',
'application/x-parquet',
];