View source

class thx.Types

Available on all platforms

Helper methods to use on values, types and classes.

Class Fields

static inline function anyValueToString(value:Dynamic):String

Returns a string describing the type of any value.

static function hasSuperClass(cls:Class<Dynamic>, sup:Class<Dynamic>):Bool

Returns true if cls extends sup or one of its children.

It also returns true if cls and sup are the same.

static inline function isAnonymousObject(v:Dynamic):Bool

isAnonymousObject returns true if v is an object and it is not an instance of any custom class.

static function isPrimitive(v:Dynamic):Bool

Return true if v is any of the following types: Int, Float, Bool or String.

static function sameType<A, B>(a:A, b:B):Bool

sameType returns true if the arguments a and b share exactly the same type.

static function toString(type:ValueType):String

Returns a string representation of a ValueType.

static function typeInheritance(type:ValueType):Array<String>

typeInheritance returns an array of string describing the entire inheritance chain of the passed ValueType.

static inline function valueTypeInheritance<T>(value:T):Array<String>

valueTypeInheritance returns an array of string describing the entire inheritance chain of the passed value.

static inline function valueTypeToString<T>(value:T):String

Returns a string describing the type of any value.

Toggle inherited fields