Fix quoting of empty string in to nuon (#7632)

Closes https://github.com/nushell/nushell/issues/7631
This commit is contained in:
Stefan Holderbach
2022-12-30 09:49:35 +01:00
committed by GitHub
parent b543063749
commit be31182969
2 changed files with 39 additions and 1 deletions

View File

@ -221,6 +221,9 @@ static NEEDS_QUOTES_REGEX: Lazy<Regex> = Lazy::new(|| {
});
fn needs_quotes(string: &str) -> bool {
if string.is_empty() {
return true;
}
// These are case-sensitive keywords
match string {
// `true`/`false`/`null` are active keywords in JSON and NUON