Skip to content

Commit

Permalink
[ML] use Set
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jan 16, 2020
1 parent d94e8dd commit 2ac8133
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/ml/public/application/util/url_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import { getNestedProperty } from './object_utils';
export type SetUrlState = (attribute: string | Dictionary<any>, value?: any) => void;
export type UrlState = [Dictionary<any>, SetUrlState];

const decodedParams = ['_a', '_g'];
const decodedParams = new Set(['_a', '_g']);
function getUrlState(search: string) {
const urlState: Dictionary<any> = {};
const parsedQueryString = queryString.parse(search);

try {
Object.keys(parsedQueryString).forEach(a => {
if (decodedParams.includes(a)) {
if (decodedParams.has(a)) {
urlState[a] = decode(parsedQueryString[a]) as Dictionary<any>;
} else {
urlState[a] = parsedQueryString[a];
Expand Down

0 comments on commit 2ac8133

Please sign in to comment.