You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
463 B
JavaScript
18 lines
463 B
JavaScript
8 months ago
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.serialNumParser = void 0;
|
||
|
const PARSERS = [/USB\\(?:.+)\\(.+)/, /FTDIBUS\\(?:.+)\+(.+?)A?\\.+/];
|
||
|
const serialNumParser = (pnpId) => {
|
||
|
if (!pnpId) {
|
||
|
return null;
|
||
|
}
|
||
|
for (const parser of PARSERS) {
|
||
|
const sn = pnpId.match(parser);
|
||
|
if (sn) {
|
||
|
return sn[1];
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
};
|
||
|
exports.serialNumParser = serialNumParser;
|