static/node_modules/grunt-bake/tasks/bake.js
// Handle _if attributes in inline arguments
Handle _if attributes in inline arguments
Handle _if attributes in inline arguments
function validateIf( inlineValues, values ) {
			if ( "_if" in inlineValues ) {
				var value = inlineValues[ "_if" ];
				delete inlineValues[ "_if" ];
				var params = {};
				var condition = value.replace( ifRegex, function( match, varname ) {
					if( ! varname ) return match;
					var resolved = resolveName( varname, values );
					if ( options.semanticIf === true ) {
						resolved = [ "no", "off" ].indexOf( resolved ) === -1;
					} else if ( mout.lang.isArray( options.semanticIf ) ) {
						resolved = options.semanticIf.indexOf( resolved ) === -1;
					} else if ( mout.lang.isFunction( options.semanticIf ) ) {
						resolved = options.semanticIf( resolved );
					}
					params[ varname ] = resolved;
					return "params['" + varname + "']";
				});
				try {
					return ! eval( condition );
				} catch( e ) {
					grunt.log.error( "Invalid if condition: '" + value + "'" );
				}
			}
			return false;
		}
function validateIf ( inlineValues , values ) { if ( "_if" in inlineValues ) { var value = inlineValues [ "_if" ] ; delete inlineValues [ "_if" ] ; var params = { } ; var condition = value . replace ( ifRegex , function ( match , varname ) { if ( ! varname ) return match ; var resolved = resolveName ( varname , values ) ; if ( options . semanticIf === true ) { resolved = [ "no" , "off" ] . indexOf ( resolved ) === - 1 ; } else if ( mout . lang . isArray ( options . semanticIf ) ) { resolved = options . semanticIf . indexOf ( resolved ) === - 1 ; } else if ( mout . lang . isFunction ( options . semanticIf ) ) { resolved = options . semanticIf ( resolved ) ; } params [ varname ] = resolved ; return "params['" + varname + "']" ; } ) ; try { return ! eval ( condition ) ; } catch ( e ) { grunt . log . error ( "Invalid if condition: '" + value + "'" ) ; } } return false ; }
Handle _if attributes in inline arguments
Handle _if attributes in inline arguments
// check for semantic falsy values /* jshint evil:true */ /* eslint-disable no-eval */