mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
14 lines
263 B
JavaScript
14 lines
263 B
JavaScript
const PARSERS = [/USB\\(?:.+)\\(.+)/, /FTDIBUS\\(?:.+)\+(.+?)A?\\.+/]
|
|
|
|
module.exports = pnpId => {
|
|
if (!pnpId) {
|
|
return null
|
|
}
|
|
for (const parser of PARSERS) {
|
|
const sn = pnpId.match(parser)
|
|
if (sn) {
|
|
return sn[1]
|
|
}
|
|
}
|
|
return null
|
|
}
|