* 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)
| 390 | * converting command line flags to options that jstransform can actually use. |
| 391 | */ |
| 392 | function 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 | |
| 416 | function innerTransform(input, options) { |
| 417 | var visitorSets = ['react']; |