tasks/lib/writer.js
function addPropertiesToText(text, properties, filePath) {

        if (!properties.length) {
            return text;
        }

        var placeRegexp = patterns.getPlacePattern(properties[0].isFromPrototype),
            matchedData = placeRegexp.exec(text);

        // Can`t find properties place
        if (!matchedData) {
            grunt.log.error("No " + (properties[0].isFromPrototype ? "prototype" : "inline") + " properties place definition at " + filePath +
                '   (properties: ' + properties.map(function (p) {return p.name + ' at ' + p.filePath; }).join(', ') + ')');

            return text;
        }

        // don`t use .replace with "$" at replacement text
        return text.replace(placeRegexp, function () {
            return (matchedData[1] ?  matchedData[1] + ',' : '') +
                ('\n\n' + concatProperties(properties))
                    .replace(/\n(?!\r?\n)/g, '\n' + matchedData[2]);
        });
    }
function addPropertiesToText(text, properties, filePath) {

        if (!properties.length) {
            return text;
        }

        var placeRegexp = patterns.getPlacePattern(properties[0].isFromPrototype),
            matchedData = placeRegexp.exec(text);

        // Can`t find properties place
        if (!matchedData) {
            grunt.log.error("No " + (properties[0].isFromPrototype ? "prototype" : "inline") + " properties place definition at " + filePath +
                '   (properties: ' + properties.map(function (p) {return p.name + ' at ' + p.filePath; }).join(', ') + ')');

            return text;
        }

        // don`t use .replace with "$" at replacement text
        return text.replace(placeRegexp, function () {
            return (matchedData[1] ?  matchedData[1] + ',' : '') +
                ('\n\n' + concatProperties(properties))
                    .replace(/\n(?!\r?\n)/g, '\n' + matchedData[2]);
        });
    }
function addPropertiesToText ( text , properties , filePath ) { if ( ! properties . length ) { return text ; } var placeRegexp = patterns . getPlacePattern ( properties [ 0 ] . isFromPrototype ) , matchedData = placeRegexp . exec ( text ) ; // Can`t find properties place if ( ! matchedData ) { grunt . log . error ( "No " + ( properties [ 0 ] . isFromPrototype ? "prototype" : "inline" ) + " properties place definition at " + filePath + '   (properties: ' + properties . map ( function ( p ) { return p . name + ' at ' + p . filePath ; } ) . join ( ', ' ) + ')' ) ; return text ; } // don`t use .replace with "$" at replacement text return text . replace ( placeRegexp , function ( ) { return ( matchedData [ 1 ] ? matchedData [ 1 ] + ',' : '' ) + ( '\n\n' + concatProperties ( properties ) ) . replace ( / \n(?!\r?\n) / g , '\n' + matchedData [ 2 ] ) ; } ) ; }
Replace place pattern with concated properties
@param text {String}
@param properties {Array}
@param filePath {String}
@returns {String}
Replace place pattern with concated properties