(request, includeAbsolutePaths)
| 6 | ); |
| 7 | |
| 8 | function getModuleName(request, includeAbsolutePaths) { |
| 9 | let req = request; |
| 10 | const delimiter = '/'; |
| 11 | |
| 12 | if (includeAbsolutePaths) { |
| 13 | req = req.replace(/^.*?\/node_modules\//, ''); |
| 14 | } |
| 15 | // check if scoped module |
| 16 | if (scopedModuleRegex.test(req)) { |
| 17 | // reset regexp |
| 18 | scopedModuleRegex.lastIndex = 0; |
| 19 | return req.split(delimiter, 2).join(delimiter); |
| 20 | } |
| 21 | return req.split(delimiter)[0]; |
| 22 | } |
| 23 | |
| 24 | module.exports = function nodeExternals(options) { |
| 25 | options = options || {}; |
no outgoing calls
no test coverage detected
searching dependent graphs…