/**
* Set query string parameter value
*/
function setParam(url, paramName, value){
url = url || '';
var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' );
var param = paramName +'='+ encodeURIComponent( value );
if ( re.test(url) ) {
return url.replace(re, '$1'+ param);
} else {
if (url.indexOf('?') === -1) {
url += '?';
}
if (url.indexOf('=') !== -1) {
url += '&';
}
return url + param;
}
}
module.exports = setParam;
# |
Change |
User |
Description |
Committed |
|
#1
|
23539 |
jenbottom |
Adding the basic code for ember test appk, created with 'ember new' command |
|
|