feat: allow using String.prototype.includes in item effect filters

This commit is contained in:
Johannes Loher 2023-09-16 10:54:40 +02:00
parent f4585f4254
commit 978301eab1
No known key found for this signature in database
GPG key ID: 7CB0A9FB553DA045
2 changed files with 11 additions and 4 deletions

View file

@ -19,7 +19,7 @@ export class Evaluator<Context extends object> {
get: (t, k) => (k === Symbol.unscopables ? undefined : t[k as keyof typeof t]),
});
actualPredicate = (identifier: string) =>
predicate(identifier) || Object.getOwnPropertyNames(Math).includes(identifier);
predicate(identifier) || Object.getOwnPropertyNames(context).includes(identifier);
}
this.validator = new Validator(actualPredicate);
}