rawInit = function (open, close, searchRegex, replaceValue) { return function (s) { return enabled
    ? open +
      (~(s += "").indexOf(close, 4) // skip opening \x1b[
        ? s.replace(searchRegex, replaceValue)
        : s) +
      close
    : s; }; }
This file should be written in ES5
Code is taken from https://github.com/jorgebucaran/colorette/blob/master/index.js
Copy it to https://buble.surge.sh and paste here