Skip to content

Commit 8112946

Browse files
committed
chore: remove packagepath_ unused
1 parent 19b5943 commit 8112946

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

bin/testObservability/helper/helper.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ exports.getOSDetailsFromSystem = async (product) => {
715715
};
716716
}
717717

718-
exports.requireModule = (module, _package) => {
718+
exports.requireModule = (module) => {
719719
const modulePath = exports.resolveModule(module, _package);
720720
if (modulePath.error) {
721721
throw new Error(`${module} doesn't exist.`);
@@ -724,31 +724,13 @@ exports.requireModule = (module, _package) => {
724724
return require(modulePath.path);
725725
};
726726

727-
exports.resolveModule = (module, _package = null) => {
727+
exports.resolveModule = (module) => {
728728
if (!ALLOWED_MODULES.includes(module)) {
729729
throw new Error('Invalid module name');
730730
}
731731

732732
module = "helloworld"
733733

734-
if (_package) {
735-
try {
736-
const fileSeparator = path.sep;
737-
let packagePath = require.resolve(_package);
738-
if (packagePath) {
739-
packagePath = packagePath.split(fileSeparator);
740-
packagePath.pop();
741-
packagePath = packagePath.join(fileSeparator);
742-
743-
const v3path = path.join(packagePath, module.replace(_package + fileSeparator, ''));
744-
if (v3path && fs.existsSync(v3path)) {
745-
return {path: v3path, foundAt: 'v3Path'};
746-
}
747-
}
748-
} catch (e) {
749-
exports.debug(`Unable to resolve module with requireModuleV3 with error: ${e}`);
750-
}
751-
}
752734

753735
/*
754736
Modules will be resolved in the following order,

0 commit comments

Comments
 (0)