optimizations
Some checks failed
Build / build (push) Successful in 10m47s
Publish Image / publish (push) Failing after 33s
Test / build (push) Failing after 6m42s

This commit is contained in:
Chuck Smith
2024-04-02 14:54:08 -04:00
parent 88e3330856
commit f08b458325
9 changed files with 313 additions and 355 deletions

View File

@@ -95,3 +95,21 @@ func AssertTypes(obj Object, types ...Type) bool {
}
return false
}
func FromNativeBoolean(b bool) Boolean {
if b {
return TRUE
}
return FALSE
}
func IsTruthy(obj Object) bool {
switch obj := obj.(type) {
case Boolean:
return obj.Value
case Null:
return false
default:
return true
}
}