benbria / browserify-transform-tools

Utilities for writing browserify transforms.
MIT License
65 stars 15 forks source link

feat(makeFunctionTransform): transform arbitrary functions #21

Closed cape-dev closed 8 years ago

cape-dev commented 8 years ago

makeFunctionTransform can be used to transform arbitrary functions by passing in options.functionNames. This attr can be eihter a string or an array of strings. If no function name is provided the transform falls back to an require transform. New function is documented and tested.

cape-dev commented 8 years ago

In order to properly work with aliasify and more than one function args (which is the situation when using proxyquire with stubs) I also have to pass the arg type to the transformFn