#[derive(Default)]
pub enum BigIntExportBehavior {
String,
Number,
BigInt,
#[default]
Fail,
#[doc(hidden)]
FailWithReason(&'static str),
}
pub type CommentFormatterFn = fn(&[&str]) -> String;
pub fn js_doc(comments: &[&str]) -> String {
if comments.is_empty() {
return "".to_owned();
}
let mut result = "/**\n".to_owned();
for comment in comments {
let comment = comment.trim_start();
result.push_str(&format!(" * {comment}\n"));
}
result.push_str(" */\n");
result
}
const _: CommentFormatterFn = js_doc;