Source: helpers/utils/filter-tree-utils.js

/**
 * Utils module of filter tree
 * @module Utils/FilterTreeUtils
 */

import jQ from "jquery";
import Settings from "../settings";
import Utils from "../utils";

/**
 * Check whether the filter option param exist
 */
const checkExistFilterOptionParam = () => {
	for (var k in Globals.queryParams) {
		if (k.indexOf('pf_') > -1) {
			return true;
		}
	}
	return false;
};

/**
 * Encode URI Component
 * @param {String} paramValue The param value of URL
 */
const encodeURIParamValue = (paramValue) => {
	return encodeURIComponent(paramValue).replace(/&/g, "%26").replace(/'/g, "%27").replace(/\*/g, '%2A');
}

const FilterTreeUtils = {
	checkExistFilterOptionParam: checkExistFilterOptionParam,
	encodeURIParamValue: encodeURIParamValue
}

export default FilterTreeUtils;