Skip to content

Commit

Permalink
Added util function comments and updated build
Browse files Browse the repository at this point in the history
  • Loading branch information
JawHawk committed Mar 20, 2024
1 parent 469a50c commit 265c440
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion benchexec/tablegenerator/react-table/build/main.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion benchexec/tablegenerator/react-table/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const EXTENDED_DISCRETE_COLOR_RANGE = [
];

/**
* Parses the search parameters from the URL hash or a provided string.
* Parses and decodes the search parameters except filter from the URL hash or a provided string.
*
* @param {string} - Optional string to parse. If not provided, parses the URL hash of the current document.
* @returns {Object} - An object containing the parsed search parameters.
Expand All @@ -223,6 +223,8 @@ const getURLParameters = (str) => {
// Split the search string into key-value pairs and generate an object from them
const keyValuePairs = search.split("&").map((pair) => pair.split("="));
const out = {};

// All parameters in the search string are decoded except filter to allow filter handling later on its own
for (const [key, ...value] of keyValuePairs) {
out[decodeURI(key)] =
key === "filter" ? value.join("=") : decodeURI(value.join("="));
Expand Down Expand Up @@ -401,6 +403,10 @@ export const decodeFilter = (filterID) => {
if (splitedArray.length === 2) {
throw new Error("Invalid filter ID");
}

// tool is always the first element value of the splitedArray
// column is always the last element value of the splitedArray
// name is the concatenation of remaining elements in between first and last element of splitedArray, separated by _
return {
tool: splitedArray[0],
name:
Expand Down

0 comments on commit 265c440

Please sign in to comment.