Skip to content

Commit

Permalink
Enable check
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 6, 2022
1 parent 56164a4 commit e4ae38e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/build/modify-typescript-module.mjs
Expand Up @@ -47,14 +47,12 @@ function removeSubmodule(text, testFunction) {
function replaceSubmodule(text, testFunction, replacement) {
const modules = getSubmodules(text, testFunction);
if (modules.length !== 1) {
return text;
// TODO: Enable this check when merge to `next` branch
// throw Object.assign(
// new Error(
// `Expect exactly one submodule to be found, got ${modules.length} submodules.`
// ),
// { modules }
// );
throw Object.assign(
new Error(
`Expect exactly one submodule to be found, got ${modules.length} submodules.`
),
{ modules }
);
}

const [{ start, end, before, after }] = modules;
Expand Down

0 comments on commit e4ae38e

Please sign in to comment.