diff --git a/source/mijin/types/script_value.hpp b/source/mijin/types/script_value.hpp index 4144c67..f2e0bf5 100644 --- a/source/mijin/types/script_value.hpp +++ b/source/mijin/types/script_value.hpp @@ -85,6 +85,48 @@ public: std::partial_ordering operator<=>(const ScriptValue& other) const = default; + [[nodiscard]] + bool isUndefined() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isBool() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isInteger() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isFloat() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isString() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isArray() const noexcept + { + return std::holds_alternative(base_); + } + + [[nodiscard]] + bool isMap() const noexcept + { + return std::holds_alternative(base_); + } + template auto visit(TFunction&& function) const {