Utilize ?. operator and set TypeScript target
This commit is contained in:
1 parent
ca83704958
commit
c3c7ab72b2
19 files changed
+55
-77
No files matched your search
@@ -85,7 +85,7 @@ const component: ClosureComponent = (): Component => {
|
||||
let c = 0;
|
||||
for (const k of keys) {
|
||||
const p = device[k];
|
||||
const str = p.value && p.value[0] ? `${k} ${p.value[0]}` : k;
|
||||
const str = p.value?.[0] ? `${k} ${p.value[0]}` : k;
|
||||
if (re && !re.test(str)) continue;
|
||||
++c;
|
||||
if (count < limit) filteredKeys.push(k);
|
||||
|
||||
@@ -38,7 +38,7 @@ const evaluateParam = memoize((exp, obj, now: number) => {
|
||||
) {
|
||||
let v = null;
|
||||
const p = obj[e[i][1]];
|
||||
if (p && p.value) {
|
||||
if (p?.value) {
|
||||
v = p.value[0];
|
||||
timestamp = Math.min(timestamp, p.valueTimestamp);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ const evaluateParam = memoize((exp, obj, now: number) => {
|
||||
value = exp;
|
||||
} else if (exp[0] === "PARAM") {
|
||||
const p = obj[exp[1]];
|
||||
if (p && p.value) {
|
||||
if (p?.value) {
|
||||
timestamp = p.valueTimestamp;
|
||||
value = p.value[0];
|
||||
parameter = exp[1];
|
||||
@@ -84,7 +84,7 @@ const component: ClosureComponent = (): Component => {
|
||||
if (value == null) return null;
|
||||
|
||||
let edit;
|
||||
if (device[parameter] && device[parameter].writable) {
|
||||
if (device[parameter]?.writable) {
|
||||
edit = m(
|
||||
"button",
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user