Use more more optional chaining in the src/ folder

This commit is contained in:
Jonas Jenwald 2026-07-29 18:23:14 +02:00
parent 4d9007e6f9
commit 1813ab0774
2 changed files with 7 additions and 12 deletions

View File

@ -190,11 +190,9 @@ class Builder {
if (hasNamespace) {
this._currentNamespace = this._namespaceStack.pop();
}
if (prefixes) {
prefixes.forEach(({ prefix }) => {
this._namespacePrefixes.get(prefix).pop();
});
}
prefixes?.forEach(({ prefix }) => {
this._namespacePrefixes.get(prefix).pop();
});
if (nsAgnostic) {
this._nsAgnosticLevel--;
}

View File

@ -43,13 +43,10 @@ class ProxyHandler {
}
set(obj, prop, value) {
if (obj._kidIds) {
// If the field is a container for other fields then
// dispatch the kids.
obj._kidIds.forEach(id => {
obj._appObjects[id].wrapped[prop] = value;
});
}
// If the field is a container for other fields then dispatch the kids.
obj._kidIds?.forEach(id => {
obj._appObjects[id].wrapped[prop] = value;
});
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
const old = obj[prop];