From 04f82b655b8acd33d70dfca4de4fbb23141ee1ab Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Tue, 25 Apr 2023 08:14:16 +0200 Subject: [PATCH] Fix missing file extension on sub URL imports --- package.json | 2 +- src/process.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fc0dde0..c410bfa 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/process.ts b/src/process.ts index 21b6a9e..8971bde 100644 --- a/src/process.ts +++ b/src/process.ts @@ -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;