Deeply brands the string properties of a query result as StegaString, marking them as
potentially containing stega-encoded data.
String properties that the stega encoder is guaranteed to never encode keep their plain type:
keys starting with _ (_id, _type, _createdAt, _updatedAt, _key, _ref, _rev and
so on), which also preserves discriminated union narrowing on _type
slug.current patterns: a current key directly under a slug key, as well as string valued
slug keys (covering "slug": slug.current projections)
Portable Text internals: the encoder only visits children of _type: 'block' objects and
text of _type: 'span' objects, so properties like style, listItem and marks stay
plain
symbol-keyed properties (like TypeGen's internalGroqTypeReferenceTo reference marker): JSON
can't contain symbol keys, so they only exist in the type system and are never encoded
Every other string is assumed to be "poisoned", even if the runtime filter happens to skip it
(URLs, dates, keys ending in Id, denylisted keys). Being conservative is safe: the worst case
is a redundant stegaClean() call, whereas under-branding would hide real bugs.
The Key and ParentKey type parameters track the key the current value is found under, and
the key of the object containing it, they're only used internally during recursion.
Deeply brands the string properties of a query result as
StegaString, marking them as potentially containing stega-encoded data.String properties that the stega encoder is guaranteed to never encode keep their plain type:
_(_id,_type,_createdAt,_updatedAt,_key,_ref,_revand so on), which also preserves discriminated union narrowing on_typeslug.currentpatterns: acurrentkey directly under aslugkey, as well as string valuedslugkeys (covering"slug": slug.currentprojections)childrenof_type: 'block'objects andtextof_type: 'span'objects, so properties likestyle,listItemandmarksstay plaininternalGroqTypeReferenceToreference marker): JSON can't contain symbol keys, so they only exist in the type system and are never encodedEvery other string is assumed to be "poisoned", even if the runtime
filterhappens to skip it (URLs, dates, keys ending inId, denylisted keys). Being conservative is safe: the worst case is a redundantstegaClean()call, whereas under-branding would hide real bugs.The
KeyandParentKeytype parameters track the key the current value is found under, and the key of the object containing it, they're only used internally during recursion.