feat: add czv, czv-wasm, and czv-python (init release)

This commit is contained in:
rzmk 2024-06-19 22:37:33 -04:00
commit 9799ab694b
No known key found for this signature in database
40 changed files with 70383 additions and 0 deletions

30
czv-wasm/src/lib.rs Normal file
View file

@ -0,0 +1,30 @@
use wasm_bindgen::JsValue;
// Error-handling helpers
#[derive(thiserror::Error, Debug)]
#[error("{0}")]
pub struct CzvError(anyhow::Error);
impl From<csv::Error> for CzvError {
fn from(value: csv::Error) -> Self {
value.into()
}
}
impl Into<JsValue> for CzvError {
fn into(self) -> JsValue {
JsValue::from_str(self.to_string().as_str())
}
}
pub type Result<T> = anyhow::Result<T, CzvError>;
#[allow(unused_macros)]
macro_rules! bail {
($err:expr $(,)?) => {
return Err(crate::CzvError(anyhow::anyhow!($err)))
};
}
// Command imports
pub mod count;