lib/conbo.js
function(url, data)
	{
		var parsedUrl = url,
			matches = parsedUrl.match(/:\b\w+\b/g);
		
		if (!!matches)
		{
			matches.forEach(function(key) 
			{
				key = key.substr(1);
				
				if (!(key in data))
				{
					throw new Error('Property "'+key+'" required but not found in data');
				}
			});
		}
			
		conbo.keys(data).forEach(function(key)
		{
			var regExp = new RegExp(':\\b'+key+'\\b', 'g');
			
			if (regExp.test(parsedUrl))
			{
				parsedUrl = parsedUrl.replace(regExp, data[key]);
				delete data[key];
			}
		});
		
		return parsedUrl;
	}
function(url, data)
	{
		var parsedUrl = url,
			matches = parsedUrl.match(/:\b\w+\b/g);
		
		if (!!matches)
		{
			matches.forEach(function(key) 
			{
				key = key.substr(1);
				
				if (!(key in data))
				{
					throw new Error('Property "'+key+'" required but not found in data');
				}
			});
		}
			
		conbo.keys(data).forEach(function(key)
		{
			var regExp = new RegExp(':\\b'+key+'\\b', 'g');
			
			if (regExp.test(parsedUrl))
			{
				parsedUrl = parsedUrl.replace(regExp, data[key]);
				delete data[key];
			}
		});
		
		return parsedUrl;
	}
function ( url , data ) { var parsedUrl = url , matches = parsedUrl . match ( / :\b\w+\b / g ) ; if ( ! ! matches ) { matches . forEach ( function ( key ) { key = key . substr ( 1 ) ; if ( ! ( key in data ) ) { throw new Error ( 'Property "' + key + '" required but not found in data' ) ; } } ) ; } conbo . keys ( data ) . forEach ( function ( key ) { var regExp = new RegExp ( ':\\b' + key + '\\b' , 'g' ) ; if ( regExp . test ( parsedUrl ) ) { parsedUrl = parsedUrl . replace ( regExp , data [ key ] ) ; delete data [ key ] ; } } ) ; return parsedUrl ; }
Splice data into URL and remove spliced properties from data object
Splice data into URL and remove spliced properties from data object