use super::*;
#[inline]
pub fn format_json(input: &str) -> Result<String, io::Error> {
tidy::json::format(input, &VSCODE_JSON_OPTIONS)
.map_err(|_: tidy::Error| io::Error::new(ErrorKind::InvalidData, ERROR_JSON_PARSE_FAILED))
}
#[inline]
pub fn format_json_stringify(input: &str) -> Result<String, io::Error> {
tidy::json::format(input, &VSCODE_JSON_STRINGIFY_OPTIONS)
.map_err(|_: tidy::Error| io::Error::new(ErrorKind::InvalidData, ERROR_JSON_PARSE_FAILED))
}
#[inline]
pub fn format_jsonc(input: &str) -> String {
tidy::json::format(input, &VSCODE_JSONC_OPTIONS)
.unwrap_or_else(|_: tidy::Error| input.to_string())
}