source: trip-planner-front/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 484 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = createFlowUnionType;
7
8var _generated = require("../generated");
9
10var _removeTypeDuplicates = require("../../modifications/flow/removeTypeDuplicates");
11
12function createFlowUnionType(types) {
13 const flattened = (0, _removeTypeDuplicates.default)(types);
14
15 if (flattened.length === 1) {
16 return flattened[0];
17 } else {
18 return (0, _generated.unionTypeAnnotation)(flattened);
19 }
20}
Note: See TracBrowser for help on using the repository browser.