Improve autocomplete and a few other changes

This commit is contained in:
Jan Oberhauser
2021-12-23 11:41:46 +01:00
parent 27f696ad27
commit fa760ee26b
9 changed files with 246 additions and 41 deletions

View File

@@ -92,6 +92,12 @@ export class WorkflowDataProxy {
return Reflect.ownKeys(target);
},
getOwnPropertyDescriptor(k) {
return {
enumerable: true,
configurable: true,
};
},
get(target, name, receiver) {
// eslint-disable-next-line no-param-reassign
name = name.toString();
@@ -142,6 +148,12 @@ export class WorkflowDataProxy {
ownKeys(target) {
return Reflect.ownKeys(target);
},
getOwnPropertyDescriptor(k) {
return {
enumerable: true,
configurable: true,
};
},
get(target, name, receiver) {
name = name.toString();
@@ -385,6 +397,15 @@ export class WorkflowDataProxy {
return new Proxy(
{},
{
ownKeys(target) {
return allowedValues;
},
getOwnPropertyDescriptor(k) {
return {
enumerable: true,
configurable: true,
};
},
get(target, name, receiver) {
if (!allowedValues.includes(name.toString())) {
throw new Error(`The key "${name.toString()}" is not supported!`);