var cache = [],
num = 0;
// check for z-index values and recommend normalized ones
module.exports = function zIndexr( line, arr ) {
'use strict';
if ( typeof line === 'undefined' ) {
return;
}
var res, zIndexValue;
arr = line.split(/[\s\t,:]/),
// remove white space
arr = arr.filter(
function( str ) {
return str.length > 0;
}
);
// the most basic of checks, throw warning if zindex value not normalized
if ( line.indexOf('z-index') !== -1 ) {
zIndexValue = arr[ arr.length - 1 ];
if ( zIndexValue % this.config.zIndexr !== 0 ) {
res = 'normalize';
console.log( 'not normalized' );
}
cache.forEach(function( val, i ) {
if ( cache[ i ] === zIndexValue ) {
res = 'duplicate';
console.log( 'dupe found' );
}
});
cache.push( zIndexValue );
}
return res;
} |