aboutsummaryrefslogtreecommitdiff
path: root/src/platform/web/JsUtility.cpp
blob: b426bbda17d997b5325afd9e89b9feedea7c8060 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "cru/platform/web/JsUtility.h"

namespace cru::platform::web {
bool IsNotNullAndInstanceOf(const emscripten::val& value, const emscripten::val& type) {
  return !value.isNull() && !type.isNull() && value.instanceof(type);
}

bool IsNotNullAndInstanceOf(const emscripten::val& value, const char* global_type) {
  return IsNotNullAndInstanceOf(value, emscripten::val::global(global_type));
}
}