use wasm_bindgen::prelude::*;
use crate::default_avro_parser;
#[wasm_bindgen]
pub struct WasmAvroParser {
parser: crate::LekhaniParser,
}
#[wasm_bindgen]
impl WasmAvroParser {
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
Self {
parser: default_avro_parser(),
}
}
#[wasm_bindgen]
pub fn convert(&self, input: &str) -> String {
self.parser.convert(input)
}
}
impl Default for WasmAvroParser {
fn default() -> Self {
Self::new()
}
}
#[wasm_bindgen]
pub fn parse_avro(input: &str) -> String {
default_avro_parser().convert(input)
}