flow.js 688 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. 'use strict';
  11. const flowParser = require('flow-parser');
  12. const options = {
  13. esproposal_class_instance_fields: true,
  14. esproposal_class_static_fields: true,
  15. esproposal_decorators: true,
  16. esproposal_export_star_as: true,
  17. types: true,
  18. };
  19. /**
  20. * Wrapper to set default options
  21. */
  22. exports.parse = function parse(code) {
  23. return flowParser.parse(code, options);
  24. };