Skip to content

Commit bf7b68f

Browse files
refactor: code
1 parent c53553c commit bf7b68f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/ResolverFactory.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
"use strict";
77

8-
const findPnpApi = require("module").findPnpApi;
98
const versions = require("process").versions;
109
const Resolver = require("./Resolver");
1110
const { getType, PathType } = require("./util/path");
@@ -126,13 +125,18 @@ function processPnpApiOption(option) {
126125
option === undefined &&
127126
/** @type {NodeJS.ProcessVersions & {pnp: string}} */ versions.pnp
128127
) {
129-
const _findPnpApi = /** @type {function(string): PnpApi | null}} */ (
130-
findPnpApi
131-
);
128+
const _findPnpApi =
129+
/** @type {function(string): PnpApi | null}} */
130+
(
131+
// @ts-ignore
132+
require("module").findPnpApi
133+
);
134+
132135
if (_findPnpApi) {
133136
return {
134137
resolveToUnqualified(request, issuer, opts) {
135138
const pnpapi = _findPnpApi(issuer);
139+
136140
if (!pnpapi) {
137141
// Issuer isn't managed by PnP
138142
return null;

0 commit comments

Comments
 (0)