With version 2.3.0 the builder label was introduced.
This has helped a lot for doc analysis and making printing choices in our plugin. But the signature says that label should be a string and we are using JSON.stringify() and JSON.parse() to pass additional data.
It would be great if the label specification could also expand to support metadata or have a dedicated metadata builder that behaves the same as label but receives an object.
Expected behavior:
I could call label like
label({ label: 'foo', ...additionalData }, doc);
// or
metadata(additionalData, doc);
Actual behavior:
I'm only capable to call
With version 2.3.0 the builder label was introduced.
This has helped a lot for
docanalysis and making printing choices in our plugin. But the signature says that label should be astringand we are usingJSON.stringify()andJSON.parse()to pass additional data.It would be great if the
labelspecification could also expand to support metadata or have a dedicatedmetadatabuilder that behaves the same as label but receives an object.Expected behavior:
I could call
labellikeActual behavior:
I'm only capable to call