mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-25 04:48:22 -08:00
utils.type: Add is_boolean(), is_REField(), is_REMethodDefinition()
This commit is contained in:
@@ -44,6 +44,7 @@ local unicode_chars;
|
|||||||
local epsilon = 0.000001;
|
local epsilon = 0.000001;
|
||||||
|
|
||||||
this.table = {};
|
this.table = {};
|
||||||
|
this.type = {};
|
||||||
this.number = {};
|
this.number = {};
|
||||||
this.string = {};
|
this.string = {};
|
||||||
this.vec2 = {};
|
this.vec2 = {};
|
||||||
@@ -215,6 +216,18 @@ function this.table.merge(...)
|
|||||||
return result;
|
return result;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.type.is_boolean(value)
|
||||||
|
return value == true or value == false;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.type.is_REField(value)
|
||||||
|
return value.get_return_type == nil;
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.type.is_REMethodDefinition(value)
|
||||||
|
return value.get_return_type ~= nil;
|
||||||
|
end
|
||||||
|
|
||||||
function this.number.is_NaN(value)
|
function this.number.is_NaN(value)
|
||||||
return tostring(value) == tostring(0/0);
|
return tostring(value) == tostring(0/0);
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user