View source

class thx.Dynamics

Available on all platforms

Dynamics provides additional extension methods on any type.

Class Fields

static function clone(v:Dynamic, cloneInstances:Bool = false):Dynamic

Clone the object.

Null values, strings, dates, numbers, enums and functions are immutable so will be returned as is. Anonymous objects will be created and each field cloned recursively. Arrays will be recreated and each object cloned recursively. Class instances will either be cloned, or the reference copied, depending on the value of cloneInstances.

Parameters:
v

The object which will be cloned.

cloneInstances

If true, class instances will be cloned using Type.createEmptyInstance and Reflect.setField. If false, class instances will be re-used, not cloned. Default is false.

static function compare(a:Dynamic, b:Dynamic):Int

Compares two runtime values trying to match values.

static function equals<T1, T2>(a:T1, b:T2):Bool

Structural and recursive equality.

static function string(v:Dynamic):String

Convert any value into a String.

Toggle inherited fields