mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
chore(server): use native file-type implementation (#6686)
This commit is contained in:
8
packages/backend/native/src/file_type.rs
Normal file
8
packages/backend/native/src/file_type.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use napi_derive::napi;
|
||||
|
||||
#[napi]
|
||||
pub fn get_mime(input: &[u8]) -> String {
|
||||
file_format::FileFormat::from_bytes(input)
|
||||
.media_type()
|
||||
.to_string()
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
#![deny(clippy::all)]
|
||||
|
||||
pub mod file_type;
|
||||
pub mod hashcash;
|
||||
|
||||
use std::fmt::{Debug, Display};
|
||||
|
||||
Reference in New Issue
Block a user