mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 14:24:47 +08:00
Fix Function reference
This commit is contained in:
@@ -212,34 +212,6 @@ export default class Utility {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* @template {Attribute | AttributeTypeDescription} T
|
||||
* @param {T} value
|
||||
* @returns {AttributeConstructor<T>}
|
||||
*/
|
||||
static getType(value) {
|
||||
if (value === null) {
|
||||
return null
|
||||
}
|
||||
if (value?.constructor === Object && /** @type {AttributeInformation} */(value)?.type instanceof Function) {
|
||||
return /** @type {AttributeInformation} */(value).type
|
||||
}
|
||||
return /** @type {AttributeConstructor<any>} */(value?.constructor)
|
||||
}
|
||||
|
||||
/**
|
||||
* @template {Attribute} V
|
||||
* @template {AttributeConstructor<V>} C
|
||||
* @param {C} type
|
||||
* @returns {value is InstanceType<C>}
|
||||
*/
|
||||
static isValueOfType(value, type, acceptNull = false) {
|
||||
if (type instanceof MirroredEntity) {
|
||||
type = type.getTargetType()
|
||||
}
|
||||
return (acceptNull && value === null) || value instanceof type || value?.constructor === type
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number} x
|
||||
* @param {Number} y
|
||||
|
||||
Reference in New Issue
Block a user