From 94cc869cc97b183d362d641ab7f74362da63d06c Mon Sep 17 00:00:00 2001 From: Florian Greinacher Date: Mon, 29 Apr 2024 15:47:05 +0200 Subject: [PATCH] fix: get rid of import assertion --- lib/definitions/errors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/definitions/errors.js b/lib/definitions/errors.js index fccea7a5..7df6336a 100644 --- a/lib/definitions/errors.js +++ b/lib/definitions/errors.js @@ -1,6 +1,8 @@ import {inspect} from 'util'; -import pkg from '../../package.json' assert {type: 'json'}; +import { createRequire } from "node:module"; +const require = createRequire(import.meta.url); +const pkg = require("../../package.json"); const [homepage] = pkg.homepage.split('#'); const linkify = (file) => `${homepage}/blob/master/${file}`; const stringify = (object) => inspect(object, {breakLength: Number.POSITIVE_INFINITY, depth: 2, maxArrayLength: 5});