egg-born-mparse
Advanced tools
Comparing version 2.1.2 to 2.1.5
@@ -47,12 +47,26 @@ /******/ (() => { // webpackBootstrap | ||
parseInfo: function parseInfo(moduleName) { | ||
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'module'; | ||
if (!moduleName) return null; | ||
if (moduleName.indexOf('://') > -1) return null; | ||
if (moduleName.charAt(0) === '/') moduleName = moduleName.substr(1); | ||
var parts = moduleName.split('/'); | ||
var parts = moduleName.split('/').filter(function (item) { | ||
return item; | ||
}); | ||
if (parts.length < 2) { | ||
parts = moduleName.split('-'); | ||
parts = moduleName.split('-').filter(function (item) { | ||
return item; | ||
}); | ||
if (parts.length < 2) return null; | ||
} | ||
if (type === 'suite') { | ||
return { | ||
pid: parts[0], | ||
name: parts[1], | ||
fullName: "egg-born-suite-".concat(parts[0], "-").concat(parts[1]), | ||
relativeName: "".concat(parts[0], "-").concat(parts[1]) | ||
}; | ||
} | ||
return { | ||
@@ -59,0 +73,0 @@ pid: parts[0], |
{ | ||
"name": "egg-born-mparse", | ||
"version": "2.1.2", | ||
"version": "2.1.5", | ||
"description": "egg-born-mparse", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"homepage": "https://github.com/zhennann/egg-born-mparse#readme", | ||
"gitHead": "24263163d7c74f884c1e2d46a6202d8f75334d09" | ||
"gitHead": "f717f101dd6e60cf4e4c6f4084e4af8326c46eae" | ||
} |
@@ -9,11 +9,19 @@ const PREFIX_A = '/api/'; | ||
// first check / then - | ||
parseInfo(moduleName) { | ||
parseInfo(moduleName, type = 'module') { | ||
if (!moduleName) return null; | ||
if (moduleName.indexOf('://') > -1) return null; | ||
if (moduleName.charAt(0) === '/') moduleName = moduleName.substr(1); | ||
let parts = moduleName.split('/'); | ||
let parts = moduleName.split('/').filter(item => item); | ||
if (parts.length < 2) { | ||
parts = moduleName.split('-'); | ||
parts = moduleName.split('-').filter(item => item); | ||
if (parts.length < 2) return null; | ||
} | ||
if (type === 'suite') { | ||
return { | ||
pid: parts[0], | ||
name: parts[1], | ||
fullName: `egg-born-suite-${parts[0]}-${parts[1]}`, | ||
relativeName: `${parts[0]}-${parts[1]}`, | ||
}; | ||
} | ||
return { | ||
@@ -20,0 +28,0 @@ pid: parts[0], |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20302
395