Remove function

This commit is contained in:
Andras Schmelczer 2025-06-29 15:49:05 +01:00
parent 17f67602d9
commit c1aa8fe463
2 changed files with 1 additions and 25 deletions

View file

@ -99,17 +99,6 @@ pub fn is_binary(data: &[u8]) -> bool {
std::str::from_utf8(data).is_err()
}
/// We don't want to support merging structured data like JSON, YAML, etc.
#[wasm_bindgen(js_name = isFileTypeMergable)]
#[must_use]
pub fn is_file_type_mergable(path_or_file_name: &str) -> bool {
set_panic_hook();
let file_extension = path_or_file_name.split('.').next_back().unwrap_or_default();
matches!(file_extension.to_lowercase().as_str(), "md" | "txt")
}
fn set_panic_hook() {
// https://github.com/rustwasm/console_error_panic_hook#readme
#[cfg(feature = "console_error_panic_hook")]

View file

@ -1,7 +1,7 @@
#![cfg(feature = "wasm")]
use reconcile::wasm::{
lib::{is_binary, is_file_type_mergable, merge, merge_text, merge_text_with_cursors},
lib::{is_binary, merge, merge_text, merge_text_with_cursors},
types::{JsCursorPosition, JsTextWithCursors},
};
use wasm_bindgen_test::*;
@ -65,16 +65,3 @@ fn test_is_binary() {
fn test_is_binary_empty() {
assert!(!is_binary(b""));
}
#[wasm_bindgen_test(unsupported = test)]
fn test_is_file_type_mergable() {
assert!(is_file_type_mergable(".md"));
assert!(is_file_type_mergable("hi.md"));
assert!(is_file_type_mergable("my/path/to/my/document.md"));
assert!(is_file_type_mergable("hi.MD"));
assert!(is_file_type_mergable("my/path/to/my/DOCUMENT.MD"));
assert!(!is_file_type_mergable(".json"));
assert!(!is_file_type_mergable("HELLO.JSON"));
assert!(!is_file_type_mergable("my/config.yml"));
}