mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 16:17:53 -05:00
17 lines
460 B
Haxe
17 lines
460 B
Haxe
package funkin.data;
|
|
|
|
import funkin.util.SerializerUtil;
|
|
|
|
/**
|
|
* `json2object` has an annotation `@:jcustomwrite` which allows for custom serialization of values to be written to JSON.
|
|
*
|
|
* Functions must be of the signature `(T) -> String`, where `T` is the type of the property.
|
|
*/
|
|
class DataWrite
|
|
{
|
|
public static function dynamicValue(value:Dynamic):String
|
|
{
|
|
// Is this cheating? Yes. Do I care? No.
|
|
return SerializerUtil.toJSON(value);
|
|
}
|
|
}
|