(e,t)
| 204 | return data; |
| 205 | } |
| 206 | `}},wrapReference(e,t){if(t==="lazy/function")return n.types.callExpression(e,[])}});t.lazyImportsHook=lazyImportsHook},7077:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.EXPORTED_CONST_ENUMS_IN_NAMESPACE=void 0;t["default"]=transpileConstEnum;var n=r(5886);const s=t.EXPORTED_CONST_ENUMS_IN_NAMESPACE=new WeakSet;function transpileConstEnum(e,t){const{name:r}=e.node.id;const i=e.parentPath.isExportNamedDeclaration();let a=i;if(!a&&t.isProgram(e.parent)){a=e.parent.body.some((e=>t.isExportNamedDeclaration(e)&&e.exportKind!=="type"&&!e.source&&e.specifiers.some((e=>t.isExportSpecifier(e)&&e.exportKind!=="type"&&e.local.name===r))))}const{enumValues:o}=(0,n.translateEnumValues)(e,t);if(a||s.has(e.node)){const n=t.objectExpression(o.map((([e,r])=>t.objectProperty(t.isValidIdentifier(e)?t.identifier(e):t.stringLiteral(e),r))));if(e.scope.hasOwnBinding(r)){(i?e.parentPath:e).replaceWith(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("assign")),[e.node.id,n])))}else{e.replaceWith(t.variableDeclaration("var",[t.variableDeclarator(e.node.id,n)]));e.scope.registerDeclaration(e)}return}const l=new Map(o);e.scope.path.traverse({Scope(e){if(e.scope.hasOwnBinding(r))e.skip()},MemberExpression(e){if(!t.isIdentifier(e.node.object,{name:r}))return;let n;if(e.node.computed){if(t.isStringLiteral(e.node.property)){n=e.node.property.value}else{return}}else if(t.isIdentifier(e.node.property)){n=e.node.property.name}else{return}if(!l.has(n))return;e.replaceWith(t.cloneNode(l.get(n)))}});e.remove()}},5886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=transpileEnum;t.isSyntacticallyString=isSyntacticallyString;t.translateEnumValues=translateEnumValues;var n=r(2358);var s=r(9491);var i=r(344);var a=r(9102);const o=new WeakMap;const l=n.template.expression(`\n (function (ID) {\n ASSIGNMENTS;\n return ID;\n })(INIT)\n `);function transpileEnum(e,t){const{node:r,parentPath:n}=e;if(r.declare){e.remove();return}const s=r.id.name;const{fill:a,data:c,isPure:p}=enumFill(e,t,r.id);switch(n.type){case"BlockStatement":case"ExportNamedDeclaration":case"Program":{const u=t.isProgram(e.parent);const d=seen(n);let f=t.objectExpression([]);if(d||u){f=t.logicalExpression("||",t.cloneNode(a.ID),f)}const h=l(Object.assign({},a,{INIT:f}));if(p)(0,i.default)(h);if(d){const s=n.isExportDeclaration()?n:e;s.replaceWith(t.expressionStatement(t.assignmentExpression("=",t.cloneNode(r.id),h)))}else{e.scope.registerDeclaration(e.replaceWith(t.variableDeclaration(u?"var":"let",[t.variableDeclarator(r.id,h)]))[0])}o.set(e.scope.getBindingIdentifier(s),c);break}default:throw new Error(`Unexpected enum parent '${e.parent.type}`)}function seen(e){if(e.isExportDeclaration()){return seen(e.parentPath)}if(e.getData(s)){return true}else{e.setData(s,true);return false}}}const c=n.template.statement(`\n ENUM["NAME"] = VALUE;\n`);const p=n.template.statement(`\n ENUM[ENUM["NAME"] = VALUE] = "NAME";\n`);const buildEnumMember=(e,t)=>(e?c:p)(t);function enumFill(e,t,r){const{enumValues:n,data:s,isPure:i}=translateEnumValues(e,t);const a=e.get("members");const o=[];for(let e=0;e<a.length;e++){const[s,i]=n[e];o.push(t.inheritsComments(buildEnumMember(isSyntacticallyString(i),{ENUM:t.cloneNode(r),NAME:s,VALUE:i}),a[e].node))}return{fill:{ID:t.cloneNode(r),ASSIGNMENTS:o},data:s,isPure:i}}function isSyntacticallyString(e){e=(0,a.skipTransparentExprWrapperNodes)(e);switch(e.type){case"BinaryExpression":{const t=e.left;const r=e.right;return e.operator==="+"&&(isSyntacticallyString(t)||isSyntacticallyString(r))}case"TemplateLiteral":case"StringLiteral":return true}return false}function ReferencedIdentifier(e,t){const{seen:r,path:n,t:s}=t;const i=e.node.name;if(r.has(i)){{for(let t=e.scope;t!==n.scope;t=t.parent){if(t.hasOwnBinding(i)){return}}}e.replaceWith(s.memberExpression(s.cloneNode(n.node.id),s.cloneNode(e.node)));e.skip()}}const u={ReferencedIdentifier:ReferencedIdentifier};function translateEnumValues(e,t){var r;const n=e.scope.getBindingIdentifier(e.node.id.name);const i=(r=o.get(n))!=null?r:new Map;let a=-1;let l;let c=true;const p=e.get("members");const d=p.map((r=>{const n=r.node;const o=t.isIdentifier(n.id)?n.id.name:n.id.value;const p=r.get("initializer");const d=n.initializer;let f;if(d){a=computeConstantValue(p,i);if(a!==undefined){i.set(o,a);s(typeof a==="number"||typeof a==="string");if(a===Infinity||Number.isNaN(a)){f=t.identifier(String(a))}else if(a===-Infinity){f=t.unaryExpression("-",t.identifier("Infinity"))}else{f=t.valueToNode(a)}}else{c&&(c=p.isPure());if(p.isReferencedIdentifier()){ReferencedIdentifier(p,{t:t,seen:i,path:e})}else{p.traverse(u,{t:t,seen:i,path:e})}f=p.node;i.set(o,undefined)}}else if(typeof a==="number"){a+=1;f=t.numericLiteral(a);i.set(o,a)}else if(typeof a==="string"){throw e.buildCodeFrameError("Enum member must have initializer.")}else{const r=t.memberExpression(t.cloneNode(e.node.id),t.stringLiteral(l),true);f=t.binaryExpression("+",t.numericLiteral(1),r);i.set(o,undefined)}l=o;return[o,f]}));return{isPure:c,data:i,enumValues:d}}function computeConstantValue(e,t,r=new Set){return evaluate(e);function evaluate(e){const n=e.node;switch(n.type){case"MemberExpression":return evaluateRef(e,t,r);case"StringLiteral":return n.value;case"UnaryExpression":return evalUnaryExpression(e);case"BinaryExpression":return evalBinaryExpression(e);case"NumericLiteral":return n.value;case"ParenthesizedExpression":return evaluate(e.get("expression"));case"Identifier":return evaluateRef(e,t,r);case"TemplateLiteral":{if(n.quasis.length===1){return n.quasis[0].value.cooked}const s=e.get("expressions");const i=n.quasis;let a="";for(let e=0;e<i.length;e++){a+=i[e].value.cooked;if(e+1<i.length){const n=evaluateRef(s[e],t,r);if(n===undefined)return undefined;a+=n}}return a}default:return undefined}}function evaluateRef(e,t,r){if(e.isMemberExpression()){const t=e.node;const r=t.object;const s=t.property;if(!n.types.isIdentifier(r)||(t.computed?!n.types.isStringLiteral(s):!n.types.isIdentifier(s))){return}const i=e.scope.getBindingIdentifier(r.name);const a=o.get(i);if(!a)return;return a.get(s.computed?s.value:s.name)}else if(e.isIdentifier()){const n=e.node.name;if(["Infinity","NaN"].includes(n)){return Number(n)}let s=t==null?void 0:t.get(n);if(s!==undefined){return s}if(t!=null&&t.has(n)){return undefined}if(r.has(e.node))return;r.add(e.node);s=computeConstantValue(e.resolve(),t,r);return s}}function evalUnaryExpression(e){const t=evaluate(e.get("argument"));if(t===undefined){return undefined}switch(e.node.operator){case"+":return t;case"-":return-t;case"~":return~t;default:return undefined}}function evalBinaryExpression(e){const t=evaluate(e.get("left"));if(t===undefined){return undefined}const r=evaluate(e.get("right"));if(r===undefined){return undefined}switch(e.node.operator){case"|":return t|r;case"&":return t&r;case">>":return t>>r;case">>>":return t>>>r;case"<<":return t<<r;case"^":return t^r;case"*":return t*r;case"/":return t/r;case"+":return t+r;case"-":return t-r;case"%":return t%r;case"**":return Math.pow(t,r);default:return undefined}}}},9878:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GLOBAL_TYPES=void 0;t.isGlobalType=isGlobalType;t.registerGlobalType=registerGlobalType;const r=t.GLOBAL_TYPES=new WeakMap;function isGlobalType({scope:e},t){if(e.hasBinding(t))return false;if(r.get(e).has(t))return true;console.warn(`The exported identifier "${t}" is not declared in Babel's scope tracker\n`+`as a JavaScript value binding, and "@babel/plugin-transform-typescript"\n`+`never encountered it as a TypeScript type declaration.\n`+`It will be treated as a JavaScript value.\n\n`+`This problem is likely caused by another plugin injecting\n`+`"${t}" without registering it in the scope tracker. If you are the author\n`+` of that plugin, please use "scope.registerDeclaration(declarationPath)".`);return false}function registerGlobalType(e,t){r.get(e).add(t)}},7687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=r(9045);var s=r(8184);var i=r(3713);var a=r(7077);var o=r(5886);var l=r(9878);var c=r(723);function isInType(e){switch(e.parent.type){case"TSTypeReference":case"TSExpressionWithTypeArguments":case"TSExpressionWithTypeArguments":case"TSTypeQuery":return true;case"TSQualifiedName":return e.parentPath.findParent((e=>e.type!=="TSQualifiedName")).type!=="TSImportEqualsDeclaration";case"ExportSpecifier":return e.parent.exportKind==="type"||e.parentPath.parent.exportKind==="type";default:return false}}const p=new WeakMap;const u=new WeakSet;function safeRemove(e){const t=e.getBindingIdentifiers();for(const r of Object.keys(t)){const n=e.scope.getBinding(r);if(n&&n.identifier===t[r]){n.scope.removeBinding(r)}}e.opts.noScope=true;e.remove();e.opts.noScope=false}function assertCjsTransformEnabled(e,t,r,n,s=""){if(t.file.get("@babel/plugin-transform-modules-*")!=="commonjs"){throw e.buildCodeFrameError(`\`${r}\` is only supported when compiling modules to CommonJS.\n`+`Please consider using \`${n}\`${s}, or add `+`@babel/plugin-transform-modules-commonjs to your Babel config.`)}}var d=t["default"]=(0,n.declare)(((e,t)=>{const{types:r,template:n}=e;e.assertVersion(7);const d=/\*?\s*@jsx((?:Frag)?)\s+(\S+)/;const{allowNamespaces:f=true,jsxPragma:h="React.createElement",jsxPragmaFrag:m="React.Fragment",onlyRemoveTypeImports:y=false,optimizeConstEnums:g=false}=t;{var{allowDeclareFields:b=false}=t}const T={field(e){const{node:t}=e;{if(!b&&t.declare){throw e.buildCodeFrameError(`The 'declare' modifier is only allowed when the 'allowDeclareFields' option of `+`@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`)}}if(t.declare){if(t.value){throw e.buildCodeFrameError(`Fields with the 'declare' modifier cannot be initialized here, but only in the constructor`)}if(!t.decorators){e.remove()}}else if(t.definite){if(t.value){throw e.buildCodeFrameError(`Definitely assigned fields cannot be initialized here, but only in the constructor`)}{if(!b&&!t.decorators&&!r.isClassPrivateProperty(t)){e.remove()}}}else if(t.abstract){e.remove()}else{if(!b&&!t.value&&!t.decorators&&!r.isClassPrivateProperty(t)){e.remove()}}if(t.accessibility)t.accessibility=null;if(t.abstract)t.abstract=null;if(t.readonly)t.readonly=null;if(t.optional)t.optional=null;if(t.typeAnnotation)t.typeAnnotation=null;if(t.definite)t.definite=null;if(t.declare)t.declare=null;if(t.override)t.override=null},method({node:e}){if(e.accessibility)e.accessibility=null;if(e.abstract)e.abstract=null;if(e.optional)e.optional=null;if(e.override)e.override=null},constructor(e,t){if(e.node.accessibility)e.node.accessibility=null;const s=[];const{scope:a}=e;for(const t of e.get("params")){const e=t.node;if(e.type==="TSParameterProperty"){const i=e.parameter;if(u.has(i))continue;u.add(i);let o;if(r.isIdentifier(i)){o=i}else if(r.isAssignmentPattern(i)&&r.isIdentifier(i.left)){o=i.left}else{throw t.buildCodeFrameError("Parameter properties can not be destructuring patterns.")}s.push(n.statement.ast` |
| 207 | this.${r.cloneNode(o)} = ${r.cloneNode(o)} |
| 208 | `);t.replaceWith(t.get("parameter"));a.registerBinding("param",t)}}(0,i.injectInitialization)(t,e,s)}};return{name:"transform-typescript",inherits:s.default,visitor:{Pattern:visitPattern,Identifier:visitPattern,RestElement:visitPattern,Program:{enter(e,t){const{file:r}=t;let n=null;let s=null;const i=e.scope;if(!l.GLOBAL_TYPES.has(i)){l.GLOBAL_TYPES.set(i,new Set)}if(r.ast.comments){for(const e of r.ast.comments){const t=d.exec(e.value);if(t){if(t[1]){s=t[2]}else{n=t[2]}}}}let a=n||h;if(a){[a]=a.split(".")}let o=s||m;if(o){[o]=o.split(".")}for(let r of e.get("body")){if(r.isImportDeclaration()){if(!p.has(t.file.ast.program)){p.set(t.file.ast.program,true)}if(r.node.importKind==="type"){for(const e of r.node.specifiers){(0,l.registerGlobalType)(i,e.local.name)}r.remove();continue}const n=new Set;const s=r.node.specifiers.length;const isAllSpecifiersElided=()=>s>0&&s===n.size;for(const e of r.node.specifiers){if(e.type==="ImportSpecifier"&&e.importKind==="type"){(0,l.registerGlobalType)(i,e.local.name);const t=r.scope.getBinding(e.local.name);if(t){n.add(t.path)}}}if(y){p.set(e.node,false)}else{if(r.node.specifiers.length===0){p.set(e.node,false);continue}for(const t of r.node.specifiers){const s=r.scope.getBinding(t.local.name);if(s&&!n.has(s.path)){if(isImportTypeOnly({binding:s,programPath:e,pragmaImportName:a,pragmaFragImportName:o})){n.add(s.path)}else{p.set(e.node,false)}}}}if(isAllSpecifiersElided()&&!y){r.remove()}else{for(const e of n){e.remove()}}continue}if(!y&&r.isTSImportEqualsDeclaration()){const{id:t}=r.node;const n=r.scope.getBinding(t.name);if(n&&!r.node.isExport&&isImportTypeOnly({binding:n,programPath:e,pragmaImportName:a,pragmaFragImportName:o})){r.remove();continue}}if(r.isExportDeclaration()){r=r.get("declaration")}if(r.isVariableDeclaration({declare:true})){for(const e of Object.keys(r.getBindingIdentifiers())){(0,l.registerGlobalType)(i,e)}}else if(r.isTSTypeAliasDeclaration()||r.isTSDeclareFunction()&&r.get("id").isIdentifier()||r.isTSInterfaceDeclaration()||r.isClassDeclaration({declare:true})||r.isTSEnumDeclaration({declare:true})||r.isTSModuleDeclaration({declare:true})&&r.get("id").isIdentifier()){(0,l.registerGlobalType)(i,r.node.id.name)}}},exit(e){if(e.node.sourceType==="module"&&p.get(e.node)){e.pushContainer("body",r.exportNamedDeclaration())}}},ExportNamedDeclaration(e,t){if(!p.has(t.file.ast.program)){p.set(t.file.ast.program,true)}if(e.node.exportKind==="type"){e.remove();return}if(e.node.source&&e.node.specifiers.length>0&&e.node.specifiers.every((e=>e.type==="ExportSpecifier"&&e.exportKind==="type"))){e.remove();return}if(!e.node.source&&e.node.specifiers.length>0&&e.node.specifiers.every((t=>r.isExportSpecifier(t)&&(0,l.isGlobalType)(e,t.local.name)))){e.remove();return}if(r.isTSModuleDeclaration(e.node.declaration)){const t=e.node.declaration;if(!r.isStringLiteral(t.id)){const n=(0,c.getFirstIdentifier)(t.id);if(e.scope.hasOwnBinding(n.name)){e.replaceWith(t)}else{const[s]=e.replaceWithMultiple([r.exportNamedDeclaration(r.variableDeclaration("let",[r.variableDeclarator(r.cloneNode(n))])),t]);e.scope.registerDeclaration(s)}}}p.set(t.file.ast.program,false)},ExportAllDeclaration(e){if(e.node.exportKind==="type")e.remove()},ExportSpecifier(e){const t=e.parent;if(!t.source&&(0,l.isGlobalType)(e,e.node.local.name)||e.node.exportKind==="type"){e.remove()}},ExportDefaultDeclaration(e,t){if(!p.has(t.file.ast.program)){p.set(t.file.ast.program,true)}if(r.isIdentifier(e.node.declaration)&&(0,l.isGlobalType)(e,e.node.declaration.name)){e.remove();return}p.set(t.file.ast.program,false)},TSDeclareFunction(e){safeRemove(e)},TSDeclareMethod(e){safeRemove(e)},VariableDeclaration(e){if(e.node.declare){safeRemove(e)}},VariableDeclarator({node:e}){if(e.definite)e.definite=null},TSIndexSignature(e){e.remove()},ClassDeclaration(e){const{node:t}=e;if(t.declare){safeRemove(e)}},Class(e){const{node:t}=e;if(t.typeParameters)t.typeParameters=null;{if(t.superTypeParameters)t.superTypeParameters=null}if(t.implements)t.implements=null;if(t.abstract)t.abstract=null;e.get("body.body").forEach((t=>{if(t.isClassMethod()||t.isClassPrivateMethod()){if(t.node.kind==="constructor"){T.constructor(t,e)}else{T.method(t)}}else if(t.isClassProperty()||t.isClassPrivateProperty()||t.isClassAccessorProperty()){T.field(t)}}))},Function(e){const{node:t}=e;if(t.typeParameters)t.typeParameters=null;if(t.returnType)t.returnType=null;const n=t.params;if(n.length>0&&r.isIdentifier(n[0],{name:"this"})){n.shift()}},TSModuleDeclaration(e){(0,c.default)(e,f)},TSInterfaceDeclaration(e){e.remove()},TSTypeAliasDeclaration(e){e.remove()},TSEnumDeclaration(e){if(g&&e.node.const){(0,a.default)(e,r)}else{(0,o.default)(e,r)}},TSImportEqualsDeclaration(e,t){const{id:n,moduleReference:s}=e.node;let i;let a;if(r.isTSExternalModuleReference(s)){assertCjsTransformEnabled(e,t,`import ${n.name} = require(...);`,`import ${n.name} from '...';`," alongside Typescript's --allowSyntheticDefaultImports option");i=r.callExpression(r.identifier("require"),[s.expression]);a="const"}else{i=entityNameToExpr(s);a="var"}const o=r.variableDeclaration(a,[r.variableDeclarator(n,i)]);{e.replaceWith(e.node.isExport?r.exportNamedDeclaration(o):o)}e.scope.registerDeclaration(e)},TSExportAssignment(e,t){assertCjsTransformEnabled(e,t,`export = <value>;`,`export default <value>;`);e.replaceWith(n.statement.ast`module.exports = ${e.node.expression}`)},TSTypeAssertion(e){e.replaceWith(e.node.expression)},[`TSAsExpression${r.tsSatisfiesExpression?"|TSSatisfiesExpression":""}`](e){let{node:t}=e;do{t=t.expression}while(r.isTSAsExpression(t)||r.isTSSatisfiesExpression!=null&&r.isTSSatisfiesExpression(t));e.replaceWith(t)},[e.types.tsInstantiationExpression?"TSNonNullExpression|TSInstantiationExpression":"TSNonNullExpression"](e){e.replaceWith(e.node.expression)},CallExpression(e){{e.node.typeParameters=null}},OptionalCallExpression(e){{e.node.typeParameters=null}},NewExpression(e){{e.node.typeParameters=null}},JSXOpeningElement(e){{e.node.typeParameters=null}},TaggedTemplateExpression(e){{e.node.typeParameters=null}}}};function entityNameToExpr(e){if(r.isTSQualifiedName(e)){return r.memberExpression(entityNameToExpr(e.left),e.right)}return e}function visitPattern({node:e}){if(e.typeAnnotation)e.typeAnnotation=null;if(r.isIdentifier(e)&&e.optional)e.optional=null}function isImportTypeOnly({binding:e,programPath:t,pragmaImportName:r,pragmaFragImportName:n}){for(const t of e.referencePaths){if(!isInType(t)){return false}}if(e.identifier.name!==r&&e.identifier.name!==n){return true}let s=false;t.traverse({"JSXElement|JSXFragment"(e){s=true;e.stop()}});return!s}}))},723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=transpileNamespace;t.getFirstIdentifier=getFirstIdentifier;var n=r(2358);var s=r(9878);var i=r(7077);function getFirstIdentifier(e){if(n.types.isIdentifier(e)){return e}return getFirstIdentifier(e.left)}function transpileNamespace(e,t){if(e.node.declare||e.node.id.type==="StringLiteral"){e.remove();return}if(!t){throw e.get("id").buildCodeFrameError("Namespace not marked type-only declare."+" Non-declarative namespaces are only supported experimentally in Babel."+" To enable and review caveats see:"+" https://babeljs.io/docs/en/babel-plugin-transform-typescript")}const r=getFirstIdentifier(e.node.id).name;const n=handleNested(e,e.node);if(n===null){const t=e.findParent((e=>e.isProgram()));(0,s.registerGlobalType)(t.scope,r);e.remove()}else if(e.scope.hasOwnBinding(r)){e.replaceWith(n)}else{e.scope.registerDeclaration(e.replaceWithMultiple([getDeclaration(r),n])[0])}}function getDeclaration(e){return n.types.variableDeclaration("let",[n.types.variableDeclarator(n.types.identifier(e))])}function getMemberExpression(e,t){return n.types.memberExpression(n.types.identifier(e),n.types.identifier(t))}function handleVariableDeclaration(e,t,r){if(e.kind!=="const"){throw r.file.buildCodeFrameError(e,"Namespaces exporting non-const are not supported by Babel."+" Change to const or see:"+" https://babeljs.io/docs/en/babel-plugin-transform-typescript")}const{declarations:s}=e;if(s.every((e=>n.types.isIdentifier(e.id)))){for(const e of s){e.init=n.types.assignmentExpression("=",getMemberExpression(t,e.id.name),e.init)}return[e]}const i=n.types.getBindingIdentifiers(e);const a=[];for(const e in i){a.push(n.types.assignmentExpression("=",getMemberExpression(t,e),n.types.cloneNode(i[e])))}return[e,n.types.expressionStatement(n.types.sequenceExpression(a))]}function buildNestedAmbientModuleError(e,t){return e.hub.buildError(t,"Ambient modules cannot be nested in other modules or namespaces.",Error)}function handleNested(e,t,r){const s=new Set;const a=t.id;const o=e.scope.generateUid(a.name);const l=t.body;let c=t.id;let p;{p=n.types.isTSModuleBlock(l)?l.body:[n.types.exportNamedDeclaration(l)]}let u=true;for(let t=0;t<p.length;t++){const r=p[t];switch(r.type){case"TSModuleDeclaration":{if(!n.types.isIdentifier(r.id)){throw buildNestedAmbientModuleError(e,r)}const i=handleNested(e,r);if(i!==null){u=false;const e=r.id.name;if(s.has(e)){p[t]=i}else{s.add(e);p.splice(t++,1,getDeclaration(e),i)}}continue}case"TSEnumDeclaration":case"FunctionDeclaration":case"ClassDeclaration":u=false;s.add(r.id.name);continue;case"VariableDeclaration":{u=false;for(const e in n.types.getBindingIdentifiers(r)){s.add(e)}continue}default:u&&(u=n.types.isTypeScript(r));continue;case"ExportNamedDeclaration":}if("declare"in r.declaration&&r.declaration.declare){continue}switch(r.declaration.type){case"TSEnumDeclaration":i.EXPORTED_CONST_ENUMS_IN_NAMESPACE.add(r.declaration);case"FunctionDeclaration":case"ClassDeclaration":{u=false;const e=r.declaration.id.name;s.add(e);p.splice(t++,1,r.declaration,n.types.expressionStatement(n.types.assignmentExpression("=",getMemberExpression(o,e),n.types.identifier(e))));break}case"VariableDeclaration":{u=false;const n=handleVariableDeclaration(r.declaration,o,e.hub);p.splice(t,n.length,...n);t+=n.length-1;break}case"TSModuleDeclaration":{if(!n.types.isIdentifier(r.declaration.id)){throw buildNestedAmbientModuleError(e,r.declaration)}const i=handleNested(e,r.declaration,n.types.identifier(o));if(i!==null){u=false;const e=r.declaration.id.name;if(s.has(e)){p[t]=i}else{s.add(e);p.splice(t++,1,getDeclaration(e),i)}}else{p.splice(t,1);t--}}}}if(u)return null;let d=n.types.objectExpression([]);if(r){const e=n.types.memberExpression(r,a);d=n.template.expression.ast` |
| 209 | ${n.types.cloneNode(e)} || |
| 210 | (${n.types.cloneNode(e)} = ${d}) |
| 211 | `}return n.template.statement.ast` |
no test coverage detected