kayto 0.1.10

Fast OpenAPI parser that turns imperfect specs into a stable output schema with actionable diagnostics.
1
2
3
4
5
6
7
8
9
10
/// Quotes and escapes a string for safe usage as a Dart string literal.
pub fn dart_quote(value: &str) -> String {
    let escaped = value.replace('\\', "\\\\").replace('\'', "\\'");
    format!("'{escaped}'")
}

/// Applies inline indentation to every new line in a rendered fragment.
pub fn indent_inline(value: &str, prefix: &str) -> String {
    value.replace('\n', &format!("\n{prefix}"))
}