lib/resolver/gradient/linear.js
function stringifyDirection(dir, oldStyle) {
		var reNewStyle = /^to\s/;
		var keys = Object.keys(directions).filter(function(k) {
			var hasPrefix = reNewStyle.test(k);
			return oldStyle ? !hasPrefix : hasPrefix;
		});

		for (var i = 0; i < keys.length; i++) {
			if (directions[keys[i]] == dir) {
				return keys[i];
			}
		}

		if (oldStyle) {
			dir = (dir + 270) % 360;
		}

		return dir + 'deg';
	}
function stringifyDirection(dir, oldStyle) {
		var reNewStyle = /^to\s/;
		var keys = Object.keys(directions).filter(function(k) {
			var hasPrefix = reNewStyle.test(k);
			return oldStyle ? !hasPrefix : hasPrefix;
		});

		for (var i = 0; i < keys.length; i++) {
			if (directions[keys[i]] == dir) {
				return keys[i];
			}
		}

		if (oldStyle) {
			dir = (dir + 270) % 360;
		}

		return dir + 'deg';
	}
function stringifyDirection ( dir , oldStyle ) { var reNewStyle = / ^to\s / ; var keys = Object . keys ( directions ) . filter ( function ( k ) { var hasPrefix = reNewStyle . test ( k ) ; return oldStyle ? ! hasPrefix : hasPrefix ; } ) ; for ( var i = 0 ; i < keys . length ; i ++ ) { if ( directions [ keys [ i ] ] == dir ) { return keys [ i ] ; } } if ( oldStyle ) { dir = ( dir + 270 ) % 360 ; } return dir + 'deg' ; }
Tries to find keyword for given direction, expressed in degrees
@param  {Number} dir Direction (degrees)
@param {Boolean} oldStyle Use old style keywords (e.g. "top" instead of "to bottom")
@return {String}     Keyword or <code>Ndeg</code> expression
Tries to find keyword for given direction expressed in degrees