Skip to content

Commit 8344d08

Browse files
committed
A bit more of minor optimization
1 parent 819ab75 commit 8344d08

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

client/router.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ class Router {
148148
const queryParams = this._qs.parse(context.querystring);
149149
this._current = {
150150
path: context.path,
151-
context: context,
152151
params: context.params,
153-
queryParams: queryParams,
154-
route: route,
155-
oldRoute: oldRoute
152+
route,
153+
context,
154+
oldRoute,
155+
queryParams
156156
};
157157

158158
// we need to invalidate if all the triggers have been completed
@@ -208,7 +208,7 @@ class Router {
208208

209209
// Prefix the path with the router global prefix
210210
if (this._basePath) {
211-
path += '/' + this._basePath + '/';
211+
path += `/${this._basePath}/`;
212212
}
213213

214214
path += pathDef.replace(this.pathRegExp, (_key) => {
@@ -243,7 +243,7 @@ class Router {
243243

244244
const strQueryParams = this._qs.stringify(queryParams || {});
245245
if (strQueryParams) {
246-
path += '?' + strQueryParams;
246+
path += `?${strQueryParams}`;
247247
}
248248

249249
path = path.replace(/\/\/+/g, '/');
@@ -300,7 +300,7 @@ class Router {
300300
const queryParams = _.clone(this._current.queryParams);
301301
_.extend(queryParams, newParams);
302302

303-
for (let k in queryParams) {
303+
for (const k in queryParams) {
304304
if (queryParams[k] === null || queryParams[k] === undefined) {
305305
delete queryParams[k];
306306
}
@@ -639,7 +639,7 @@ class Router {
639639
// We need to remove the leading base path, or "/", as it will be inserted
640640
// automatically by `Meteor.absoluteUrl` as documented in:
641641
// http://docs.meteor.com/#/full/meteor_absoluteurl
642-
return Meteor.absoluteUrl(this.path.apply(this, arguments).replace(new RegExp('^' + ('/' + (this._basePath || '') + '/').replace(/\/\/+/g, '/')), ''));
642+
return Meteor.absoluteUrl(this.path.apply(this, arguments).replace(new RegExp('^' + (`/${this._basePath || ''}/`).replace(/\/\/+/g, '/')), ''));
643643
}
644644
}
645645

0 commit comments

Comments
 (0)