save as bw compatible (#6088)
* save as bw compatible Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * js side only for bw compatibility changes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * failure for doing wrong thing Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove from ts side Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -176,6 +176,8 @@ pub fn serialize_configuration(val: JsValue) -> Result<JsValue, String> {
|
||||
let config: kcl_lib::Configuration = val.into_serde().map_err(|e| e.to_string())?;
|
||||
|
||||
let toml_str = toml::to_string_pretty(&config).map_err(|e| e.to_string())?;
|
||||
let settings = kcl_lib::Configuration::backwards_compatible_toml_parse(&toml_str).map_err(|e| e.to_string())?;
|
||||
let toml_str = toml::to_string_pretty(&settings).map_err(|e| e.to_string())?;
|
||||
|
||||
// The serde-wasm-bindgen does not work here because of weird HashMap issues so we use the
|
||||
// gloo-serialize crate instead.
|
||||
@ -190,6 +192,9 @@ pub fn serialize_project_configuration(val: JsValue) -> Result<JsValue, String>
|
||||
let config: kcl_lib::ProjectConfiguration = val.into_serde().map_err(|e| e.to_string())?;
|
||||
|
||||
let toml_str = toml::to_string_pretty(&config).map_err(|e| e.to_string())?;
|
||||
let settings =
|
||||
kcl_lib::ProjectConfiguration::backwards_compatible_toml_parse(&toml_str).map_err(|e| e.to_string())?;
|
||||
let toml_str = toml::to_string_pretty(&settings).map_err(|e| e.to_string())?;
|
||||
|
||||
// The serde-wasm-bindgen does not work here because of weird HashMap issues so we use the
|
||||
// gloo-serialize crate instead.
|
||||
|
Reference in New Issue
Block a user