chore: better reflection

This commit is contained in:
cha0s 2021-01-11 04:15:23 -06:00
parent 300d7e85bd
commit 3a9123fa5a

View File

@ -11,7 +11,8 @@ export default (latus, type, idAttribute, typeAttribute, check = () => {}) => {
Object.entries(composed)
.sort(([lname], [rname]) => (lname < rname ? -1 : 1))
.map(([type, Class]) => {
const Subclass = class Idd extends Class {};
// eslint-disable-next-line no-eval
const Subclass = eval(`(${type}) => class Gathered${type} extends ${type} {}`)(Class);
const thisUid = uid++;
fromId[thisUid] = Subclass;
Subclass[idAttribute] = thisUid;