mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-17 19:03:27 +08:00
Moving node and pins information to Configuration
This commit is contained in:
@@ -19,6 +19,7 @@ import Utility from "../Utility"
|
||||
* nullable?: Boolean,
|
||||
* ignored?: Boolean,
|
||||
* serialized?: Boolean,
|
||||
* expected?: Boolean,
|
||||
* predicate?: (value: AnyValue) => Boolean,
|
||||
* }} AttributeInformation
|
||||
*/
|
||||
@@ -38,6 +39,7 @@ export default class IEntity {
|
||||
nullable: false,
|
||||
ignored: false,
|
||||
serialized: false,
|
||||
expected: false,
|
||||
}
|
||||
|
||||
constructor(values = {}, suppressWarns = false) {
|
||||
@@ -222,6 +224,12 @@ export default class IEntity {
|
||||
return value != null && (value instanceof type || value.constructor === type)
|
||||
}
|
||||
|
||||
static expectsAllKeys() {
|
||||
return !Object.values(this.attributes)
|
||||
.filter(/** @param {AttributeInformation} attribute */attribute => !attribute.ignored)
|
||||
.some(/** @param {AttributeInformation} attribute */attribute => !attribute.expected)
|
||||
}
|
||||
|
||||
unexpectedKeys() {
|
||||
return Object.keys(this).length
|
||||
- Object.keys(/** @type {typeof IEntity} */(this.constructor).attributes).length
|
||||
|
||||
Reference in New Issue
Block a user