Code coverage report for lib/util/normalizePath.js

Statements: 100% (10 / 10)      Branches: 100% (4 / 4)      Functions: 100% (1 / 1)      Lines: 100% (10 / 10)      Ignored: none     

All files » lib/util/ » normalizePath.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 1 1 1   1 282 282 204 204   78      
var rmExt = require('./rmExt');
var fixPathSep = require('./fixPathSep');
var path = require('path');
var isAddon = require('./isAddon');
 
module.exports = function(pathName, options) {
  pathName = /\.hbs$/i.test(pathName) ? fixPathSep(pathName) : rmExt(pathName);
  if (isAddon(pathName)) {
    pathName = pathName.replace('ember-addon:', '');
    return path.relative(path.resolve(options.rootPath), pathName);
  } else {
    return './' + pathName;
  }
}