Sha256: 1057dd74a8c72f246989087e9fa139c9d53bfbbf74388168df469210e0cffa73

Contents?: true

Size: 1.18 KB

Versions: 161

Compression:

Stored size: 1.18 KB

Contents

{"version":3,"names":["_index","require","_removeTypeDuplicates","createFlowUnionType","types","flattened","removeTypeDuplicates","length","unionTypeAnnotation"],"sources":["../../../src/builders/flow/createFlowUnionType.ts"],"sourcesContent":["import { unionTypeAnnotation } from \"../generated/index.ts\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates.ts\";\nimport type * as t from \"../../index.ts\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createFlowUnionType<T extends t.FlowType>(\n  types: [T] | Array<T>,\n): T | t.UnionTypeAnnotation {\n  const flattened = removeTypeDuplicates(types);\n\n  if (flattened.length === 1) {\n    return flattened[0] as T;\n  } else {\n    return unionTypeAnnotation(flattened);\n  }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAOe,SAASE,mBAAmBA,CACzCC,KAAqB,EACM;EAC3B,MAAMC,SAAS,GAAG,IAAAC,6BAAoB,EAACF,KAAK,CAAC;EAE7C,IAAIC,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOF,SAAS,CAAC,CAAC,CAAC;EACrB,CAAC,MAAM;IACL,OAAO,IAAAG,0BAAmB,EAACH,SAAS,CAAC;EACvC;AACF","ignoreList":[]}

Version data entries

161 entries across 15 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-replace-supers/node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-async-generator-functions/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-replace-supers/node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/template/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.44 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.43 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.42 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.41 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.40 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
wice_grid-7.1.0 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.39 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map