sanitizers {loggit2} | R Documentation |
Sanitizers and unsanitizers are functions, with one parameter, that convert a
character vector (of any length) into another (of the same length).
Associated sanitizer and unsanitizer should be constructed in such a way that the concatenation
unsanitizer(sanitizer())
corresponds to the identity function.
default_ndjson_sanitizer(string)
default_ndjson_unsanitizer(string)
string |
A character vector |
The default sanatizer and unsanatizer are based on the following mapping:
Character | Replacement |
{ | __LEFTBRACE__ |
} | __RIGHTBRACE__ |
" | __DBLQUOTE__ |
, | __COMMA__ |
\r | __CR__ |
\n | __LF__ |
This type of function is needed because because some characters in a JSON cannot appear unescaped and
since loggit2
reimplements its own very simple string-based JSON parser.
A character vector