UNPKG

528 BJavaScriptView Raw
1
2/**
3 * Copyright (c) Facebook, Inc. and its affiliates.
4 *
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9'use strict';
10
11const babylon = require('@babel/parser');
12const options = require('./tsOptions');
13
14/**
15 * Doesn't accept custom options because babylon should be used directly in
16 * that case.
17 */
18module.exports = function() {
19 return {
20 parse(code) {
21 return babylon.parse(code, options);
22 },
23 };
24};