grunt-bake
Advanced tools
Comparing version 0.3.13 to 0.3.14
@@ -0,0 +0,0 @@ /* |
{ | ||
"name": "grunt-bake", | ||
"description": "Bake external includes into files to create static pages with no server-side compilation time", | ||
"version": "0.3.13", | ||
"version": "0.3.14", | ||
"homepage": "https://github.com/MathiasPaumgarten/grunt-bake", | ||
@@ -53,2 +53,2 @@ "author": { | ||
] | ||
} | ||
} |
@@ -148,3 +148,7 @@ # grunt-bake [![Build Status](https://travis-ci.org/MathiasPaumgarten/grunt-bake.png?branch=master)](https://travis-ci.org/MathiasPaumgarten/grunt-bake) | ||
#### options.semanticIf | ||
Type: `Bool` | `Array` | `Function` | ||
Default value: false | ||
Set to `true` enables support for _no_/_yes_ and _off_/_on_ in `_if` statements. Alternatively false values can be defined via Array or a callback can be used for evaluation. | ||
@@ -151,0 +155,0 @@ ### Usage Examples |
@@ -26,2 +26,3 @@ /* | ||
section: null, | ||
semanticIf: false, | ||
basePath: "", | ||
@@ -107,3 +108,26 @@ parsePattern: /\{\{\s*([\.\-\w]*)\s*\}\}/g | ||
// Helper method to check if a value represents false | ||
function isFalse( value ) { | ||
var string = String( value ).toLowerCase(); | ||
if ( value === undefined || value === false || string === 'false' ) { | ||
return true; | ||
} | ||
if ( options.semanticIf === true ) { | ||
return mout.array.indexOf( [ "no", "off" ], string ) !== -1; | ||
} | ||
if ( mout.lang.isArray( options.semanticIf ) ) { | ||
return mout.array.indexOf( options.semanticIf, string ) !== -1; | ||
} | ||
if ( mout.lang.isFunction( options.semanticIf ) ) { | ||
return options.semanticIf( value ); | ||
} | ||
return false; | ||
} | ||
// Helper method to resolve nested placeholder names like: "home.footer.text" | ||
@@ -130,3 +154,3 @@ | ||
var current = mout.object.get( values, name ); | ||
var returnValue = current === false || current === undefined ? false : true; | ||
var returnValue = !isFalse( current ); | ||
@@ -133,0 +157,0 @@ return invert ? ! returnValue : returnValue; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
36144
534
524