Sha256: 3208f4e8b1a9b1ad63ea297dd3b63594d768de90b70671733b186b34fce943e0

Contents?: true

Size: 605 Bytes

Versions: 9

Compression:

Stored size: 605 Bytes

Contents

"use strict";

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

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

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

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

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

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

Version data entries

9 entries across 8 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
tang-0.2.1 spec/tang_app/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
tang-0.2.0 spec/tang_app/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
tang-0.1.0 spec/tang_app/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
tang-0.0.9 spec/tang_app/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js