Fix missing file extension on sub URL imports

This commit is contained in:
Fabian Stamm 2023-04-25 08:14:16 +02:00
parent 5106424a32
commit 04f82b655b
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@hibas123/jrpcgen",
"version": "1.2.11",
"version": "1.2.12",
"main": "lib/index.js",
"license": "MIT",
"packageManager": "yarn@3.1.1",

View File

@ -18,7 +18,7 @@ import { ZIGTarget } from "./targets/zig";
import { DartTarget } from "./targets/dart";
import { URL } from "url";
class CatchedError extends Error {}
class CatchedError extends Error { }
const log = dbg("app");
@ -53,6 +53,9 @@ function resolve(base: string, sub?: string) {
} else if (base.startsWith("http://") || base.startsWith("https://")) {
let u = new URL(base);
if (sub) {
if (!sub.endsWith(".jrpc")) {
sub += ".jrpc";
}
u = new URL(sub, u);
}
return u.href;