js/highcharts-master/samples/unit-tests/svgrenderer/animate-initpath/demo.js
/**
 * Check that the arrays are one to one, so all operators correspond to other
 * operators and numbers align to numbers.
 */
Check that the arrays are one to one, so all operators correspond to other
operators and numbers align to numbers.
Check that the arrays are one to one so all operators correspond to other operators and numbers align to numbers .
function isOneToOne(out) {
    var start = out[0],
        end = out[1],
        isOK = true;
    if (start.length !== end.length) {
        isOK = false;
    }
    Highcharts.each(start, function (item, i) {
        if (/[a-zA-Z]/.test(item) && !/[a-zA-Z]/.test(end[i])) {
            isOK = false;
        } else if (!/[a-zA-Z]/.test(item) && /[a-zA-Z]/.test(end[i])) {
            isOK = false;
        }
    });
    if (!isOK) {
        console.log('--- Failed path ---');
        for (var i = 0; i < Math.max(start.length, end.length); i++) {
            console.log(start[i], end[i]);
        }
    }
    return isOK;
}
function isOneToOne ( out ) { var start = out [ 0 ] , end = out [ 1 ] , isOK = true ; if ( start . length !== end . length ) { isOK = false ; } Highcharts . each ( start , function ( item , i ) { if ( / [a-zA-Z] / . test ( item ) && ! / [a-zA-Z] / . test ( end [ i ] ) ) { isOK = false ; } else if ( ! / [a-zA-Z] / . test ( item ) && / [a-zA-Z] / . test ( end [ i ] ) ) { isOK = false ; } } ) ; if ( ! isOK ) { console . log ( '--- Failed path ---' ) ; for ( var i = 0 ; i < Math . max ( start . length , end . length ) ; i ++ ) { console . log ( start [ i ] , end [ i ] ) ; } } return isOK ; }
Check that the arrays are one to one, so all operators correspond to other
 operators and numbers align to numbers.
Check that the arrays are one to one so all operators correspond to other operators and numbers align to numbers .