Files
meteor/lib/util/meta/getRelativePath.js
2015-10-29 17:37:28 +01:00

17 lines
405 B
JavaScript

import stripPathPrefix from './stripPathPrefix'
const getRootPath = require('./getRootPath')
export default function getRelativePath (filename) {
// '<input>' is ESLint's default filename when the real one is not known
if (filename === '<input>') {
return false
}
const rootPath = getRootPath(filename)
if (!rootPath) {
return false
}
return stripPathPrefix(rootPath, filename)
}