Code coverage report for stylus-lint/src/checks/checkForCommentStart.js

Statements: 100% (8 / 8)      Branches: 100% (6 / 6)      Functions: 100% (1 / 1)      Lines: 100% (7 / 7)      Ignored: none     

All files » stylus-lint/src/checks/ » checkForCommentStart.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20    1         1 12462   12461   1621 1240     381      
'use strict';
 
var
    hasComment = /(\/\/)/,
    startWithLineComment = /(^\/\/)/;
 
// check for line comment on the line
module.exports = function checkForStart( line ) {
    if ( typeof line !== 'string' ) { return; }
 
    if ( hasComment.test(line) ) {
        // ex }, but only if we've already establish that we're not in a hash
        if ( startWithLineComment.test(line.trim()) ) {
            return true;
        }
        else {
            return false;
        }
    }
}