diff modules/array.tp @ 271:bb4723fec05e

Support for encoding objects, dictionaries, lists and arrays to JSON in json module
author Michael Pavone <pavone@retrodev.com>
date Sat, 19 Jul 2014 19:59:51 -0700
parents 56409de95f55
children fb54a3af9c86
line wrap: on
line diff
--- a/modules/array.tp	Fri Jul 18 20:45:50 2014 -0700
+++ b/modules/array.tp	Sat Jul 19 19:59:51 2014 -0700
@@ -144,4 +144,9 @@
 			""
 		}
 	}
+
+	jsonEncode <- {
+		parts <- map: :el { json encode: el }
+		"[" . (parts join: ",") . "]"
+	}
 }