Skip to content

Commit

Permalink
fix(docurl): fix import.meta.filename missing in node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauNeko committed Dec 17, 2024
1 parent 5930bbb commit 7bb0e45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/backend/lib/utils/docUrl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as path from 'node:path';

import { fileURLToPath } from 'node:url';
import packageJson from '../../package.json' with { type: 'json' };

const docUrl = ({ filename }: ImportMeta) => {
const docUrl = (meta: ImportMeta) => {
const filename = meta.filename ?? fileURLToPath(meta.url);

const url = new URL(packageJson.homepage);
const rule = path.basename(filename, '.js');
url.hash = '';
Expand Down

0 comments on commit 7bb0e45

Please sign in to comment.