MCPcopy Create free account
hub / github.com/reactjs/react-rails / transformReact

Function transformReact

lib/assets/javascripts/JSXTransformer.js:40–53  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

38 * @return {object} object as returned from jstransform
39 */
40function 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.

Callers 2

execFunction · 0.85
transformCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected