fix hex parsing
This commit is contained in:
@@ -181,9 +181,11 @@ export function parseNumber(s: string): number {
|
||||
if (/^\$[0-9A-Fa-f]+$/.test(s)) {
|
||||
return parseInt(s.slice(1), 16)
|
||||
}
|
||||
const hex = parseHex(s);
|
||||
if (!isNaN(hex)) {
|
||||
return hex;
|
||||
if (/[a-fA-F]/.test(s)) {
|
||||
const hex = parseHex(s);
|
||||
if (!isNaN(hex)) {
|
||||
return hex;
|
||||
}
|
||||
}
|
||||
return parseFloat(s);
|
||||
}
|
||||
@@ -204,9 +206,11 @@ export function parseIntWithHexOrBinary(s: string): number {
|
||||
if (/^\$[0-9A-Fa-f]+$/.test(s)) {
|
||||
return parseInt(s.slice(1), 16)
|
||||
}
|
||||
const hex = parseHex(s);
|
||||
if (!isNaN(hex)) {
|
||||
return hex;
|
||||
if (/[a-fA-F]/.test(s)) {
|
||||
const hex = parseHex(s);
|
||||
if (!isNaN(hex)) {
|
||||
return hex;
|
||||
}
|
||||
}
|
||||
return parseInt(s);
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ export class VMDeviceList extends BaseElement {
|
||||
protected render(): HTMLTemplateResult {
|
||||
const deviceCards: HTMLTemplateResult[] = this.filteredDeviceIds.map(
|
||||
(id, _index, _ids) =>
|
||||
html`< vm - device - card.deviceID=${ id } class="device-list-card" > </vm-device-card>`,
|
||||
html`<vm-device-card .deviceID=${id} class="device-list-card" > </vm-device-card>`,
|
||||
);
|
||||
const result = html`
|
||||
<div class="header">
|
||||
|
||||
Reference in New Issue
Block a user