tasks/json_bake.js
function parseJSON( path, content ) {

            return JSON.parse( content, function( key, value ) {

                if ( options.stripComments && key === "{{comment}}" ) return undefined;

                // Replace variables in their values

                if ( Object.keys( options.variables ).length && typeof value === "string" ) {
                    value = replaceVariables( value );
                }

                var match = ( typeof value === "string" ) ? value.match( options.parsePattern ) : null;

                if ( match ) {
                    var folderPath = getFolder( path ) || ".";
                    var fullPath = folderPath + "/" + match[ 1 ];

                    return isDirectory( fullPath ) ? parseDirectory( fullPath ) : parseFile( fullPath );
                }

                return value;

            } );
        }
function parseJSON( path, content ) {

            return JSON.parse( content, function( key, value ) {

                if ( options.stripComments && key === "{{comment}}" ) return undefined;

                // Replace variables in their values

                if ( Object.keys( options.variables ).length && typeof value === "string" ) {
                    value = replaceVariables( value );
                }

                var match = ( typeof value === "string" ) ? value.match( options.parsePattern ) : null;

                if ( match ) {
                    var folderPath = getFolder( path ) || ".";
                    var fullPath = folderPath + "/" + match[ 1 ];

                    return isDirectory( fullPath ) ? parseDirectory( fullPath ) : parseFile( fullPath );
                }

                return value;

            } );
        }
function parseJSON ( path , content ) { return JSON . parse ( content , function ( key , value ) { if ( options . stripComments && key === "{{comment}}" ) return undefined ; // Replace variables in their values if ( Object . keys ( options . variables ) . length && typeof value === "string" ) { value = replaceVariables ( value ) ; } var match = ( typeof value === "string" ) ? value . match ( options . parsePattern ) : null ; if ( match ) { var folderPath = getFolder ( path ) || "." ; var fullPath = folderPath + "/" + match [ 1 ] ; return isDirectory ( fullPath ) ? parseDirectory ( fullPath ) : parseFile ( fullPath ) ; } return value ; } ) ; }
Parses a JSON file and returns value as object
Parses a JSON file and returns value as object