lib/auto-generate.js
function getPart(name, fileContent, options) {
    if (!name || !options) { throw new Error('name and options are required.'); }

    var parts       = fileContent.match(getRegularExpression(name));

    if ( parts ) {           // Aranan bölüm varsa
        var fileContentDigest = calculateMD5(parts[3], options);
        return {
            all         : parts[0],
            startLine   : parts[1],
            warningLine : parts[2],
            content     : parts[3],
            md5Line     : parts[4],
            oldDigest   : parts[5],
            newDigest   : fileContentDigest,
            isChanged   : fileContentDigest != parts[5],
            endLine     : parts[6]
        }
    }
    else {
        return null;
    }
}
function getPart(name, fileContent, options) {
    if (!name || !options) { throw new Error('name and options are required.'); }

    var parts       = fileContent.match(getRegularExpression(name));

    if ( parts ) {           // Aranan bölüm varsa
        var fileContentDigest = calculateMD5(parts[3], options);
        return {
            all         : parts[0],
            startLine   : parts[1],
            warningLine : parts[2],
            content     : parts[3],
            md5Line     : parts[4],
            oldDigest   : parts[5],
            newDigest   : fileContentDigest,
            isChanged   : fileContentDigest != parts[5],
            endLine     : parts[6]
        }
    }
    else {
        return null;
    }
}
function getPart ( name , fileContent , options ) { if ( ! name || ! options ) { throw new Error ( 'name and options are required.' ) ; } var parts = fileContent . match ( getRegularExpression ( name ) ) ; if ( parts ) { // Aranan bölüm varsa var fileContentDigest = calculateMD5 ( parts [ 3 ] , options ) ; return { all : parts [ 0 ] , startLine : parts [ 1 ] , warningLine : parts [ 2 ] , content : parts [ 3 ] , md5Line : parts [ 4 ] , oldDigest : parts [ 5 ] , newDigest : fileContentDigest , isChanged : fileContentDigest != parts [ 5 ] , endLine : parts [ 6 ] } } else { return null ; } }
Finds auto generated part and returns an object which contains information about auto generated part.
If auto part with requested name cannot be found, it returns null.
@private
@param name - Name of the auto generated part.
@param fileContent - content of the file which part is searched in.
@param {genOptions} options - Options how part is generated.
@returns {partInfo|null} - Object which contains info about auto generated part.
Finds auto generated part and returns an object which contains information about auto generated part . If auto part with requested name cannot be found it returns null .