1234567891011121314151617181920212223242526272829303132 |
- 'use strict'
- var glob = require('glob')
- var path = require('path')
- function trueCasePathSync(fsPath) {
-
-
-
-
- var fsPathNormalized = path.normalize(fsPath)
-
-
- if (process.platform === 'darwin') fsPathNormalized = fsPathNormalized.normalize('NFD')
-
-
-
-
- var pathRoot = path.parse(fsPathNormalized).root
- var noDrivePath = fsPathNormalized.slice(Math.max(pathRoot.length - 1, 0))
-
-
-
-
- return glob.sync(noDrivePath, { nocase: true, cwd: pathRoot })[0]
- }
- module.exports = trueCasePathSync
|