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.51 node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 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.51 node_modules/@babel/helper-module-imports/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 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.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-environment-visitor/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 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.51 node_modules/@babel/helper-simple-access/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helpers/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 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.51 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.51 node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-function-name/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-hoist-variables/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map