| Server IP : 107.13.46.68 / Your IP : 216.73.216.232 Web Server : Apache/2.4.58 (Ubuntu) System : Linux mariOS 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/nodejs/require-package-name/ |
Upload File : |
var scopePattern = /^(?:(@[^/]+)[/]+)([^/]+)[/]?/
var basePattern = /^([^/]+)[/]?/
module.exports = extract.bind(null, false)
module.exports.base = extract.bind(null, true)
function extract(isBase, str) {
if (/^@/.test(str)) {
var match = scopePattern.exec(str)
if (!match || !match[1] || !match[2])
return null
if (isBase)
return match[2] || null
return [ match[1], match[2] ].join('/')
} else {
var match = basePattern.exec(str)
if (!match)
return null
return match[1] || null
}
}