1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-04 20:53:57 +00:00
Funkin/source/funkin/data/DataWrite.hx

18 lines
460 B
Haxe
Raw Normal View History

2023-09-08 21:45:47 +00:00
package funkin.data;
import funkin.util.SerializerUtil;
2023-09-08 21:45:47 +00:00
/**
* `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);
}
}