Sha256: 5327b8cffeb05eb9665f2a8e4adf7c184a4db0ed0a3b7920dcf12fb3f8d60696

Contents?: true

Size: 1.75 KB

Versions: 161

Compression:

Stored size: 1.75 KB

Contents

{"version":3,"names":["_index","require","_cleanJSXElementLiteralChild","buildChildren","node","elements","i","children","length","child","isJSXText","cleanJSXElementLiteralChild","isJSXExpressionContainer","expression","isJSXEmptyExpression","push"],"sources":["../../../src/builders/react/buildChildren.ts"],"sourcesContent":["import {\n  isJSXText,\n  isJSXExpressionContainer,\n  isJSXEmptyExpression,\n} from \"../../validators/generated/index.ts\";\nimport cleanJSXElementLiteralChild from \"../../utils/react/cleanJSXElementLiteralChild.ts\";\nimport type * as t from \"../../index.ts\";\n\ntype ReturnedChild =\n  | t.JSXSpreadChild\n  | t.JSXElement\n  | t.JSXFragment\n  | t.Expression;\n\nexport default function buildChildren(\n  node: t.JSXElement | t.JSXFragment,\n): ReturnedChild[] {\n  const elements = [];\n\n  for (let i = 0; i < node.children.length; i++) {\n    let child: any = node.children[i];\n\n    if (isJSXText(child)) {\n      cleanJSXElementLiteralChild(child, elements);\n      continue;\n    }\n\n    if (isJSXExpressionContainer(child)) child = child.expression;\n    if (isJSXEmptyExpression(child)) continue;\n\n    elements.push(child);\n  }\n\n  return elements;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,4BAAA,GAAAD,OAAA;AASe,SAASE,aAAaA,CACnCC,IAAkC,EACjB;EACjB,MAAMC,QAAQ,GAAG,EAAE;EAEnB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,IAAI,CAACG,QAAQ,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC7C,IAAIG,KAAU,GAAGL,IAAI,CAACG,QAAQ,CAACD,CAAC,CAAC;IAEjC,IAAI,IAAAI,gBAAS,EAACD,KAAK,CAAC,EAAE;MACpB,IAAAE,oCAA2B,EAACF,KAAK,EAAEJ,QAAQ,CAAC;MAC5C;IACF;IAEA,IAAI,IAAAO,+BAAwB,EAACH,KAAK,CAAC,EAAEA,KAAK,GAAGA,KAAK,CAACI,UAAU;IAC7D,IAAI,IAAAC,2BAAoB,EAACL,KAAK,CAAC,EAAE;IAEjCJ,QAAQ,CAACU,IAAI,CAACN,KAAK,CAAC;EACtB;EAEA,OAAOJ,QAAQ;AACjB","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/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/template/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-module-imports/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types/lib/builders/react/buildChildren.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/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-environment-visitor/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/builders/react/buildChildren.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/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-simple-access/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helpers/node_modules/@babel/types/lib/builders/react/buildChildren.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/react/buildChildren.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/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-function-name/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-hoist-variables/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types/lib/builders/react/buildChildren.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/traverse/node_modules/@babel/types/lib/builders/react/buildChildren.js.map