mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-23 20:08:05 -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;
|
||||
|
||||
this.table = {};
|
||||
this.type = {};
|
||||
this.number = {};
|
||||
this.string = {};
|
||||
this.vec2 = {};
|
||||
@@ -215,6 +216,18 @@ function this.table.merge(...)
|
||||
return result;
|
||||
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)
|
||||
return tostring(value) == tostring(0/0);
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user