function preservesInCharClass(value, index, parent) {
  if (value === '^') {
    // Avoid [\^a] turning into [^a]
    return index === 0 && !parent.negative;
  }
  if (value === '-') {
    // Avoid [a\-z] turning into [a-z]
    return index !== 0 && index !== parent.expressions.length - 1;
  }
  return /[\]\\]/.test(value);
}
function preservesInCharClass(value, index, parent) {
  if (value === '^') {
    
    return index === 0 && !parent.negative;
  }
  if (value === '-') {
    
    return index !== 0 && index !== parent.expressions.length - 1;
  }
  return /[\]\\]/.test(value);
}
function preservesInCharClass ( value , index , parent ) { if ( value === '^' ) { // Avoid [\^a] turning into [^a] return index === 0 && ! parent . negative ; } if ( value === '-' ) { // Avoid [a\-z] turning into [a-z] return index !== 0 && index !== parent . expressions . length - 1 ; } return / [\]\\] / . test ( value ) ; }
\], \\, \^, \-
\ ] \\ \ ^ \ -