specta 2.0.0-rc.9

Easily export your Rust types to other languages
Documentation
use super::js_doc;

use super::{CommentFormatterArgs, CommentFormatterFn};

// Assert that the function signature matches the expected type.
const _: CommentFormatterFn = js_doc;

/// Converts Typescript comments into JSDoc comments.
pub fn js_doc(arg: CommentFormatterArgs) -> String {
    js_doc_builder(arg).build()
}

pub(crate) fn js_doc_builder(arg: CommentFormatterArgs) -> js_doc::Builder {
    let mut builder = js_doc::Builder::default();

    if !arg.docs.is_empty() {
        builder.extend(arg.docs.split('\n'));
    }

    if let Some(deprecated) = arg.deprecated {
        builder.push_deprecated(deprecated);
    }

    builder
}