json-templater
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "json-templater", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Simple json/js object template strings", | ||
@@ -5,0 +5,0 @@ "main": "template.js", |
@@ -66,2 +66,8 @@ suite('string', function() { | ||
verify( | ||
'dots as key names', | ||
['{{woot.bar.baz}}', { 'woot.bar.baz': 'yup' }], | ||
'yup' | ||
); | ||
verify( | ||
'array view', | ||
@@ -68,0 +74,0 @@ [ |
@@ -23,2 +23,5 @@ /** | ||
function extractValue(path, view) { | ||
// Short circuit for direct matches. | ||
if (view && view[path]) return view[path]; | ||
var parts = path.split('.'); | ||
@@ -25,0 +28,0 @@ |
9700
292