Skip to content

Commit d209914

Browse files
committed
Add ts-nocheck comment for auto-generated worker files
1 parent f16182f commit d209914

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/lib/lib.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,15 @@ globalThis.__worker_wrapper__ = async (
141141
}
142142

143143
const wrapper = `(({${finalVars.join(",")}}) => ${fnStr})`;
144-
const finalWorkerCode = patchedCode +
144+
let finalWorkerCode = patchedCode +
145145
WORKER_BODY.replace("%FN%", wrapper);
146146

147+
const nocheckPrefix = "// @ts-nocheck: Auto-generated worker file\n";
148+
149+
if (!finalWorkerCode.startsWith(nocheckPrefix)) {
150+
finalWorkerCode = nocheckPrefix + finalWorkerCode;
151+
}
152+
147153
const hash = createHash("md5").update(signatureKey).digest("hex");
148154
const workerDir = resolve(process.cwd(), ".workers");
149155

0 commit comments

Comments
 (0)