All files / platform/app/src/utils preserveQueryParameters.ts

10% Statements 1/10
0% Branches 0/4
0% Functions 0/3
10% Lines 1/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27              145x                                      
function preserve(query, current, key) {
  const value = current.get(key);
  Iif (value) {
    query.append(key, value);
  }
}
 
export const preserveKeys = ['configUrl', 'multimonitor', 'screenNumber', 'hangingProtocolId'];
 
export function preserveQueryParameters(
  query,
  current = new URLSearchParams(window.location.search)
) {
  for (const key of preserveKeys) {
    preserve(query, current, key);
  }
}
 
export function preserveQueryStrings(query, current = new URLSearchParams(window.location.search)) {
  for (const key of preserveKeys) {
    const value = current.get(key);
    Iif (value) {
      query[key] = value;
    }
  }
}