fix JsonMap alphabetization

This commit is contained in:
2023-08-24 15:09:54 -06:00
parent ac3a8ba895
commit 2d812e7ccd
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import haxe.Json;
import haxe.DynamicAccess;
import sys.io.File;
import sys.FileSystem;
using StringTools;
typedef Jsonable<T> = {
function stringify():String;

View File

@@ -13,7 +13,7 @@
(json.split "\n")]
(lines.shift) // {
(lines.pop) // }
(+ "{\n" (.join (sort lines) "\n") "\n}")))
(+ "{\n" (.join (sort (for line lines (if (line.endsWith ",") (substr line 0 -1) line))) ",\n") "\n}")))
(defNew [&prop :String jsonPath &prop :T defaultVal]
[:Map<String,T> m (new Map)]