From c698f4c2603c99d0aa31b480d1c992468401ee61 Mon Sep 17 00:00:00 2001 From: Josh Finnie Date: Mon, 15 Mar 2021 16:16:46 -0400 Subject: [PATCH 1/2] giving `matter` js_name of `default` I think this should remove the need to run `wasm-frontmatter` as the following: ``` import { matter } from 'wasm-frontmatter'; ``` if this instead allows us to do this: ``` import matter from 'wasm-frontmatter'; ``` this would be a huge win in replacement of `gray-matter` smoother... --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 592d742..d5e08ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,7 +97,7 @@ impl Opt { } } -#[wasm_bindgen] +#[wasm_bindgen(js_name = default) pub fn matter(markdown_input: &str, opt: JsValue) -> JsValue { utils::set_panic_hook(); From dfae3f72ee1a073b1cdd3f18dfb85dd1ff579d9e Mon Sep 17 00:00:00 2001 From: Josh Finnie Date: Mon, 15 Mar 2021 18:58:37 -0400 Subject: [PATCH 2/2] typo --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d5e08ba..d4da63b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,7 +97,7 @@ impl Opt { } } -#[wasm_bindgen(js_name = default) +#[wasm_bindgen(js_name = default)] pub fn matter(markdown_input: &str, opt: JsValue) -> JsValue { utils::set_panic_hook();