You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html-inject-script, to name one example, exposes a transform function that accepts two arguments. Documentify is currently only capable of passing one argument. If you configure a transform like this:
"transform": ["html-inject-script", "bundle.js"]
It's invoked as htmlInjectScript("bundle.js"). Passing additional arguments would either look like this:
which would be invoked as htmlInjectScript("bundle.js", {"foo": "bar"}), which seems weird because the configuration has multiple arguments in parallel with the transform name. A breaking change would be for configuration to require array-wrapping all arguments always:
This is my favorite option since it's easy enough to infer that it's just running .apply(null, args) on the transform, though the single-argument case is a bit clumsy.
The third option is that all compatible transforms must only take one argument.
Thoughts on the best path forward?
The text was updated successfully, but these errors were encountered:
rreusser
changed the title
Additional transform arguments
Handling additional transform arguments
Nov 18, 2017
html-inject-script, to name one example, exposes a transform function that accepts two arguments. Documentify is currently only capable of passing one argument. If you configure a transform like this:
It's invoked as
htmlInjectScript("bundle.js")
. Passing additional arguments would either look like this:which would be invoked as
htmlInjectScript("bundle.js", {"foo": "bar"})
, which seems weird because the configuration has multiple arguments in parallel with the transform name. A breaking change would be for configuration to require array-wrapping all arguments always:This is my favorite option since it's easy enough to infer that it's just running
.apply(null, args)
on the transform, though the single-argument case is a bit clumsy.The third option is that all compatible transforms must only take one argument.
Thoughts on the best path forward?
The text was updated successfully, but these errors were encountered: