Permalink
Browse files

added property that indicates if a map should be converted to an arra…

…y, TODO: actually convert map to array
  • Loading branch information...
1 parent ff2e8ae commit abd6d7ca24cca1acf4dd2008af57a32e7518da7d @joelvh committed Jan 11, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/ObjectTemplate.coffee
  2. +3 −0 lib/TemplateConfig.coffee
@@ -105,7 +105,7 @@ class ObjectTemplate
updateContext: (context, node, value, key) =>
# format key and value
formatted = @config.applyFormatting node, value, key
- @aggregateValue(context, formatted.key, formatted.value)
+ @aggregateValue context, formatted.key, formatted.value
aggregateValue: (context, key, value) =>
return context if !value?
@@ -14,6 +14,9 @@ class TemplateConfig
# create settings
@arrayToMap = !!config.key
+ # TODO: Need to implement converting a map to an array...
+ # This property was created to show how to specify converting maps to arrays
+ @mapToArray = !@arrayToMap and config.key is false and !config.as
@directMap = !!(@arrayToMap and config.value)
@nestTemplate = !!config.nested
@includeAll = !!config.all

0 comments on commit abd6d7c

Please sign in to comment.