lib/spark.js
function getDefPath(defPath) {
  // if path passed...
  if(defPath) {
    // if not url and not absolute...
    if(!/^https?:/.test(defPath) && !path.isAbsolute(defPath)) {
      // normalize path as relative to folder containing node_modules
      return path.normalize(path.join(__dirname, '/../../../', defPath));
    }

    // else, return unchanged...
    else {
      return defPath;
    }
  }

  // else, return defualt path...
  else {
    return path.normalize(path.join(__dirname, _swaggerDef));
  }
}
function getDefPath(defPath) {
  // if path passed...
  if(defPath) {
    // if not url and not absolute...
    if(!/^https?:/.test(defPath) && !path.isAbsolute(defPath)) {
      // normalize path as relative to folder containing node_modules
      return path.normalize(path.join(__dirname, '/../../../', defPath));
    }

    // else, return unchanged...
    else {
      return defPath;
    }
  }

  // else, return defualt path...
  else {
    return path.normalize(path.join(__dirname, _swaggerDef));
  }
}
function getDefPath ( defPath ) { // if path passed... if ( defPath ) { // if not url and not absolute... if ( ! / ^https?: / . test ( defPath ) && ! path . isAbsolute ( defPath ) ) { // normalize path as relative to folder containing node_modules return path . normalize ( path . join ( __dirname , '/../../../' , defPath ) ) ; } // else, return unchanged... else { return defPath ; } } // else, return defualt path... else { return path . normalize ( path . join ( __dirname , _swaggerDef ) ) ; } }
get full path for spark swagger definition file
get full path for spark swagger definition file