israelroldan / jsonbox

📦 Utility library and CLI tool to transform JSON files with ease
1 stars 0 forks source link

[jsonbox] Calling `remove` should respect property names with dots. #4

Closed israelroldan closed 7 years ago

israelroldan commented 7 years ago

Consider the following structure:

{
    "foo.bar": true,
    "baz": false
}

After calling remove(['baz']), the following is produced;

{
    "foo": {
        "bar": true
    }
}

Which no longer corresponds to the original structure.

This is caused by the use of flatten+unflatten during delete.

israelroldan commented 7 years ago

Fixed with https://github.com/israelroldan/jsonbox/commit/1584ee5b3e81b7fdda3be9d7c59dd19cbb0cfbae