Skip to content

Commit

Permalink
fix(dynamic): Use 'find' from common.ts instead of Array.prototype.find
Browse files Browse the repository at this point in the history
Closes #215
  • Loading branch information
christopherthielen committed Jul 25, 2018
1 parent cfdf04f commit 66a3244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/params/param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @coreapi
* @module params
*/ /** for typedoc */
import { extend, filter, map, allTrueR } from '../common/common';
import { extend, filter, map, allTrueR, find } from '../common/common';
import { prop } from '../common/hof';
import { isInjectable, isDefined, isString, isArray, isUndefined } from '../common/predicates';
import { RawParams, ParamDeclaration } from '../params/interface';
Expand All @@ -29,7 +29,7 @@ export { DefType };

function getParamDeclaration(paramName: string, location: DefType, state: StateDeclaration): ParamDeclaration {
const noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined;
const dynamic = [state.dynamic, noReloadOnSearch].find(isDefined);
const dynamic = find([state.dynamic, noReloadOnSearch], isDefined);
const defaultConfig = isDefined(dynamic) ? { dynamic } : {};
const paramConfig = unwrapShorthand(state && state.params && state.params[paramName]);
return extend(defaultConfig, paramConfig);
Expand Down

0 comments on commit 66a3244

Please sign in to comment.