From cba72dbdf08d904769bb4c53aa0a40fc9d91c459 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Mon, 19 Dec 2022 02:04:23 -0600 Subject: [PATCH] bplist: added overload for from_ns_keyed_archiver jq func --- format/apple/bplist/ns_keyed_archiver.jq | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/format/apple/bplist/ns_keyed_archiver.jq b/format/apple/bplist/ns_keyed_archiver.jq index 91a17aa9..48309755 100644 --- a/format/apple/bplist/ns_keyed_archiver.jq +++ b/format/apple/bplist/ns_keyed_archiver.jq @@ -1,9 +1,9 @@ -def from_ns_keyed_archiver: - ( . as { - "$objects": $objects, - "$top": {root: $root} - #"$top": {"796BFF22-6712-4486-A32C-A1C5DB3273BA": $root} - } +def from_ns_keyed_archiver(root): + ( + . as + { + "$objects": $objects + } | def _f($id; $seen_ids): def _r($id): if $seen_ids | has("\($id)") then "cycle-\($id)" @@ -65,6 +65,13 @@ def from_ns_keyed_archiver: end ); def _f($id): _f($id; {"\($id)": true}); - _f($root?.cfuid // 1) + _f(root) ); +def from_ns_keyed_archiver: + ( . as + { + "$top": {root: $root} + } + | from_ns_keyed_archiver($root.cfuid) + );