* Run provided code through jstransform. * * @param {string} source Original source code * @param {object?} options Options to pass to jstransform * @return {object} object as returned from jstransform
(source, options)
| 38 | * @return {object} object as returned from jstransform |
| 39 | */ |
| 40 | function transformReact(source, options) { |
| 41 | options = options || {}; |
| 42 | |
| 43 | // Force the sourcemaps option manually. We don't want to use it if it will |
| 44 | // break (see above note about supportsAccessors). We'll only override the |
| 45 | // value here if sourceMap was specified and is truthy. This guarantees that |
| 46 | // we won't override any user intent (since this method is exposed publicly). |
| 47 | if (options.sourceMap) { |
| 48 | options.sourceMap = supportsAccessors; |
| 49 | } |
| 50 | |
| 51 | // Otherwise just pass all options straight through to react-tools. |
| 52 | return ReactTools.transformWithDetails(source, options); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Eval provided source after transforming it. |
no outgoing calls
no test coverage detected