More tests and fixed

This commit is contained in:
barsdeveloper
2024-06-03 12:42:42 +02:00
parent 8fed17b20f
commit 1a8636bb5d
18 changed files with 484 additions and 433 deletions

View File

@@ -24,6 +24,9 @@ export default class IEntity {
/** @type {P<IEntity>} */
static grammar = /** @type {any} */(P.failure())
/** @type {P<IEntity>} */
static unknownEntityGrammar
/** @type {{ [key: String]: typeof IEntity }} */
static attributes = {}
@@ -38,6 +41,14 @@ export default class IEntity {
static silent = false // Do not serialize if default
static trailing = false // Add attribute separator after the last attribute when serializing
#trailing = this.Self().trailing
get trailing() {
return this.#trailing
}
set trailing(value) {
this.#trailing = value
}
/** @type {String | String[]} */
static lookbehind = ""
@@ -180,16 +191,6 @@ export default class IEntity {
return result
}
/**
* @template {typeof IEntity} T
* @this {T}
*/
static flagTrailing(value = true) {
const result = this.asUniqueClass()
result.trailing = value
return result
}
/**
* @template {typeof IEntity} T
* @this {InstanceType<T>}