Converts an audit_trail() object to a plain R list suitable for
serialisation with jsonlite::toJSON(). All POSIXct timestamps are
converted to ISO 8601 character strings and data.frames are converted
to lists of named rows for JSON compatibility.
Arguments
- .trail
An
audit_trail()object.
Value
A named list with elements name, created_at (ISO 8601 string),
n_snapshots, and snapshots (a named list keyed by snapshot label).
See also
Other audit export:
audit_export(),
read_trail(),
trail_to_df(),
write_trail()
Examples
trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
lst <- trail_to_list(trail)
str(lst, max.level = 2)
#> List of 4
#> $ name : chr "example"
#> $ created_at : chr "2026-03-24T12:14:34Z"
#> $ n_snapshots: int 1
#> $ snapshots :List of 1
#> ..$ raw:List of 15