Skip to content

Commit

Permalink
fix(swagger): avoid join error issue by return default string value w…
Browse files Browse the repository at this point in the history
…hen import.meta.dirname isn't available

fix issue with jest
  • Loading branch information
Romakita committed Jan 18, 2025
1 parent 4b7592d commit 05846e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/specs/scalar/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {getValue} from "@tsed/core";
import {join} from "path";

export const ROOT_DIR = join(import.meta.dirname, "..");
export const ROOT_DIR = join(getValue(import.meta, "dirname", ""), "..");
6 changes: 4 additions & 2 deletions packages/specs/swagger/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {join} from "path";
import {join} from "node:path";

import {getValue} from "@tsed/core";
import getAbsoluteFSPath from "swagger-ui-dist/absolute-path.js";

export const SWAGGER_UI_DIST = getAbsoluteFSPath();
export const ROOT_DIR = join(import.meta.dirname, "..");
export const ROOT_DIR = join(getValue(import.meta, "dirname", ""), "..");

0 comments on commit 05846e2

Please sign in to comment.