vendor/emmet.js
function(str, vars) {
			vars = vars || {};
			var resolver = _.isFunction(vars) ? vars : function(str, p1) {
				return p1 in vars ? vars[p1] : null;
			};
			
			var res = require('resources');
			return require('tabStops').processText(str, {
				variable: function(data) {
					var newValue = resolver(data.token, data.name, data);
					if (newValue === null) {
						// try to find variable in resources
						newValue = res.getVariable(data.name);
					}
					
					if (newValue === null || _.isUndefined(newValue))
						// nothing found, return token itself
						newValue = data.token;
					return newValue;
				}
			});
		}
function(str, vars) {
			vars = vars || {};
			var resolver = _.isFunction(vars) ? vars : function(str, p1) {
				return p1 in vars ? vars[p1] : null;
			};
			
			var res = require('resources');
			return require('tabStops').processText(str, {
				variable: function(data) {
					var newValue = resolver(data.token, data.name, data);
					if (newValue === null) {
						// try to find variable in resources
						newValue = res.getVariable(data.name);
					}
					
					if (newValue === null || _.isUndefined(newValue))
						// nothing found, return token itself
						newValue = data.token;
					return newValue;
				}
			});
		}
function ( str , vars ) { vars = vars || { } ; var resolver = _ . isFunction ( vars ) ? vars : function ( str , p1 ) { return p1 in vars ? vars [ p1 ] : null ; } ; var res = require ( 'resources' ) ; return require ( 'tabStops' ) . processText ( str , { variable : function ( data ) { var newValue = resolver ( data . token , data . name , data ) ; if ( newValue === null ) { // try to find variable in resources newValue = res . getVariable ( data . name ) ; } if ( newValue === null || _ . isUndefined ( newValue ) ) // nothing found, return token itself newValue = data . token ; return newValue ; } } ) ; }
Replace variables like ${var} in string
@param {String} str
@param {Object} vars Variable set (defaults to variables defined in
<code>snippets.json</code>) or variable resolver (<code>Function</code>)
@return {String}
Replace variables like $ { var } in string