Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'ExportNamespaceSpecifier': function (namespace) {
var declaration = importDeclaration(context)
var imports = Exports.get(declaration.source.value, context)
if (imports == null) return null
if (imports.errors.length) {
imports.reportErrors(context, declaration)
return
}
if (!imports.size) {
context.report(namespace,
`No exported names found in module '${declaration.source.value}'.`)
}
},
function processBodyStatement(declaration) {
if (declaration.type !== 'ImportDeclaration') return
if (declaration.specifiers.length === 0) return
const imports = Exports.get(declaration.source.value, context)
if (imports == null) return null
if (imports.errors.length) {
imports.reportErrors(context, declaration)
return
}
for (let specifier of declaration.specifiers) {
switch (specifier.type) {
case 'ImportNamespaceSpecifier':
if (!imports.size) {
context.report(specifier,
`No exported names found in module '${declaration.source.value}'.`)
}
namespaces.set(specifier.local.name, imports)
break