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

29
js/entity/Integer64Entity.js Executable file
View File

@@ -0,0 +1,29 @@
import IEntity from "./IEntity"
export default class Integer64Entity extends IEntity {
static attributes = {
...super.attributes,
value: {
value: 0n,
predicate: v => v >= -(1n << 63n) && v < 1n << 63n,
},
}
static {
this.cleanupAttributes(this.attributes)
}
constructor(value = 0) {
super(value)
/** @type {Number} */ this.value
}
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}