'use strict';

function getDriverFunction(driver, name) {
  try {
    // eslint-disable-next-line import/no-dynamic-require
    return require(`../driver/${driver}/${name}`);
  } catch (e) {
    throw new Error(`driver not found: ${driver}`);
  }
}

module.exports = getDriverFunction;

@@ -8,16 +8,47 @@
 rict';%0A%0A
+const path = require('path');%0A%0A
 function
@@ -82,16 +82,99 @@
 name) %7B%0A
+  if (!path.isAbsolute(driver)) %7B%0A    driver = path.join('../driver', driver);%0A  %7D%0A
   try %7B%0A
@@ -254,37 +254,31 @@
 ire(
-%60../driver/$%7B
+path.join(
 driver
-%7D/$%7B
+, 
 name
-%7D%60
+)
 );%0A 

allow absolute path for driver