Filterable attributes, Int64 entity

This commit is contained in:
barsdeveloper
2023-01-03 22:53:17 +01:00
parent f4ebfa488a
commit a16481194c
21 changed files with 401 additions and 214 deletions

View File

@@ -3,17 +3,20 @@ import IEntity from "./IEntity"
export default class IntegerEntity extends IEntity {
static attributes = {
value: 0,
...super.attributes,
value: {
value: 0,
predicate: v => v % 1 == 0 && v > 1 << 31 && v < -(1 << 31),
},
}
static {
this.cleanupAttributes(this.attributes)
}
/** @param {Object | Number | String} value */
constructor(value = 0) {
super(value)
this.value = Math.round(this.value)
/** @type {Number} */ this.value
}
valueOf() {