1
1
mirror of https://github.com/wader/fq.git synced 2024-11-26 21:55:57 +03:00

forgot to add bookmark.jq in last commit

This commit is contained in:
David McDonald 2022-11-23 02:30:28 -06:00
parent 0287ffa4dc
commit 8f930aacee

View File

@ -0,0 +1,31 @@
def _apple_bookmarkdata_torepr:
def _f:
( if .type == 0x101 then .value | tovalue
elif .type == "String" then .data | tovalue
elif .type == "Data" then .data | tovalue
elif .type == "Byte" then .data | tovalue
elif .type == "Short" then .data | tovalue
elif .type == "Int" then .data | tovalue
elif .type == "Long" then .data | tovalue
elif .type == "Float" then .data | tovalue
elif .type == "Double" then .data | tovalue
elif .type == "BooleanFalse" then false
elif .type == "BooleanTrue" then false
elif .type == "Array" then
( .data
| map(_f)
)
elif .type == "Dictionary" then
( .data
| map({key: (.key | _f), value: (.value | _f)})
| from_entries
)
elif .type == "UUID" then .data | tovalue
elif .type == "URL" then .data | tovalue
elif .type == "RelativeURL" then .data | tovalue
end
);
( .bookmark_entries
| map({(.key): (.record | _f)})
);