1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 05:13:30 +03:00

bplist: added overload for from_ns_keyed_archiver jq func

This commit is contained in:
David McDonald 2022-12-19 02:04:23 -06:00
parent 98eab8cb5b
commit cba72dbdf0

View File

@ -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)
);