Skip to content

Commit

Permalink
Fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Dec 18, 2019
1 parent dbf3f91 commit 80e95d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/babel-core/src/transformation/normalize-file.js
Expand Up @@ -65,12 +65,12 @@ export default function normalizeFile(
const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
if (typeof options.filename === "string" && lastComment) {
try {
const inputMapFilename = EXTERNAL_SOURCEMAP_REGEX.exec(
lastComment,
)[1];
const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);
if (!match) throw new Error("Invalid source map comment format.");
inputMap = convertSourceMap.fromJSON(
fs.readFileSync(
path.resolve(path.dirname(options.filename), inputMapFilename),
path.resolve(path.dirname(options.filename), match[1]),
"utf8",
),
);
} catch (err) {
Expand Down

0 comments on commit 80e95d0

Please sign in to comment.