diff --git a/package.json b/package.json index 8ceb23fb..34f512c7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@arethetypeswrong/cli": "^0.18.2", "@changesets/changelog-github": "^0.6.0", "@changesets/cli": "^2.29.4", - "@openally/config.eslint": "^2.1.0", + "@openally/config.eslint": "^2.4.2", "@openally/config.typescript": "1.2.1", "@slimio/is": "^2.0.0", "@types/node": "^25.3.3", diff --git a/workspaces/conformance/test/extract.spec.ts b/workspaces/conformance/test/extract.spec.ts index f5acbd2a..9ed66982 100644 --- a/workspaces/conformance/test/extract.spec.ts +++ b/workspaces/conformance/test/extract.spec.ts @@ -1,7 +1,6 @@ // Import Node.js Dependencies import path from "node:path"; import assert from "node:assert"; -import { fileURLToPath } from "node:url"; import { describe, it } from "node:test"; // Import Third-party Dependencies @@ -15,8 +14,7 @@ import { import expectedParsedLicense from "./fixtures/parseLicense.snap.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures"); +const kFixturePath = path.join(import.meta.dirname, "fixtures"); const kFixtureProjectOne = path.join(kFixturePath, "project1"); const kFixtureProjectTwo = path.join(kFixturePath, "project2"); diff --git a/workspaces/contact/test/ContactExtractor.spec.ts b/workspaces/contact/test/ContactExtractor.spec.ts index e8bdcd4a..e724a4c3 100644 --- a/workspaces/contact/test/ContactExtractor.spec.ts +++ b/workspaces/contact/test/ContactExtractor.spec.ts @@ -1,8 +1,7 @@ // Import Node.js Dependencies import assert from "node:assert"; import { describe, test } from "node:test"; -import { join, dirname } from "node:path"; -import { fileURLToPath } from "node:url"; +import { join } from "node:path"; import { readFileSync } from "node:fs"; // Import Third-party Dependencies @@ -16,9 +15,8 @@ import { } from "../src/index.ts"; // CONSTANTS -const __dirname = dirname(fileURLToPath(import.meta.url)); -const kManifestFixturePath = join(__dirname, "fixtures", "manifest"); -const kPackumentFixturePath = join(__dirname, "fixtures", "packument"); +const kManifestFixturePath = join(import.meta.dirname, "fixtures", "manifest"); +const kPackumentFixturePath = join(import.meta.dirname, "fixtures", "packument"); const kManifest: PackumentVersion = JSON.parse(readFileSync(join(kManifestFixturePath, "/manifest.json"), "utf8")); const kPackument: Packument = JSON.parse(readFileSync(join(kPackumentFixturePath, "/packument.json"), "utf8")); diff --git a/workspaces/flags/scripts/generateFlags.ts b/workspaces/flags/scripts/generateFlags.ts index 1be857f7..a88ef2ca 100644 --- a/workspaces/flags/scripts/generateFlags.ts +++ b/workspaces/flags/scripts/generateFlags.ts @@ -1,14 +1,12 @@ // Import Node.js Dependencies import path from "node:path"; import fs from "node:fs/promises"; -import { fileURLToPath } from "node:url"; // Import Third-party Dependencies import TurndownService from "turndown"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kRootPath = path.join(__dirname, ".."); +const kRootPath = path.join(import.meta.dirname, ".."); const turndownService = new TurndownService(); @@ -35,7 +33,7 @@ async function loadHTMLs() { const [headerTemplate, ...HTMLFlagsFiles] = await Promise.all([ fs.readFile( - path.join(__dirname, "template", "flagDocHeader.md"), + path.join(import.meta.dirname, "template", "flagDocHeader.md"), "utf-8" ), ...HTMLFlagsEntries.map( diff --git a/workspaces/flags/src/node.ts b/workspaces/flags/src/node.ts index cdc74315..50f28bb8 100644 --- a/workspaces/flags/src/node.ts +++ b/workspaces/flags/src/node.ts @@ -2,15 +2,13 @@ import fs from "node:fs"; import path from "node:path"; import * as consumers from "node:stream/consumers"; -import { fileURLToPath } from "node:url"; import { Readable } from "node:stream"; // Import Internal Dependencies import { getFlags } from "./web.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFlagsPath = path.join(__dirname, "flags"); +const kFlagsPath = path.join(import.meta.dirname, "flags"); /** * @description lazy read a flag file by getting a Node.js Readable Stream diff --git a/workspaces/fs-walk/src/walk.ts b/workspaces/fs-walk/src/walk.ts index f4169c6c..84f5bfc6 100644 --- a/workspaces/fs-walk/src/walk.ts +++ b/workspaces/fs-walk/src/walk.ts @@ -10,7 +10,7 @@ import type { WalkOptions, WalkEntry } from "./types.ts"; * @example * import { walk } from "@nodesecure/fs-walk"; * - * for await (const [dirent, location] of walk(__dirname) { + * for await (const [dirent, location] of walk(import.meta.dirname)) { * if (dirent.isFile()) { * console.log(location); * } diff --git a/workspaces/fs-walk/src/walkSync.ts b/workspaces/fs-walk/src/walkSync.ts index 9ea45254..195ea98c 100644 --- a/workspaces/fs-walk/src/walkSync.ts +++ b/workspaces/fs-walk/src/walkSync.ts @@ -10,7 +10,7 @@ import type { WalkOptions, WalkEntry } from "./types.ts"; * @example * import { walkSync, FILE } from "@nodesecure/fs-walk"; * - * for (const [type, location] of walkSync(__dirname) { + * for (const [type, location] of walkSync(import.meta.dirname)) { * if (type === FILE) { * console.log(location); * } diff --git a/workspaces/fs-walk/test/walk.spec.ts b/workspaces/fs-walk/test/walk.spec.ts index 4033f999..92c1edd7 100644 --- a/workspaces/fs-walk/test/walk.spec.ts +++ b/workspaces/fs-walk/test/walk.spec.ts @@ -2,16 +2,13 @@ import { describe, it } from "node:test"; import assert from "node:assert"; import path from "node:path"; -import { fileURLToPath } from "node:url"; // Import Internal Dependencies import { walk, walkSync } from "../src/index.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -const kRootLocation = path.join(__dirname, ".."); -const kFixturesDir = path.join(__dirname, "fixtures"); +const kRootLocation = path.join(import.meta.dirname, ".."); +const kFixturesDir = path.join(import.meta.dirname, "fixtures"); const kExpectedJSFiles = [ "src/index.ts", diff --git a/workspaces/github/src/functions/download.ts b/workspaces/github/src/functions/download.ts index ff6e1213..c8ca316c 100644 --- a/workspaces/github/src/functions/download.ts +++ b/workspaces/github/src/functions/download.ts @@ -46,7 +46,7 @@ export interface DownloadResult { /** * @example * const { location } = await github.download("NodeSecure.utils", { - * dest: __dirname + * dest: import.meta.dirname * }); * console.log(location); */ diff --git a/workspaces/i18n/scripts/buildDocumentation.ts b/workspaces/i18n/scripts/buildDocumentation.ts index 478cf5b2..328c7720 100644 --- a/workspaces/i18n/scripts/buildDocumentation.ts +++ b/workspaces/i18n/scripts/buildDocumentation.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "node:fs"; import os from "node:os"; -import { fileURLToPath, pathToFileURL } from "node:url"; +import { pathToFileURL } from "node:url"; // Import Third-party Dependencies import zup from "zup"; @@ -12,8 +12,7 @@ import { english } from "../src/languages/english.ts"; import { french } from "../src/languages/french.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kProjectRootDir = path.join(__dirname, ".."); +const kProjectRootDir = path.join(import.meta.dirname, ".."); const kTokens = { english, french diff --git a/workspaces/rc/test/index.spec.ts b/workspaces/rc/test/index.spec.ts index 97ecfdc1..ef917148 100644 --- a/workspaces/rc/test/index.spec.ts +++ b/workspaces/rc/test/index.spec.ts @@ -1,7 +1,6 @@ // Import Node.js Dependencies import path from "node:path"; import { readdirSync } from "node:fs"; -import { fileURLToPath } from "node:url"; import assert from "node:assert"; import { describe, it } from "node:test"; @@ -14,9 +13,6 @@ import * as RC from "../src/index.ts"; import { readJSONSync } from "../src/utils/readJSON.ts"; import { generateDefaultRC } from "../src/rc.ts"; -// CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - describe("CONSTANTS", () => { it("should export a CONSTANTS variable", () => { assert("CONSTANTS" in RC); @@ -86,7 +82,7 @@ describe("JSON Schema", () => { const ajv = new Ajv(); const validate = ajv.compile(RC.JSONSchema); - const configurationPath = path.join(__dirname, "fixtures", "configuration"); + const configurationPath = path.join(import.meta.dirname, "fixtures", "configuration"); const configurationFiles = readdirSync(configurationPath, { withFileTypes: true }) .filter((dirent) => dirent.isFile() && path.extname(dirent.name) === ".json") .map((dirent) => path.join(configurationPath, dirent.name)); diff --git a/workspaces/rc/test/read.spec.ts b/workspaces/rc/test/read.spec.ts index 4f24a268..b49174e0 100644 --- a/workspaces/rc/test/read.spec.ts +++ b/workspaces/rc/test/read.spec.ts @@ -2,7 +2,6 @@ import * as fs from "node:fs/promises"; import path from "node:path"; import os from "node:os"; -import { fileURLToPath } from "node:url"; import assert from "node:assert"; import { describe, before, beforeEach, it, after } from "node:test"; @@ -16,12 +15,9 @@ import { } from "../src/index.ts"; import { generateDefaultRC } from "../src/rc.ts"; -// CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - describe("read .nodesecurerc", () => { const location = path.join(os.tmpdir(), "rcread"); - const fixtures = path.join(__dirname, "fixtures"); + const fixtures = path.join(import.meta.dirname, "fixtures"); before(async() => { await fs.mkdir(location); diff --git a/workspaces/scanner/src/class/TopPackages.class.ts b/workspaces/scanner/src/class/TopPackages.class.ts index b39a662b..2a37f0f7 100644 --- a/workspaces/scanner/src/class/TopPackages.class.ts +++ b/workspaces/scanner/src/class/TopPackages.class.ts @@ -5,12 +5,6 @@ import fs from "node:fs/promises"; // Import Third-party Dependencies import { distance } from "fastest-levenshtein"; -// Import Internal Dependencies -import { getDirNameFromUrl } from "../utils/index.ts"; - -// CONSTANTS -const __dirname = getDirNameFromUrl(import.meta.url); - /** * This implementation take inspiration from npq * @see https://github.com/lirantal/npq/blob/c11e5425707ae992fcd6fb0878abe01ccd77399b/lib/marshalls/typosquatting.marshall.js#L23 @@ -20,7 +14,7 @@ export class TopPackages { async loadJSON() { const rawPackageStr = await fs.readFile( - path.join(__dirname, "..", "data", "top-packages.json"), + path.join(import.meta.dirname, "..", "data", "top-packages.json"), "utf-8" ); diff --git a/workspaces/scanner/src/extractors/payload.ts b/workspaces/scanner/src/extractors/payload.ts index 39cc3c03..5b091ee0 100644 --- a/workspaces/scanner/src/extractors/payload.ts +++ b/workspaces/scanner/src/extractors/payload.ts @@ -15,7 +15,7 @@ import { isNodesecurePayload } from "../utils/isNodesecurePayload.ts"; const kFastMerge = deepmerge({ all: true }); type MergeDeep = - T extends [a: infer A, ...rest: infer R] ? A & MergeDeep : {}; + T extends [a: infer A, ...rest: infer R] ? A & MergeDeep : {}; export type ExtractProbeResult< T extends ProbeExtractor[] diff --git a/workspaces/scanner/src/utils/dirname.ts b/workspaces/scanner/src/utils/dirname.ts index 6f112dc8..63b79059 100644 --- a/workspaces/scanner/src/utils/dirname.ts +++ b/workspaces/scanner/src/utils/dirname.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url"; import { dirname } from "node:path"; export function getDirNameFromUrl(url: string | URL): string { - const __filename = fileURLToPath(url); + const filename = fileURLToPath(url); - return dirname(__filename); + return dirname(filename); } diff --git a/workspaces/scanner/test/comparePayloads.spec.ts b/workspaces/scanner/test/comparePayloads.spec.ts index 97c09b19..2cfa49e8 100644 --- a/workspaces/scanner/test/comparePayloads.spec.ts +++ b/workspaces/scanner/test/comparePayloads.spec.ts @@ -1,16 +1,14 @@ // Import Node.js Dependencies import { it } from "node:test"; import assert from "node:assert"; -import { join, dirname } from "node:path"; -import { fileURLToPath } from "node:url"; +import { join } from "node:path"; import { readFileSync } from "node:fs"; // Import Internal Dependencies import { comparePayloads } from "../src/index.ts"; // CONSTANTS -const __dirname = dirname(fileURLToPath(import.meta.url)); -const kFixturePath = join(__dirname, "fixtures", "scannerPayloads"); +const kFixturePath = join(import.meta.dirname, "fixtures", "scannerPayloads"); const kPayload = JSON.parse(readFileSync(join(kFixturePath, "/payload.json"), "utf8")); it("should throw an error if compared payloads have the same id", () => { diff --git a/workspaces/scanner/test/depWalker.spec.ts b/workspaces/scanner/test/depWalker.spec.ts index 15dc842e..915929fe 100644 --- a/workspaces/scanner/test/depWalker.spec.ts +++ b/workspaces/scanner/test/depWalker.spec.ts @@ -1,6 +1,5 @@ // Import Node.js Dependencies import path from "node:path"; -import url from "node:url"; import { readFileSync } from "node:fs"; import { test, describe } from "node:test"; import assert from "node:assert"; @@ -24,8 +23,7 @@ import { const skip = false; // CONSTANTS -const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures", "depWalker"); +const kFixturePath = path.join(import.meta.dirname, "fixtures", "depWalker"); const kDefaultWalkerOptions = { registry: getLocalRegistryURL() }; diff --git a/workspaces/scanner/test/verify.spec.ts b/workspaces/scanner/test/verify.spec.ts index 27745335..4cbdcbbe 100644 --- a/workspaces/scanner/test/verify.spec.ts +++ b/workspaces/scanner/test/verify.spec.ts @@ -2,15 +2,13 @@ import path from "node:path"; import fs from "node:fs"; import assert from "node:assert"; -import { fileURLToPath } from "node:url"; import { test } from "node:test"; // Import Internal Dependencies import { verify } from "../src/index.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures", "verify"); +const kFixturePath = path.join(import.meta.dirname, "fixtures", "verify"); test("verify 'express' package", async() => { const data = await verify("express@4.17.0"); diff --git a/workspaces/tarball/test/NpmTarball.spec.ts b/workspaces/tarball/test/NpmTarball.spec.ts index d1283796..ba06ce2f 100644 --- a/workspaces/tarball/test/NpmTarball.spec.ts +++ b/workspaces/tarball/test/NpmTarball.spec.ts @@ -1,6 +1,5 @@ // Import Node.js Dependencies import path from "node:path"; -import { fileURLToPath } from "node:url"; import { describe, test } from "node:test"; import assert from "node:assert"; @@ -14,8 +13,7 @@ type SourceArrayLocation = [[number, number], [number, number]]; import { NpmTarball } from "../src/class/NpmTarball.class.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures", "npmTarball"); +const kFixturePath = path.join(import.meta.dirname, "fixtures", "npmTarball"); const kShadyLinkPath = path.join(kFixturePath, "shady-link"); type Metadata = { @@ -24,7 +22,7 @@ type Metadata = { describe("NpmTarball", () => { test("it should exclude files matching glob patterns via the exclude option", async() => { - const fixturePath = path.join(__dirname, "fixtures", "exclude-test"); + const fixturePath = path.join(import.meta.dirname, "fixtures", "exclude-test"); const mama = await ManifestManager.fromPackageJSON( path.join(fixturePath, "package.json") ); diff --git a/workspaces/tarball/test/SourceCodeReport.spec.ts b/workspaces/tarball/test/SourceCodeReport.spec.ts index 0a5a449e..32a7e907 100644 --- a/workspaces/tarball/test/SourceCodeReport.spec.ts +++ b/workspaces/tarball/test/SourceCodeReport.spec.ts @@ -1,6 +1,5 @@ // Import Node.js Dependencies import path from "node:path"; -import { fileURLToPath } from "node:url"; import { test } from "node:test"; import assert from "node:assert"; @@ -11,8 +10,7 @@ import { AstAnalyser, DefaultCollectableSet } from "@nodesecure/js-x-ray"; import { SourceCodeScanner } from "../src/class/SourceCodeScanner.class.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures", "scanJavascriptFile"); +const kFixturePath = path.join(import.meta.dirname, "fixtures", "scanJavascriptFile"); test("should have no warning and no minified file", async() => { const thirdPartyDependencies = ["mocha", "yolo"]; diff --git a/workspaces/tarball/test/SourceCodeScanner.spec.ts b/workspaces/tarball/test/SourceCodeScanner.spec.ts index 87ccc3d4..a92a3412 100644 --- a/workspaces/tarball/test/SourceCodeScanner.spec.ts +++ b/workspaces/tarball/test/SourceCodeScanner.spec.ts @@ -1,6 +1,5 @@ // Import Node.js Dependencies import path from "node:path"; -import { fileURLToPath } from "node:url"; import assert from "node:assert"; import { describe, test } from "node:test"; @@ -22,8 +21,7 @@ import { } from "../src/class/SourceCodeScanner.class.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "fixtures", "scanPackage"); +const kFixturePath = path.join(import.meta.dirname, "fixtures", "scanPackage"); describe("SourceCodeScanner", () => { test("iterate() should return empty report if we provide no files", async() => { diff --git a/workspaces/tarball/test/tarball/scanPackage.spec.ts b/workspaces/tarball/test/tarball/scanPackage.spec.ts index 5743839a..193ece42 100644 --- a/workspaces/tarball/test/tarball/scanPackage.spec.ts +++ b/workspaces/tarball/test/tarball/scanPackage.spec.ts @@ -1,6 +1,5 @@ // Import Node.js Dependencies import path from "node:path"; -import { fileURLToPath } from "node:url"; import { test } from "node:test"; import assert from "node:assert"; @@ -9,8 +8,7 @@ import { scanPackage } from "../../src/index.ts"; import { getEmptyPackageWarning } from "../../src/warnings.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "..", "fixtures", "scanPackage"); +const kFixturePath = path.join(import.meta.dirname, "..", "fixtures", "scanPackage"); test("scanPackage (caseone)", async() => { const result = await scanPackage( diff --git a/workspaces/tarball/test/utils/getTarballComposition.spec.ts b/workspaces/tarball/test/utils/getTarballComposition.spec.ts index eb18282e..239bfae9 100644 --- a/workspaces/tarball/test/utils/getTarballComposition.spec.ts +++ b/workspaces/tarball/test/utils/getTarballComposition.spec.ts @@ -1,7 +1,6 @@ // Import Node.js Dependencies import path from "node:path"; import assert from "node:assert"; -import { fileURLToPath } from "node:url"; import { test } from "node:test"; // Import Third-party Dependencies @@ -11,8 +10,7 @@ import getSize from "get-folder-size"; import { getTarballComposition } from "../../src/utils/index.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturePath = path.join(__dirname, "..", "fixtures", "getTarballComposition"); +const kFixturePath = path.join(import.meta.dirname, "..", "fixtures", "getTarballComposition"); test("should return the composition of a directory", async() => { const composition = await getTarballComposition(kFixturePath); diff --git a/workspaces/tree-walker/test/npm/LocalDependencyTreeLoader.spec.ts b/workspaces/tree-walker/test/npm/LocalDependencyTreeLoader.spec.ts index d5dea65d..b1ff2f7b 100644 --- a/workspaces/tree-walker/test/npm/LocalDependencyTreeLoader.spec.ts +++ b/workspaces/tree-walker/test/npm/LocalDependencyTreeLoader.spec.ts @@ -5,7 +5,6 @@ import fs from "node:fs"; import os from "node:os"; import assert from "node:assert"; import { spawnSync } from "node:child_process"; -import { fileURLToPath } from "node:url"; // Import Internal Dependencies import { @@ -13,8 +12,7 @@ import { } from "../../src/npm/LocalDependencyTreeLoader.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturesDir = path.join(__dirname, "..", "fixtures"); +const kFixturesDir = path.join(import.meta.dirname, "..", "fixtures"); describe("LocalDependencyTreeLoader", () => { describe("arborist.loadVirtual()", () => { diff --git a/workspaces/tree-walker/test/npm/TreeWalker.spec.ts b/workspaces/tree-walker/test/npm/TreeWalker.spec.ts index cdf29c0f..73a9e160 100644 --- a/workspaces/tree-walker/test/npm/TreeWalker.spec.ts +++ b/workspaces/tree-walker/test/npm/TreeWalker.spec.ts @@ -1,6 +1,6 @@ // Import Node.js Dependencies import { describe, it, test } from "node:test"; -import { fileURLToPath, pathToFileURL } from "node:url"; +import { pathToFileURL } from "node:url"; import assert from "node:assert"; import path from "node:path"; @@ -12,8 +12,7 @@ import type { PackageJSON, WorkspacesPackageJSON } from "@nodesecure/npm-types"; import { npm, type DependencyJSON } from "../../src/index.ts"; // CONSTANTS -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const kFixturesDir = path.join(__dirname, "..", "fixtures"); +const kFixturesDir = path.join(import.meta.dirname, "..", "fixtures"); describe("npm.TreeWalker", () => { test("Given a fixed '@nodesecure/fs-walk' manifest then it must extract one root dependency", async() => { @@ -139,7 +138,7 @@ describe("npm.TreeWalker", () => { test(`Given the local scanner workspace as Manifest with maxDepth: 1 it must return all workspaces as Dependency and complete the manifest name and version with default values`, async() => { - const manifestLocation = path.join(__dirname, "..", "..", "..", "..", "package.json"); + const manifestLocation = path.join(import.meta.dirname, "..", "..", "..", "..", "package.json"); const manifest = ( await import(pathToFileURL(manifestLocation).href, { with: { type: "json" } }) diff --git a/workspaces/tree-walker/test/utils/mergeDependencies.spec.ts b/workspaces/tree-walker/test/utils/mergeDependencies.spec.ts index 76bf905a..c11544ce 100644 --- a/workspaces/tree-walker/test/utils/mergeDependencies.spec.ts +++ b/workspaces/tree-walker/test/utils/mergeDependencies.spec.ts @@ -1,8 +1,7 @@ // Import Node.js Dependencies -import { dirname, join } from "node:path"; +import { join } from "node:path"; import { readFileSync } from "node:fs"; import { test } from "node:test"; -import { fileURLToPath } from "node:url"; import assert from "node:assert"; // Import Third-party Dependencies @@ -12,8 +11,7 @@ import is from "@slimio/is"; import { mergeDependencies } from "../../src/utils/index.ts"; // CONSTANTS -const __dirname = dirname(fileURLToPath(import.meta.url)); -const kFixturePath = join(__dirname, "..", "fixtures/mergeDependencies"); +const kFixturePath = join(import.meta.dirname, "..", "fixtures/mergeDependencies"); // JSON PAYLOADS const one = JSON.parse(readFileSync(join(kFixturePath, "one.json"), "utf-8"));