main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
657 bytes
|
Rev | Line | |
---|
[d565449] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.createUnionType = createUnionType;
|
---|
| 7 | var _t = require("@babel/types");
|
---|
| 8 | const {
|
---|
| 9 | createFlowUnionType,
|
---|
| 10 | createTSUnionType,
|
---|
| 11 | createUnionTypeAnnotation,
|
---|
| 12 | isFlowType,
|
---|
| 13 | isTSType
|
---|
| 14 | } = _t;
|
---|
| 15 | function createUnionType(types) {
|
---|
| 16 | {
|
---|
| 17 | if (types.every(v => isFlowType(v))) {
|
---|
| 18 | if (createFlowUnionType) {
|
---|
| 19 | return createFlowUnionType(types);
|
---|
| 20 | }
|
---|
| 21 | return createUnionTypeAnnotation(types);
|
---|
| 22 | } else if (types.every(v => isTSType(v))) {
|
---|
| 23 | if (createTSUnionType) {
|
---|
| 24 | return createTSUnionType(types);
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | //# sourceMappingURL=util.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.