All files / src xml_utils.ts

100% Statements 21/21
100% Branches 8/8
100% Functions 2/2
100% Lines 21/21

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 21250x 250x 73x 250x 105x 177x 72x 72x 250x 1x 66x 66x 1x 1x 65x 65x 65x 65x 65x 65x 65x
export function xmlToArray(data: any): any[] {
  if (data === undefined) {
    return [];
  } else if (data.length) { // input data is an Array
    return data;
  } else {
    return [data];
  }
}
 
export function unescape(str: string | undefined): string {
  if (str === undefined) {
    return "";
  }
  str = str.replace(/&/g, "&");
  str = str.replace(/>/g, ">");
  str = str.replace(/&lt;/g, "<");
  str = str.replace(/&quot;/g, "\"");
  str = str.replace(/&apos;/g, "'");
  return str;
}