ResourceTransformer typedef

ResourceTransformer = Resource Function(Resource resource)

Implements the transformation of a Resource. It can be used, for example, to decrypt, deobfuscate, inject CSS or JavaScript, correct content – e.g. adding a missing dir="rtl" in an HTML document, pre-process – e.g. before indexing a publication's content, etc.

If the transformation doesn't apply, simply return resource unchanged.

Implementation

typedef ResourceTransformer = Resource Function(Resource resource);