config-templator
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -49,2 +49,3 @@ 'use strict'; | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-release'); | ||
@@ -51,0 +52,0 @@ // Default task. |
@@ -21,2 +21,8 @@ /* | ||
var cleanValue = function (value) { | ||
if (value == 'false') value = false; | ||
else if (value == 'true') value = true; | ||
return value; | ||
}; | ||
var processRaw = function (raw, origin) { | ||
@@ -42,3 +48,3 @@ if (!origin) { | ||
if (matches) { | ||
result = namespace.get(origin, matches[1]); | ||
result = cleanValue(namespace.get(origin, matches[1])); | ||
// If the result retrieved from the data wasn't null or undefined, | ||
@@ -53,7 +59,7 @@ // return it. | ||
// If the replacment would not be catch by the simple RegExp above, try with EJS. | ||
var transformed = ejs.render(value, origin); | ||
var transformed = cleanValue(ejs.render(value, origin)); | ||
// If the strings are differents, a replacement happened. | ||
hasReplacment = hasReplacment || (transformed !== value); | ||
return transformed; | ||
@@ -60,0 +66,0 @@ }); |
{ | ||
"name": "config-templator", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Dynamic replacement in object, inspired by GruntJS config", | ||
@@ -31,4 +31,5 @@ "homepage": "https://github.com/loicmahieu/config-templator", | ||
"grunt-contrib-watch": "~0.5.0", | ||
"chai": "~1.7.2" | ||
"chai": "~1.7.2", | ||
"grunt-release": "~0.7.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10080
272
5
10