Utilize ?. operator and set TypeScript target

This commit is contained in:
Zaid Abdulla committed 2021-09-16 13:27:37 -07:00
1 parent ca83704958
commit c3c7ab72b2
19 files changed
+55 -77

No files matched your search

+2 -2
View File
@@ -131,7 +131,7 @@ async function fetchPresets(): Promise<Preset[]> {
// If no keys are defined, consider all parameters as keys to keep the
// same behavior from v1.0
if (!obj["_keys"] || !obj["_keys"].length)
if (!obj["_keys"]?.length)
obj["_keys"] = Object.keys(obj).filter((k) => !k.startsWith("_"));
return obj;
@@ -499,7 +499,7 @@ export function getConfig(
if (!(key in snapshot.config)) {
if (key in oldOpts) {
let id;
if (context && context["id"]) {
if (context?.["id"]) {
id = context["id"];
} else if (cb) {
id = cb(["PARAM", "DeviceID.ID"]);