From b2dab50250ea025948c1d8910b51a27926d735d9 Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Tue, 19 Sep 2017 15:14:32 +0100 Subject: [PATCH] Move extractArguments helper out of the object --- packages/ember-routing/lib/services/router.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/ember-routing/lib/services/router.js b/packages/ember-routing/lib/services/router.js index 653cbf21a4f..21d8edd9989 100644 --- a/packages/ember-routing/lib/services/router.js +++ b/packages/ember-routing/lib/services/router.js @@ -212,7 +212,7 @@ const RouterService = Service.extend({ @public */ isActive(/* routeName, ...models, options */) { - let { routeName, models, queryParams } = this._extractArguments(...arguments); + let { routeName, models, queryParams } = extractArguments(...arguments); let routerMicrolib = this._router._routerMicrolib; let state = routerMicrolib.state; @@ -225,20 +225,20 @@ const RouterService = Service.extend({ } return true; - }, + } +}); - _extractArguments(routeName, ...models) { - let possibleQueryParams = models[models.length - 1]; - let queryParams = {}; +function extractArguments(routeName, ...models) { + let possibleQueryParams = models[models.length - 1]; + let queryParams = {}; - if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { - let options = models.pop(); - queryParams = options.queryParams; - } - - return { routeName, models, queryParams }; + if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { + let options = models.pop(); + queryParams = options.queryParams; } -}); + + return { routeName, models, queryParams }; +} function resemblesURL(str) { return typeof str === 'string' && (str === '' || str[0] === '/');