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

decode: remove dead code from ns_keyed_archiver

This commit is contained in:
David McDonald 2022-12-17 01:52:46 -06:00
parent 3ec0ba3f25
commit 708346784f

View File

@ -1,47 +1,3 @@
def from_ns_keyed_archiver_root:
( . as {"$objects": $objs, "$top": {root: $root_uid, "$0": $zero}}
| def _f($id):
( .
| $objs[$id]
| if type == "string" then .
elif type == "number" then .
elif type == "boolean" then .
elif type == "null" then .
elif type == "array" then .
else
(. as {"$class": $class}
| if $class == null then . else
$objs[$class]."$classname" as $cname
| if $cname == "NSDictionary" or $cname == "NSMutableDictionary" then
( . as {"NS.keys": $ns_keys, "NS.objects": $ns_objects}
| [$ns_keys, $ns_objects]
| transpose
| map
(
( . as [$k, $o]
| {key: _f($k), value: _f($o)}
)
)
| from_entries
)
elif ["NSArray", "NSMutableArray", "NSSet", "NSMutableSet"]
| any(. == $cname) then
( . as {"NS.objects": $ns_objects}
| $ns_objects
| map(_f(.))
)
elif $cname == "NSData" or $cname == "NSMutableData" then ."NS.Data"
elif $cname == "NSUUID" then ."NS.uuidbytes"
else ."class"=$cname
end
end
)
end
);
_f($root_uid? // $zero)
);
def from_ns_keyed_archiver:
( . as {
"$objects": $objects,