Sha256: b5c6e534d33d0bfd5e1e2aa2dcd606fe11dc325a03cfb43bfda56882e4df4b18

Contents?: true

Size: 617 Bytes

Versions: 53

Compression:

Stored size: 617 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createUnionTypeAnnotation;

var _generated = require("../generated");

var _removeTypeDuplicates = _interopRequireDefault(require("../../modifications/flow/removeTypeDuplicates"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function createUnionTypeAnnotation(types) {
  const flattened = (0, _removeTypeDuplicates.default)(types);

  if (flattened.length === 1) {
    return flattened[0];
  } else {
    return (0, _generated.unionTypeAnnotation)(flattened);
  }
}

Version data entries

53 entries across 53 versions & 8 rubygems

Version Path
disco_app-0.18.0 test/dummy/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.18.2 test/dummy/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.7 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.6 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.5 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.4 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.16.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.15.2 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.3 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.2 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.18.4 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.18.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.14.0 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.1 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-4.3.5 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-5.0.0 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-4.3.4 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js
trusty-cms-4.3.3 node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js