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

Function processOptions

lib/assets/javascripts/JSXTransformer.js:392–414  ·  view source on GitHub ↗

* Only copy the values that we need. We'll do some preprocessing to account for * converting command line flags to options that jstransform can actually use.

(opts)

Source from the content-addressed store, hash-verified

390 * converting command line flags to options that jstransform can actually use.
391 */
392function processOptions(opts) {
393 opts = opts || {};
394 var options = {};
395
396 options.harmony = opts.harmony;
397 options.stripTypes = opts.stripTypes;
398 options.sourceMap = opts.sourceMap;
399 options.filename = opts.sourceFilename;
400
401 if (opts.es6module) {
402 options.sourceType = 'module';
403 }
404 if (opts.nonStrictEs6module) {
405 options.sourceType = 'nonStrictModule';
406 }
407
408 // Instead of doing any fancy validation, only look for 'es3'. If we have
409 // that, then use it. Otherwise use 'es5'.
410 options.es3 = opts.target === 'es3';
411 options.es5 = !options.es3;
412
413 return options;
414}
415
416function innerTransform(input, options) {
417 var visitorSets = ['react'];

Callers 1

JSXTransformer.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected