-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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:
"transform": ["html-inject-script", "bundle.js", {"foo": "bar"}]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:
"transform": ["html-inject-script", ["bundle.js", {"foo": "bar"}]]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?