Skip to content

Commit

Permalink
refactor: remove tryToExtractExportedConstValue
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jul 21, 2022
1 parent d7a713c commit e34ba69
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions packages/next/build/analysis/extract-const-value.ts
Expand Up @@ -61,26 +61,6 @@ export function extractExportedConstValue(
throw new NoSuchDeclarationError()
}

/**
* A wrapper on top of `extractExportedConstValue` that returns undefined
* instead of throwing when the thrown error is known.
*/
export function tryToExtractExportedConstValue(
module: Module,
exportedName: string
) {
try {
return extractExportedConstValue(module, exportedName)
} catch (error) {
if (
error instanceof UnsupportedValueError ||
error instanceof NoSuchDeclarationError
) {
return undefined
}
}
}

function isExportDeclaration(node: Node): node is ExportDeclaration {
return node.type === 'ExportDeclaration'
}
Expand Down

0 comments on commit e34ba69

Please sign in to comment.