Skip to content

Commit

Permalink
refactor: rename flag
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Nov 13, 2023
1 parent 94624d8 commit 7ade461
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {nodeUtils} from '@yarnpkg/core';
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
import {HAS_LOADER_CHAINING} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
import {pathToFileURL} from 'url';
import {nodeUtils} from '@yarnpkg/core';
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
import {HAS_LOADERS_AFFECTING_LOADERS} from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
import {pathToFileURL} from 'url';

const ifAtLeastNode21It = nodeUtils.major >= 21 ? it : it.skip;
const ifAtMostNode20It = nodeUtils.major <= 20 ? it : it.skip;
Expand Down Expand Up @@ -779,7 +779,7 @@ describe(`Plug'n'Play - ESM`, () => {
);

// Tests /packages/yarnpkg-pnp/sources/esm-loader/fspatch.ts
(HAS_LOADER_CHAINING ? it : it.skip)(
(HAS_LOADERS_AFFECTING_LOADERS ? it : it.skip)(
`should support loaders importing named exports from commonjs files`,
makeTemporaryEnv(
{
Expand Down
3 changes: 2 additions & 1 deletion packages/yarnpkg-pnp/sources/esm-loader/loaderFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || (major === 19 && min
export const HAS_LAZY_LOADED_TRANSLATORS = (major === 20 && minor < 6) || (major === 19 && minor >= 3);

// https://github.com/nodejs/node/pull/43772
export const HAS_LOADER_CHAINING = major > 19 || (major === 19 && minor >= 6);
// TODO: Update the version range if it gets backported to v18.
export const HAS_LOADERS_AFFECTING_LOADERS = major > 19 || (major === 19 && minor >= 6);

0 comments on commit 7ade461

Please sign in to comment.