From c1aa8fe4631de4707af882921b3bdd3639b4ca0a Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 29 Jun 2025 15:49:05 +0100 Subject: [PATCH] Remove function --- src/wasm/lib.rs | 11 ----------- tests/{web.rs => wasm.rs} | 15 +-------------- 2 files changed, 1 insertion(+), 25 deletions(-) rename tests/{web.rs => wasm.rs} (73%) diff --git a/src/wasm/lib.rs b/src/wasm/lib.rs index 71f8afe..1d15732 100644 --- a/src/wasm/lib.rs +++ b/src/wasm/lib.rs @@ -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")] diff --git a/tests/web.rs b/tests/wasm.rs similarity index 73% rename from tests/web.rs rename to tests/wasm.rs index 80da0f7..685bf24 100644 --- a/tests/web.rs +++ b/tests/wasm.rs @@ -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")); -}