Fixes and Utility test added

This commit is contained in:
barsdeveloper
2023-01-04 15:53:51 +01:00
parent 6230da391f
commit f59217ffd9
9 changed files with 277 additions and 81 deletions

View File

@@ -121,9 +121,15 @@ export default class IEntity {
return this["#" + attributeName]
},
set(v) {
if (attribute.predicate(v)) {
this["#" + attributeName] = v
if (!attribute.predicate?.(v)) {
console.warn(
`UEBlueprint: Tried to assign attribute ${prefix}${attributeName} to `
+ `${this.constructor.name} not satisfying the predicate`
)
return
}
this["#" + attributeName] = v
}
},
})