{"version":3,"sources":["../src/exportParser.js"],"names":["debug","createNode","props","getSymbolValue","symbol","type","value","getIdentifier","node","globals","scope","opts","simpleIdentifier","identifierLiteral","name","block","createSymbol","getSymbol","opt","obj","object","propertySymbol","property","computed","propertyValue","val","prototype","left","right","body","forEach","method","key","properties","prop","includes","propVal","createBlockSymbol","isGlobal","window","special","id","valueSymbol","initVariables","childNode","expression","declarations","declaration","initWindow","kind","mapVariables","isExport","ancestorsOnly","init","exported","ANONYMOUS_DEFAULT","specifiers","specifier","local","findNode","cache","blockCache","slice","push","propval","Object","values","Array","isArray","some","exportTypes","Set","getExportAncestor","nde","has","parent","canExportedByAncestorType","canExportChildrenType","isExportByAncestor","findExportedNode","isNodeExported","initModuleExports","module","exports","esm","parseRecursive","globalVars","parse","ast","isUncommentedExport","sourceCode","settings","exportNode","parseResult"],"mappings":";;;;;;;AAAA;;AAGA;;;;AAEA,MAAMA,KAAK,GAAG,oBAAY,oBAAZ,CAAd;;AAEA,MAAMC,UAAU,GAAG,YAAY;AAC7B,SAAO;AACLC,IAAAA,KAAK,EAAE;AADF,GAAP;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,UAAUC,MAAV,EAAkB;AACvC;AACA,MAAI,CAACA,MAAL,EAAa;AACX;AACA,WAAO,IAAP;AACD;AACD;;;AACA,MAAIA,MAAM,CAACC,IAAP,KAAgB,SAApB,EAA+B;AAC7B,WAAOD,MAAM,CAACE,KAAP,CAAaA,KAApB;AACD;AAED;;;AACA,SAAO,IAAP;AACD,CAbD;;AAeA,MAAMC,aAAa,GAAG,UAAUC,IAAV,EAAgBC,OAAhB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsC;AAC1D,MAAIA,IAAI,CAACC,gBAAT,EAA2B;AACzB;AACA,UAAMC,iBAAiB,GAAGZ,UAAU,EAApC;AACAY,IAAAA,iBAAiB,CAACR,IAAlB,GAAyB,SAAzB;AACAQ,IAAAA,iBAAiB,CAACP,KAAlB,GAA0B;AAACA,MAAAA,K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C,GAAD,EAAMF,UAAN,EAAkB3E,IAAlB,CAAZ;AACD;;AAED,SAAO;AACL2E,IAAAA;AADK,GAAP;AAGD,CA9BD;;AAgCA,MAAMG,mBAAmB,GAAG,UAAUjF,IAAV,EAAgBkF,UAAhB,EAA4BxE,GAA5B,EAAiCyE,QAAjC,EAA2C;AACrE;AACA;AACA,MAAIzE,GAAG,CAACkE,GAAR,EAAa;AACX,UAAMQ,UAAU,GAAGpB,iBAAiB,CAAChE,IAAD,CAApC,CADW,CAGX;;AACA,QAAIoF,UAAU,IAAI,CAAC,oCAAiBA,UAAjB,EAA6BF,UAA7B,EAAyCC,QAAzC,CAAnB,EAAuE;AACrE,aAAO,IAAP;AACD;AAED;;;AACA,QACEb,kBAAkB,CAACtE,IAAD,CAAlB,IACA,CAAC,oCAAiBA,IAAjB,EAAuBkF,UAAvB,EAAmCC,QAAnC,CAFH,EAGE;AACA,aAAO,IAAP;AACD;AACF;;AAED,QAAME,WAAW,GAAGN,KAAK,CAACG,UAAU,CAACF,GAAZ,EAAiBhF,IAAjB,EAAuBU,GAAvB,CAAzB;AAEA,SAAO8D,cAAc,CAACxE,IAAD,EAAOqF,WAAW,CAACP,UAAnB,EAA+BpE,GAA/B,CAArB;AACD,CAvBD;;eAyBe;AACbuE,EAAAA,mBADa;AAEbF,EAAAA;AAFa,C","sourcesContent":["import {\n findJSDocComment,\n} from '@es-joy/jsdoccomment';\nimport debugModule from 'debug';\n\nconst debug = debugModule('requireExportJsdoc');\n\nconst createNode = function () {\n return {\n props: {},\n };\n};\n\nconst getSymbolValue = function (symbol) {\n /* istanbul ignore next */\n if (!symbol) {\n /* istanbul ignore next */\n return null;\n }\n /* istanbul ignore next */\n if (symbol.type === 'literal') {\n return symbol.value.value;\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst getIdentifier = function (node, globals, scope, opts) {\n if (opts.simpleIdentifier) {\n // Type is Identier for noncomputed properties\n const identifierLiteral = createNode();\n identifierLiteral.type = 'literal';\n identifierLiteral.value = {value: node.name};\n\n return identifierLiteral;\n }\n\n /* istanbul ignore next */\n const block = scope || globals;\n\n // As scopes are not currently supported, they are not traversed upwards recursively\n if (block.props[node.name]) {\n return block.props[node.name];\n }\n\n // Seems this will only be entered once scopes added and entered\n /* istanbul ignore next */\n if (globals.props[node.name]) {\n return globals.props[node.name];\n }\n\n return null;\n};\n\nlet createSymbol = null;\nconst getSymbol = function (node, globals, scope, opt) {\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Identifier': {\n return getIdentifier(node, globals, scope, opts);\n } case 'MemberExpression': {\n const obj = getSymbol(node.object, globals, scope, opts);\n const propertySymbol = getSymbol(node.property, globals, scope, {simpleIdentifier: !node.computed});\n const propertyValue = getSymbolValue(propertySymbol);\n\n /* istanbul ignore next */\n if (obj && propertyValue && obj.props[propertyValue]) {\n const block = obj.props[propertyValue];\n\n return block;\n }\n\n /*\n if (opts.createMissingProps && propertyValue) {\n obj.props[propertyValue] = createNode();\n\n return obj.props[propertyValue];\n }\n */\n /* istanbul ignore next */\n debug(`MemberExpression: Missing property ${node.property.name}`);\n\n /* istanbul ignore next */\n return null;\n }\n case 'TSTypeAliasDeclaration':\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n case 'ClassDeclaration': case 'ClassExpression':\n case 'FunctionExpression': case 'FunctionDeclaration':\n case 'ArrowFunctionExpression': {\n const val = createNode();\n val.props.prototype = createNode();\n val.props.prototype.type = 'object';\n val.type = 'object';\n val.value = node;\n\n return val;\n } case 'AssignmentExpression': {\n return createSymbol(node.left, globals, node.right, scope, opts);\n } case 'ClassBody': {\n const val = createNode();\n node.body.forEach((method) => {\n val.props[method.key.name] = createNode();\n val.props[method.key.name].type = 'object';\n val.props[method.key.name].value = method.value;\n });\n val.type = 'object';\n val.value = node;\n\n return val;\n } case 'ObjectExpression': {\n const val = createNode();\n val.type = 'object';\n node.properties.forEach((prop) => {\n if ([\n // @typescript-eslint/parser, espree, acorn, etc.\n 'SpreadElement',\n\n // @babel/eslint-parser\n 'ExperimentalSpreadProperty',\n ].includes(prop.type)) {\n return;\n }\n const propVal = getSymbol(prop.value, globals, scope, opts);\n /* istanbul ignore next */\n if (propVal) {\n val.props[prop.key.name] = propVal;\n }\n });\n\n return val;\n } case 'Literal': {\n const val = createNode();\n val.type = 'literal';\n val.value = node;\n\n return val;\n }\n }\n\n /* istanbul ignore next */\n return null;\n};\n\nconst createBlockSymbol = function (block, name, value, globals, isGlobal) {\n block.props[name] = value;\n if (isGlobal && globals.props.window && globals.props.window.special) {\n globals.props.window.props[name] = value;\n }\n};\n\ncreateSymbol = function (node, globals, value, scope, isGlobal) {\n const block = scope || globals;\n let symbol;\n switch (node.type) {\n case 'FunctionDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSEnumDeclaration': case 'TSInterfaceDeclaration':\n /* istanbul ignore next */\n // Fall through\n case 'TSTypeAliasDeclaration': case 'ClassDeclaration': {\n /* istanbul ignore next */\n if (node.id && node.id.type === 'Identifier') {\n return createSymbol(node.id, globals, node, globals);\n }\n /* istanbul ignore next */\n break;\n } case 'Identifier': {\n if (value) {\n const valueSymbol = getSymbol(value, globals, block);\n /* istanbul ignore next */\n if (valueSymbol) {\n createBlockSymbol(block, node.name, valueSymbol, globals, isGlobal);\n\n return block.props[node.name];\n }\n /* istanbul ignore next */\n debug('Identifier: Missing value symbol for %s', node.name);\n } else {\n createBlockSymbol(block, node.name, createNode(), globals, isGlobal);\n\n return block.props[node.name];\n }\n /* istanbul ignore next */\n break;\n } case 'MemberExpression': {\n symbol = getSymbol(node.object, globals, block);\n\n const propertySymbol = getSymbol(node.property, globals, block, {simpleIdentifier: !node.computed});\n const propertyValue = getSymbolValue(propertySymbol);\n if (symbol && propertyValue) {\n createBlockSymbol(symbol, propertyValue, getSymbol(value, globals, block), globals, isGlobal);\n\n return symbol.props[propertyValue];\n }\n /* istanbul ignore next */\n debug('MemberExpression: Missing symbol: %s', node.property.name);\n break;\n }\n }\n\n return null;\n};\n\n// Creates variables from variable definitions\nconst initVariables = function (node, globals, opts) {\n switch (node.type) {\n case 'Program': {\n node.body.forEach((childNode) => {\n initVariables(childNode, globals, opts);\n });\n break;\n } case 'ExpressionStatement': {\n initVariables(node.expression, globals, opts);\n break;\n } case 'VariableDeclaration': {\n node.declarations.forEach((declaration) => {\n // let and const\n const symbol = createSymbol(declaration.id, globals, null, globals);\n if (opts.initWindow && node.kind === 'var' && globals.props.window) {\n // If var, also add to window\n globals.props.window.props[declaration.id.name] = symbol;\n }\n });\n break;\n } case 'ExportNamedDeclaration': {\n if (node.declaration) {\n initVariables(node.declaration, globals, opts);\n }\n break;\n }\n }\n};\n\n// Populates variable maps using AST\nconst mapVariables = function (node, globals, opt, isExport) {\n /* istanbul ignore next */\n const opts = opt || {};\n /* istanbul ignore next */\n switch (node.type) {\n case 'Program': {\n if (opts.ancestorsOnly) {\n return false;\n }\n node.body.forEach((childNode) => {\n mapVariables(childNode, globals, opts);\n });\n break;\n } case 'ExpressionStatement': {\n mapVariables(node.expression, globals, opts);\n break;\n } case 'AssignmentExpression': {\n createSymbol(node.left, globals, node.right);\n break;\n } case 'VariableDeclaration': {\n node.declarations.forEach((declaration) => {\n const isGlobal = opts.initWindow && node.kind === 'var' && globals.props.window;\n const symbol = createSymbol(declaration.id, globals, declaration.init, globals, isGlobal);\n if (symbol && isExport) {\n symbol.exported = true;\n }\n });\n break;\n } case 'FunctionDeclaration': {\n /* istanbul ignore next */\n if (node.id.type === 'Identifier') {\n createSymbol(node.id, globals, node, globals, true);\n }\n break;\n } case 'ExportDefaultDeclaration': {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n if (symbol) {\n symbol.exported = true;\n } else if (!node.id) {\n globals.ANONYMOUS_DEFAULT = node.declaration;\n }\n break;\n } case 'ExportNamedDeclaration': {\n if (node.declaration) {\n if (node.declaration.type === 'VariableDeclaration') {\n mapVariables(node.declaration, globals, opts, true);\n } else {\n const symbol = createSymbol(node.declaration, globals, node.declaration);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n }\n }\n node.specifiers.forEach((specifier) => {\n mapVariables(specifier, globals, opts);\n });\n break;\n } case 'ExportSpecifier': {\n const symbol = getSymbol(node.local, globals, globals);\n /* istanbul ignore next */\n if (symbol) {\n symbol.exported = true;\n }\n break;\n } case 'ClassDeclaration': {\n createSymbol(node.id, globals, node.body, globals);\n break;\n } default: {\n /* istanbul ignore next */\n return false;\n }\n }\n\n return true;\n};\n\nconst findNode = function (node, block, cache) {\n let blockCache = cache || [];\n /* istanbul ignore next */\n if (!block || blockCache.includes(block)) {\n return false;\n }\n blockCache = blockCache.slice();\n blockCache.push(block);\n\n if (\n (block.type === 'object' || block.type === 'MethodDefinition') &&\n block.value === node\n ) {\n return true;\n }\n\n const {props = block.body} = block;\n for (const propval of Object.values(props || {})) {\n if (Array.isArray(propval)) {\n /* istanbul ignore if */\n if (propval.some((val) => {\n return findNode(node, val, blockCache);\n })) {\n return true;\n }\n } else if (findNode(node, propval, blockCache)) {\n return true;\n }\n }\n\n return false;\n};\n\nconst exportTypes = new Set(['ExportNamedDeclaration', 'ExportDefaultDeclaration']);\nconst getExportAncestor = function (nde) {\n let node = nde;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n node = node.parent;\n }\n\n return false;\n};\n\nconst canExportedByAncestorType = new Set([\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'ClassProperty',\n 'Method',\n]);\n\nconst canExportChildrenType = new Set([\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'ClassDefinition',\n 'ClassExpression',\n 'Program',\n]);\n\nconst isExportByAncestor = function (nde) {\n if (!canExportedByAncestorType.has(nde.type)) {\n return false;\n }\n let node = nde.parent;\n while (node) {\n if (exportTypes.has(node.type)) {\n return node;\n }\n\n if (!canExportChildrenType.has(node.type)) {\n return false;\n }\n node = node.parent;\n }\n\n return false;\n};\n\nconst findExportedNode = function (block, node, cache) {\n /* istanbul ignore next */\n if (block === null) {\n return false;\n }\n const blockCache = cache || [];\n const {props} = block;\n for (const propval of Object.values(props)) {\n blockCache.push(propval);\n if (propval.exported && (node === propval.value || findNode(node, propval.value))) {\n return true;\n }\n\n // No need to check `propval` for exported nodes as ESM\n // exports are only global\n }\n\n return false;\n};\n\nconst isNodeExported = function (node, globals, opt) {\n if (\n opt.initModuleExports && globals.props.module && globals.props.module.props.exports &&\n findNode(node, globals.props.module.props.exports)\n ) {\n return true;\n }\n\n if (opt.initWindow && globals.props.window && findNode(node, globals.props.window)) {\n return true;\n }\n\n if (opt.esm && findExportedNode(globals, node)) {\n return true;\n }\n\n return false;\n};\n\nconst parseRecursive = function (node, globalVars, opts) {\n // Iterate from top using recursion - stop at first processed node from top\n if (node.parent && parseRecursive(node.parent, globalVars, opts)) {\n return true;\n }\n\n return mapVariables(node, globalVars, opts);\n};\n\nconst parse = function (ast, node, opt) {\n /* istanbul ignore next */\n const opts = opt || {\n ancestorsOnly: false,\n esm: true,\n initModuleExports: true,\n initWindow: true,\n };\n\n const globalVars = createNode();\n if (opts.initModuleExports) {\n globalVars.props.module = createNode();\n globalVars.props.module.props.exports = createNode();\n globalVars.props.exports = globalVars.props.module.props.exports;\n }\n if (opts.initWindow) {\n globalVars.props.window = createNode();\n globalVars.props.window.special = true;\n }\n\n if (opts.ancestorsOnly) {\n parseRecursive(node, globalVars, opts);\n } else {\n initVariables(ast, globalVars, opts);\n mapVariables(ast, globalVars, opts);\n }\n\n return {\n globalVars,\n };\n};\n\nconst isUncommentedExport = function (node, sourceCode, opt, settings) {\n // console.log({node});\n // Optimize with ancestor check for esm\n if (opt.esm) {\n const exportNode = getExportAncestor(node);\n\n // Is export node comment\n if (exportNode && !findJSDocComment(exportNode, sourceCode, settings)) {\n return true;\n }\n\n /** Some typescript types are not in variable map, but inherit exported (interface property and method)*/\n if (\n isExportByAncestor(node) &&\n !findJSDocComment(node, sourceCode, settings)\n ) {\n return true;\n }\n }\n\n const parseResult = parse(sourceCode.ast, node, opt);\n\n return isNodeExported(node, parseResult.globalVars, opt);\n};\n\nexport default {\n isUncommentedExport,\n parse,\n};\n"],"file":"exportParser.js"}