[documentation] setting up a custom formatter for deeper keys
Closed this issue · 1 comments
revelt commented
hi
I'm trying to set up a custom formatter for CLI but without luck.
Basically, I need for zzz
to be above kkk
in:
{
"aaa": {
"bbb": [
{
"kkk": [
"..."
],
"zzz": "..."
},
{
"kkk": [
"..."
],
"zzz": "..."
}
]
}
}
Basically, to tweak the key order of objects within arrays.
Is that possible with format-package
?
cheers!
camacho commented
If you set a transformation for the aaa
key it should be possible. You will get two arguments. The key (aaa
) and the object. From there, you can transform the value (or even creat new values). The response signature is an array of [key, value]