diff options
Diffstat (limited to 'includes/search/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js')
-rw-r--r-- | includes/search/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/search/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js b/includes/search/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js new file mode 100644 index 0000000..bdab86a --- /dev/null +++ b/includes/search/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = createFlowUnionType; + +var _generated = require("../generated"); + +var _removeTypeDuplicates = require("../../modifications/flow/removeTypeDuplicates"); + +function createFlowUnionType(types) { + const flattened = (0, _removeTypeDuplicates.default)(types); + + if (flattened.length === 1) { + return flattened[0]; + } else { + return (0, _generated.unionTypeAnnotation)(flattened); + } +} + +//# sourceMappingURL=createFlowUnionType.js.map |