aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-11-14 15:55:50 (UTC)
committerjan <jan@ruken.pw>2016-11-14 15:55:50 (UTC)
commitc735553214400f3af69e516ff41a6da9214449a7 (patch)
treec9a8e8fc84fdbaffb3a3fa318453b36270550ebb /frontend
parent9832cd28de49421021ed7c1f3caa7fdda7bc4372 (diff)
likes und so.
Diffstat (limited to 'frontend')
-rw-r--r--frontend/renderer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend/renderer.go b/frontend/renderer.go
index d529dff..9c1f7a7 100644
--- a/frontend/renderer.go
+++ b/frontend/renderer.go
@@ -65,6 +65,15 @@ func New(path string, functions map[string]interface{}) *Renderer {
65 "makeRangePair": func(idx int, value interface{}) RangePair { 65 "makeRangePair": func(idx int, value interface{}) RangePair {
66 return RangePair{idx, value} 66 return RangePair{idx, value}
67 }, 67 },
68 "map": func(values ...interface{}) map[string]interface{} {
69 m := make(map[string]interface{}, len(values)/2)
70 for i := 0; i < len(values); i += 2 {
71 key, _ := values[i].(string)
72 m[key] = values[i+1]
73 }
74
75 return m
76 },
68 "makeObject": func(name string, existing interface{}, newKey string, newData interface{}) map[string]interface{} { 77 "makeObject": func(name string, existing interface{}, newKey string, newData interface{}) map[string]interface{} {
69 d := make(map[string]interface{}) 78 d := make(map[string]interface{})
70 d[name] = existing 79 d[name] = existing