
export function parseRangeFilters(stringValue = '') {
  if (!stringValue) {
    return [];
  }
  return stringValue.split('~').map(s => {
    const m = s.match(/range-(-?[0-9.]+)_(-?[0-9.]+)/);
    if (!m) {
      return { start: 0, end: 1000 };
    }
    return { start: m[1] * 1000, end: m[2] * 1000 };
  });
}

export function stringifyRangeFilters(arrayValue = []) {
  return arrayValue.map(({ start, end }) => {
    const startStr = (start / 1000).toFixed(4);
    const endStr = (end / 1000).toFixed(4);
    return `range-${startStr}_${endStr}`;
  }).join('~');
}


export function parseRangeFilters(stringValue = '') {
  if (!stringValue) {
    return [];
  }
  return stringValue.split('~').map(s => {
    const m = s.match(/(-?[0-9.]+)_(-?[0-9.]+)/);
    if (!m) {
      return { start: 0, end: 1000 };
    }
    return { start: m[1] * 1000, end: m[2] * 1000 };
  });
}

export function stringifyRangeFilters(arrayValue = []) {
  return arrayValue.map(({ start, end }) => {
    const startStr = (start / 1000).toFixed(4);
    const endStr = (end / 1000).toFixed(4);
    return `${startStr}_${endStr}`;
  }).join('~');
}

Remove the word 'range' from the range filter list items because we are not going to add other types of filters to that list. Callstack focus filters will be a separate filter list.
Remove the word 'range' from the range filter list items because we are not going to add other types of filters to that list. Callstack focus filters will be a separate filter list.
