Skip to content

Commit 6675793

Browse files
committed
chore(generation): Improve deno add support
1 parent 562423c commit 6675793

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

generation/codegen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ export async function writeApiModule(surface: SurfaceMap, api: SurfaceApi, categ
88

99
function postProcess(text: string) {
1010
if (apisModuleRoot) {
11+
const isJsrRoot = apisModuleRoot.startsWith('jsr:') || apisModuleRoot.startsWith('@');
1112
text = text.replaceAll(/from "..\/..\/([^"]+)"/g, (_, path) => {
12-
if (apisModuleRoot.startsWith('jsr:') && path.includes('@')) {
13+
if (isJsrRoot && path.includes('@')) {
1314
return `from "${apisModuleRoot}${path.split('/')[1].replace('@', '/')}"`;
1415
} else {
1516
return `from "${apisModuleRoot}${path}"`;

0 commit comments

Comments
 (0)