function isNormalNonZeroInteger (str) {

  if (Number.isInteger(str) && str > 0) { // Check for integers above 0
    return str;
  } else { // Check for strings that cast to ints that are above 0
    var n = ~~Number(str);
    return String(n) === str && n > 0;
  }
}
Preserve a specific number of artifacts

1 = keep only th last run
2 = keep the last run and the one before it, purging any that happened beforehand