(descriptor)
| 54 | } |
| 55 | |
| 56 | function normalizePkgDescriptor (descriptor) { |
| 57 | var path, main; |
| 58 | |
| 59 | path = descriptor.path = removeEndSlash(descriptor['path'] || descriptor['location'] || ''); |
| 60 | main = descriptor['main'] || 'main'; |
| 61 | descriptor.config = descriptor['config']; |
| 62 | descriptor.main = main.charAt(0) == '.' ? |
| 63 | // reduceLeadingDots expects a module id, not a path, so we add an |
| 64 | // extra slash to fool reduceLeadingDots: |
| 65 | removeEndSlash(reduceLeadingDots(main, path + '/')) : |
| 66 | joinPath(path, main); |
| 67 | |
| 68 | return descriptor; |
| 69 | } |
| 70 | |
| 71 | function joinPath (path, file) { |
| 72 | return removeEndSlash(path) + '/' + file; |
no test coverage detected